Allegro.cc - Online Community

Allegro.cc Forums » The Depot » MapSlapper

This thread is locked; no one can reply to it. rss feed Print
MapSlapper
23yrold3yrold
Member #1,134
March 2001
avatar

Well I'm leaving it for a while like I said. The main.cpp is mostly C-ish anyway (basic Win32) so if anyone wants to poke around in there, go for it.

Derezo: did it bring up "Bummer" just by running the program? Because it shouldn't even be loading a tilemap unless you double click on a file, and you can't because the registry-editing code has been removed. Very odd you saw that ...

I'm going to go work on something else; this thing is starteing to be a nightmare :P I was supposed to be done with it last week ::) And I made a post on the GameDev forum; haven't got an answer yet ...

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

Derezo
Member #1,666
April 2001
avatar

I took a look at the source before, got lost easy :P I know very little about Win32.

It does say 'bummer' when I run the executable. Perhaps that's why it's crashing? ???
It crashes after the window is drawn. If I'm fast enough, I can even click stuff. ;D

"He who controls the stuffing controls the Universe"

23yrold3yrold
Member #1,134
March 2001
avatar

No, the "Bummer" shouldn't matter, it just shouldn't be appearing at all :)

I lied; I'm updating the zip one more time. This time I'm just getting rid of the code that says "Bummer", since you can't open files by double-clicking right now anyway ::) This is what, version 1.32098432 now? ;) We'll call it version 1 when XP users can run it :P ...

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

Trumgottist
Member #95
April 2000
avatar

No, I'm just running the same program and making up new error messages, just to mess with you. ::) Anyway, I redownloaded it, just in case, and all your crash are belong to us.

I might take a look at the source later, but not right now.

Edit: I've got it to compile (despite lots of compiler warnings) and have (not surprisingly) narrowed it down to the creation of TilemapWindow. I'll continue the search for the problem... (I like bughunts like this.:))

Edit again: It's this line
buffer = create_bitmap(winwidth, winheight);
in WM_SIZE that crashes. Changing that to create a bitmap where w > 0 and h > 0 cause the program to continue (and crash later).

--
"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

Richard Phipps
Member #1,632
November 2001
avatar

I did have a problem in the first version of Stylepaint where I was creating a bitmap of width 0 and height 0 (for an empty brush). Worked perfectly in 95/98 (which I have on my old pc), but crashed everytime in XP.

Perhaps this problem is something similar?

Rich.

Derezo
Member #1,666
April 2001
avatar

Very very interesting.
I downloaded again. I still get the bummer message.... (???).

However, I sort of pinned down why it's crashing a little (on my system, anyway :-/).
If I move my mouse away from the window, and use enter to open the app.. then it runs ok. I can move the window around, and what not, but if I move the mouse anywhere inside the window other than the title bar, it crashes.

Could this have something to do with your scroll mouse routines? :)

"He who controls the stuffing controls the Universe"

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

Could this have something to do with your scroll mouse routines?

No. ;) And there should be no excuse for the bummer message now, because that function isn't even being called! >_< Unless you're selecting File->Open ...

I suspect moving all the double buffer stuff into WM_PAINT might help except a) while I can see why that would help for the DC, there should be no need for the BITMAP, and b) it could cause immense slowdown to recreate and destroy all the bitmaps and stuff every repaint. I'll try narrowing down the dirty rectangle system so it's no longer a subbitmap of a window-sized buffer, but a buffer the size of the dirty rectangle. Might help.

Rich: Dat so? Wasn't that problem solved? If not, maybe we've got us a bug here?

EDIT: A GameDever gave me a lead ...

null_pointer said:

A quick guess is that your program relies on some measurements that are only the values you expect when the "old" Windows "look" is being used, but it could be something more complicated.

The main editing window keeps track of its size like this:

   case WM_SIZE:
      winwidth  = LOWORD(lParam);
      winheight = HIWORD(lParam);
      ....

Shall I do it another way?

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

X-G
Member #856
December 2000
avatar

What kind of error checking/verifying are you doing on the values you receive?

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

23yrold3yrold
Member #1,134
March 2001
avatar

You're looking at it :P Should I have the program log the values in a file for you XP guys?

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

X-G
Member #856
December 2000
avatar

That might be a good idea - and so may things like checking that they are both > 0 and so on.

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

23yrold3yrold
Member #1,134
March 2001
avatar

They are both initially 0, then the sizes are about the values you'd expect (642 x 449). Isn't there some function for getting a client rectangle's dimensions? Would that be appropriate there for getting the width and height (and would it give me the same numbers I'm getting now?)

EDIT: Okay, the reason I got zeros is because the windows are initially 1x1; the size doesn't get set until I know the size of the main window, so I set it in WM_SIZE using MoveWindow. I gave them initial sizes of 10x10 this time, and the log said 8, 8. Also, I get the size like this in WM_CREATE for the main window:

  winwidth  = ((LPCREATESTRUCT)lParam)->cx;
  winheight = ((LPCREATESTRUCT)lParam)->cy;

Anything wrong with that?

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

Richard Phipps
Member #1,632
November 2001
avatar

So if they were being set 1 x 1 before, but really (according to the log) being set as -1 x -1 that might well be it. XP seems to be a lot more strict on stuff like this than 95/98.

BTW: I fixed the bug in stylepaint long ago. :)

23yrold3yrold
Member #1,134
March 2001
avatar

New version up which seems to have nailed it. Any more problems?

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

MiquelFire
Member #3,110
January 2003
avatar

Remember that bug I stated with the "Edit tile blit style"? It seems to crash the program when you close it now... After doing the thing that crashed it before however (at least that part is fixed)

BTW, I'm using XP Home Themes off (not going to turn them on... waste of my 1280x1024 screen space :P)

edit: skip the part about the log thing, so here's mine:

/*
541, 457
522__438
523, 439
522__438
515, 393
514__392
904, 636
903__635
904, 652
903__651
920, 652
919__651
*/

And are you ever going to have your binary have the icon? ???

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

23yrold3yrold
Member #1,134
March 2001
avatar

The files use the icon; they just don't do it for you because the program skips the registry ... um, registering :) I haven't designed a program icon yet.

I don't think the log matters anymore :)

So now when you click the 'X' close button in the Blit Type editing dialog, the program crashes? Odd; I just played with it and it gave me no problems ...

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

MiquelFire
Member #3,110
January 2003
avatar

About the icon, not the files, the exe itself (the second to last line in the rsrc.rc file) And you have an icon in the zip file, use that for now.

And it seems I can get two different errors for that, one with a debug button and a close button. Another with the OK/Cancel combo... Anyway, it's only if you click and hold the mouse button and move the mouse side to side quickly... then close. Odd case thing, not anything to worry about... until more major bugs are taken care of first... with a shotgun! ;D

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

23yrold3yrold
Member #1,134
March 2001
avatar

The icon in the zip is for the files :P And the second-last line in the rsrc.rc file is just a leftover from the project I copied it from :) It'll get an icon one day; that's low-priority ...

Your bug report is a bit criptic; what's a "debug button"? This is probably the most major bug at the moment ...

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

Thomas Fjellstrom
Member #476
June 2000
avatar

I don't think this will have anything to do with it... but maybe it will.. I used to have problems when giving a window a too small size... ie 0x0 or 1x1 etc... Even if a explicitly called MoveWindow/ShowWindow the window would still be hidden. It was weird. Try starting off with 100x100 or something?

Quote:

what's a "debug button"?

You never seen the window that says "Program caused an error: Would you like to debug?" And it has a "Debug button" on it?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Cage
Member #1,277
March 2001

I've never seen that, save for a few weird crashes on obscure programs... :P

-----
"I'm dumb!. it prolly wont do anything just like Sub7 when u extract it to ur own system I'm dumb!." - theforgotten
"heh i got hit by sub7 before. I just dont know how i got it. It took me about 2 yrs to figure out which virus i had. I'm dumb!. then i started wanting to hack and i got sub7 just ot play around with it and i found the features in it that i had been affected by when i got the virus." - theforgotten

Thomas Fjellstrom
Member #476
June 2000
avatar

the window is actually an 2k,XP feature, or you might have it if VC++ comes with it... I've heard people call it Dr. Watson. And Dr.Mingw integrates with it.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

That window pops up if an app registers itself to be interested in the debug info.
Dr. Watson does this. Dr. MinGW does this. Visual C does this.

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

Matt Smith
Member #783
November 2000

Minor UI whines

  • The map could auto-scroll when the mouse is near the edge.

  • The window could have visual hint that it is resizable (e.g. // in bottom right corner)

  • The Tileset window could be dockable.

otherwise praises be heaped upon ye ;D

23yrold3yrold
Member #1,134
March 2001
avatar

First point: Oh yeah; good idea. I'll see if I can do that without the map moving at warp speed :) Second point: does Windows provide a way to do that easily? Third point: already mentioned ;)

Spellcaster: does it work for you now?

And I understand what MB was saying now :)

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

Surt
Member #273
April 2000
avatar

Auto-scroll in a windowed app is nasty!

---
--
-

Chris Amos
Member #3,235
February 2003
avatar

nice. needs support for paint brushes (or atleast copy/pasting regions), multiple layers, and vector collision.

looking good.

EDIT: O yeah, and i dont know if you have this already because I didnt look it over very well, but it should let you define the size of your tiles.

~ Twisted Matrix



Go to: