Allegro.cc - Online Community

Allegro.cc Forums » The Depot » MapSlapper

This thread is locked; no one can reply to it. rss feed Print
MapSlapper
spellcaster
Member #1,493
September 2001
avatar

X-G, I know.
But I'd prefer if 23 could simply fix the bug ;)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Trezker
Member #1,739
December 2001
avatar

I've tested the Slapper and likes it a little.
Didn't run on XP, but I'll try the themes-off thing when I get home if I remember.

Has run it on 98, works well.

I've read every word of the docs.

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

But I'd prefer if 23 could simply fix the bug

So would 23. But I have no idea what the problem is.
What if you compile it from scratch?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

X-G
Member #856
December 2000
avatar

Compiling from scratch didn't help when I tried it, so I doubt it's going to work for SC. :-/

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Matthew Leverton
Supreme Loser
January 1999
avatar

Ok, I just tried it on my "out-of-the-box" laptop with Windows XP SP1. Nothing happens after double-clicking on the program. If I look at the task manager, I can see that the process starts. It dies without any warning a few seconds later.

Upon disabling the visual themes for the executable, it loaded right up. I may play around with the source if I feel up to it.

Trumgottist
Member #95
April 2000
avatar

I've played around a bit with the Compability Administrator for XP and MapSlapper, and I think I've narrowed down the reason for the crash. Applying the compability fix called AliasDXDC allows MapSlapper to run without disabling themes. This is the description of the fix:

MS Compability Administrator said:

Windows 9x and Windows 2000 internally cache DirectDraw DC handles. This guarantees that the same DC would be returned for a particular surface regardless of how many times it was released and acquired. This compatibility fix aliases DCs returned by DirectDraw and then de-aliases them when GDI functions are called.

I hope that helps.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

Thanks Trumgottist! So is this something I need to do or is this something the end user needs to do?

BTW, I just picked up a mouse w/ scroll wheel, so I get to code the tile scrolling now :)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

It's something you need to do if it is to work nicely in XP, but I've narrowed down the problem for you. Exactly how to fix it I leave to you to figure out. :)

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

Sounds like I either need to give windows their own DC or stop doing so :P Either someone will have to narrow it down for me or I release 50 versions which you try until it works ;D

I'll see if I'm using any CS_OWNDC messages or anything later.

EDIT: I added mouse wheel functionality; scrolling with it while drawing with the left or right button moves through the tiles now. Details are at the bottom of tour.html. Works great; I love it :D

Google turns up nothing on AliasDXDC, so heck if I know what to do with this info :P I don't have XP so I can't check "this" compatability fix ("this" like Trumgottist already has it?), and I'm not doing anything special with the DC's that I can see :-/ ... anyone wanna be a little more specific?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

I don't know C++, so I haven't even looked at your source, but what the quote above says is that you shouldn't count on a DC for a particular surface to stay the same. Exactly what that means, I don't know since I know nothing about DCs. However, if you want to throw test versions at me, feel free. :)

You shouldn't worry about AliasDXDC, it's just a part of the Compability Administrator - a tool I used to get your program running. What's intresting is only that your program runs with that fix loaded = that's where the trouble is. Sorry if I confused you.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

Okay, I think I found something like that. I have a "double-buffering" HDC that's static and updated in WM_SIZE for the main tile-drawing window. I've now restrained it's creation and destruction to WM_PAINT (which I didn't do initially since I thought it might be slower). It still works for me, so let's see if it works for you :) I may also be doing this in other dialogs, but it should at least run now.

On the scroll wheel stuff; you may find tile scrolling while drawing messes up the Undo. It seems to work okay for the left button but not the right; I'm working on fixing this :) ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

Still the same.

(Btw: Tried to compile it with VC 6... tons of errors and warnings. _argc and _argv for example)

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

So what should I use for VC6? _argc and _argv work fine in MinGW ???

I made a minor change or two; any difference?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

Crash, boom, bang.

GetCommandLine() - (That's what the Allegro sources use.)

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

Yeah, I guess Roxette would be big in Sweden ;) I tried GetCommandLine() once but had problems (old thread); I could try again ...

Okay, this one comments out the main message pump and just displays a friggin' MessageBox(). Does that at least come up!?

Any other XP users are free to jump in and give Trrumgotist a break ;)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

Nope. Still crash.

Edit: This one crashes with disabled themes aswell. And with AliasDXDC. Weird.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

You gotta be kidding! >:( You are downloading the zip anew, right? ;)

I removed the _argv/_argc and wrote up some code to do the equivalent using GetCommandLine(), plus I added some MessageBox()'s to the initialization code. Any difference this time?

EDIT: Funny; still works just fine for me ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

"hello world"
"Registering classes!"
"Creating Window!"
Boom!

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

23yrold3yrold
Member #1,134
March 2001
avatar

Well at least it's getting past the loading now ::)

Try now; I added a check to see if CreateWindow fails. That was the command right after "Creating Window!" ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trumgottist
Member #95
April 2000
avatar

Dies immediately.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

Derezo
Member #1,666
April 2001
avatar

Odd.
I run it, it says "Bummer."
Then the window loads, without XP skins.. I clicked on it, xp skins appeared, and it crashed ::)

[edit]
That was with themse OFF.. With themes on it does pretty much the same thing, but it shows the XP skins all the time. Shouldn't it not show XP skins at all the first time? That's weird.

"He who controls the stuffing controls the Universe"

23yrold3yrold
Member #1,134
March 2001
avatar

Well I hate to cry uncle, but I honestly have no idea what else I can do :( Does it at least work with Disabled Themes for you again?

EDIT: "Bummer" means "GetCommandLine() didn't work" :P I'm not going to change the uploaded file for a while; I want to hear if the behavior has changed for anyone and I don't want to get confused as to what version you're running :) So if Matthew/Spellcaster/X-G/whoever wants to try it again, go for it.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Derezo
Member #1,666
April 2001
avatar

no, it no longer works with themes disabled. It shows the window and crashes both ways for me.

[edit]
With themes on it's a step up from when I first tried it... so, it's getting there :P

"He who controls the stuffing controls the Universe"

Trumgottist
Member #95
April 2000
avatar

And for me it crashed right away, no matter what I do.

--
"I always prefer to believe the best of everybody - it saves so much time." - Rudyard Kipling

Play my game: Frasse and the Peas of Kejick

Derezo
Member #1,666
April 2001
avatar

There must be something about this on the msdn site or gamedev or something.

"He who controls the stuffing controls the Universe"



Go to: