Download MapSlapper for Windows (125KB)
My Win32/Allegro tilemap editor is finally ready to be unveiled It's a bit plain, but quite functional. Also quite plain are the docs (just open index.html), which are included in the zip. Hopefully the cause of all the crashing last time has been done away with. Another problem was people who didn't quite understand the interface cough*TF*cough, so RTFM this time
Now that there is one.
Something the docs bring up are ideas on that whole general, do-all tilemap editor we were all discussing a few days ago. Any thoughts would be appreciated, if only so I can make a better editor for my purposes (even if no one else is interested). Also feel free to make suggestions for MapSlapper's interface; I find it quite intuitive but maybe someone has some ideas that I missed. I should probably figure out how to static-link so no one needs the dll ...
Uh, I guess that's it. I'm all types out from the docs G'night.
BTW, for those who remember my registry thread; that code has been commented out, so this isn't going to leave annoying little presents in your Windows registry.
EDIT: link didn't work for me, but copying & pasting the url into the address bar did. I hate when that happens!
Your link works fine for me I'll try it out after I get a new release of Dr. Strange out. (almost ready... just a bug to squash)
yeah, link worked fine for me.. but I'm having troubles running allegro programs for the moment
(See allegro 4.0.3 thread for details )
Should be remedied shortly.
[edit]
Upon running MapSlapper.exe, I get the following error:
The instruction at "0x77f67f25" referenced memory at "0x00000000". The memory could not be "written".
In other words.. you can't write to NULL Chris!
[edit2]
Btw, this happens right away - before I can see anything on the screen. I tried to look through your source but I got lost very, very, very easily
Wanna be a little more specific? AFAIK I'm doing nothing out of the ordinary. Someone who knows Win32 and gets crashes is going to have to look at it, because it runs perfectly for me here (which means I can't fix it
).
Flecko: I'm running Win98.
Aye, I'm running WinXP chris, and I get the same error as Derezo. IIRC, you said you run WindowsME or something similar(of the 9x variety at least?) Perhaps you need someone who knows what they're doing(not me ) look into it.
Really looking forward to checking this out though.
-Flecko
EDIT: I tried enabling 9x compatibility under WinXP, no dice. Sorry I can't help further Chris, but I know absolutely zero about win32 programming. Best of luck though, its a huge step to take(win32 programming that is.)
I am running WinXP as well. I can't really be more specific than that
[url http://www.allegro.cc/forums/view_thread.php?_id=233605#post_233801]
Of course, that was then. I just tried it on Windows 2000 and XP, and it works fine (so far).
Yes, I noted that post before starting this thread. I didn't find it too helpful But I checked the docs and apparently that call shoudn't be essential, so I commented it out and recompiled and it still works. I'm uploading an updated zip now; it will be interesting to see if this makes a difference ...
I just tried it on Windows 2000 and XP, and it works fine (so far).
Oh, okay. Good I'm still uploading the non-UpdateWindow() version though, since others still seem to be having troubles (which sucks). Flecko, try it again ...
Got the new version, still no go. Really sucks for you since you don't have WinXP to test on. I'm really in the dark here. I eventually got your animation editor working before(still have it, and it works fine) so I don't get what the big problem is.
Hopefully you can get it worked out so in the future, people will know, because honestly, it should work regardless of windows version.
Good luck,
-Flecko
I tried again as well, but I still get the error.
I see an UpdateWindow() in the source still, too. Perhaps you didn't add that to the zip though?
it should work regardless of windows version.
Tell me about it I couldn't believe the last thread; crash after crash ...
Does seem odd that it's more or less exclusive to the XP guys. I'm happy Matthew got it working though
Derezo: the binary is updated; but I guess I forgot to update main.cpp (oops). I'll take care of that now ...
Got an error, something about needing Alleg40.dll.
Actually I wiped my comp and am now setting it up. So I installed the alleg40.dll and then got the error 'MSVCR70.DLL missing'. Had to hunt that one down on the net.
Finally up and running and it looks good.
Finally up and running and it looks good.
Hallelujah! What's your OS?
I found what appears to be a minor bug.
When one places a tile where (x == -1) and/or (y == -1) a tile is placed at (x == 0) and/or (y == 0) and that tile doesn't draw fully, have to pass cursor over tile to redraw it.
I thought I fixed that. Okay, thanks. I reproduced it; should be easy to fix. EDIT: fixed.
Any other feedback? It rocks, it sucks, what? Anyone?
I get the same crashes as the others when I try to run it (Windows XP Home). I have no problems with other Allegro apps. I tried compiling it, but that didn't work at all, either. See this for more info.
Interesting errors, X-G:
CTilemap.cpp:213: `blit' cannot be used as a function
Heh
I'm adding a "using namespace std;" in the CTilemap header (I always forget the namespace); that should fix most of that. Some of those errors are weird, but I'll assume it's just getting confused by the namespace scope. Uploading new version now (though it shouldn't affect the crashing) ...
That's pretty picky O_O AFAIK, those functions should be able to convert a vector element to an iterator.
I changed the code so that I convert to an iterator first before passing the iterator to the function. Hopefully that file at least will compile fine now. New version uploaded ... maybe I should upgrade MinGW so I catch this stuff earlier ...
Try again ...
I tried to run it using XP. It crashed. Then I checked the box in the compability settings that inactivates the visual themes. Now it runs.
Hey, it works for me too if I do that. Thanks.
Well, I thought it might have to do with Themes, so I tried running it yesterday with Themes enabled - and it still worked.
Try again ...
Right, that's it. Your compiler sucks Well, perhaps not, though how I'm supposed to get an iterator to the right elements without iterating through the whole stupid vector is beyond me. Frankly, I don't even know why the vector class can't include insert/erase that takes index numbers. Makes life so much easier.
Anyway, now that some people can actually run the friggin' binary (yay!), does anyone have any thoughts on the actual program?
A few thoughts.
1) Make the tile window automatically "wrap" the tiles when you resize it, and only use scrollbars if necessary.
2) Add keys for next/previous tile.
3) Where are my layers?
1) Yes, I've thought of that. I just haven't gotten around to it (wasn't a priority for this release).
2) Good idea; which ones? PgUp/PgDown (on second thought, that seems unintuitive)? I was actually thinking of one idea; clicking and dragging on the current tile would select other tiles, so dragging right would bring up the next tile, then the tile after that. Up and down would skip tiles by 20 or something.
3) I wrote about those in the Future Plans docs. Didn't read that, didja?
Make the tile window automatically "wrap" the tiles when you resize it, and only use scrollbars if necessary.
I made a widget like that for Icons...
Don't do it the dragging way ... that can get REALLY frustrating. You could have Pgup/Pgdn, or maybe use the scroll wheel for that? You could also add up/down buttons next to the tile.
Keyboard shortcuts for next/prev are a good idea, I just need intuitive keys for it. I can add it in five minutes after that
I think A for previous and S for next would work. Left hand there, right hand on the mouse. Maybe make a previous and next for the secondary tile too (Q and W?). I'm not a fan of using PgUp/Down for this for some reason I don't have a mouse wheel, so I won't attempt that yet
Up/Down buttons would be slow; almost as slow as just clicking back and forth in the tile window ...
I'm not coming up with alternatives; you should use ALL of them.
The more ways of doing the same thing you can cram in there, the better. At least when they're as trivial as this.
A/S and Q/W sound good, by the way.
23: Want the phunky widget? ITs sorta useless to me right now
TF: What widget? What's it do? The auto-wrapping one? Sure; I'd like to see how to set the window to a certian area. Never got the hang of that ...
Anyway, new version up.
A - Previous left tile.
S - Next left tile.
Q - Previous right tile.
W - Next right tile.
I'm glad I added that; it works great
It did not work with alleg41.dll so I needed to switch to alleg40.dll. After that, it worked fine and I'm using XP. Good stuff, I was slapp'n and map'n, baby! At first I was like "how do you select another tile" so I was forced to read the instructions and found out the tile selector was under "View".
Quick question, seeing how it runs under a window, is the code portable to other platforms? I'm working on a map editor specifically for my project, and I'm using a hacked up version of the Allegro gui. I'm eventually going to have to swap out the gui with something faster and better. If I want a version to run under Windows, that means I need to re-code a version just for Windows, correct?
Mike_Vox
is the code portable to other platforms?
Not this; it's heavy Win32 code here.
I coded this little widget for a windows program to associate files with programs, select the icon, and optionally add to the send to menu... but In XP that was really useless as XP includes that... And noone was interested in it
I doubt its bug free I tried to make it as functional as possible... Make it a top level resizeable window, and have fun
I'm using win98. What is MSVCR70? I just got that error again running another allegro program.
I thought it was a standard DLL
Anyway, the code in CTilemap.h has been updated now that I have been schooled So hopefully that'll help anyone trying to compile this bugger. I don't know if it'll fix the crashing; I should think it would only affect compilation. Plus I added the tilemap from my old game demo just for fun
...
I'm using win98. What is MSVCR70? I just got that error again running another allegro program.
If you downloaded the original 4.0.3 end-user DLL, I accidently put the MSVC7 version in there. I have since replaced it with the MSVC6 version. You can either download the new DLL from the files section, or you can download the msvcr70.dll file and place it in your system32 folder.
Now, for some general comments on the program itself. The native Win32 feel is nice; that is reason alone to use an editor. I'm not a fan of these universal non-native GUI toolkit libs, nor am I fan of a full screen Allegro GUI. Having a dual monitor setup and being able to have multiple windows open is very nice.
That said, the interface definately feels "primitive", but I know working with Win32 is tedious. (But at least under Windows a primitive Win32 is better than a non-Win32 app.) As long as all the features (layers, etc) make there way in, it shouldn't be an issue.
You should use the scroller on the mouse to select between tiles. It would actually be nice if it were configurable...
How simplistic is the file format? It would be nice to have a really simple "CVS export" format available in case someone wanted to use MapSlapper to create the map, but didn't want to use its native format.
How simplistic is the file format?
Very. You can see it pretty plainly just by reading CTilemap::Save() (which is well commented).
That said, the interface definately feels "primitive", but I know working with Win32 is tedious.
What would be needed to make it feel less "primitive"? It's just a tilemap editor If you mean it needs more bells and whistles like animation and stuff, then, yeah ... but if that's not what you meant, could you elaborate?
It would be nice to have a really simple "CVS export" format available in case someone wanted to use MapSlapper to create the map, but didn't want to use its native format.
Unless someone can spell this out for me or just downright code it for me, I'm not sure its worth the bother. It would be much easier for someone to write code to load a MapSlapper file into their tilemap structures than to make MapSlapper handle all instances IMHO. It'll be even nicer for the do-all tilemap editor, but I don't think anyone's commented on the plans for that yet
...
Thanks for the feedback though
Disabled themes and it ran fine
I agree with Matthew: Scrolling should change tiles Allegro can handle that pretty nicely - I use that in my own tile map editor.
Looks alright thus far. I love the copy/paste functions. Customizability of the tile blitting operations is pretty kewl too.
Good job
I dunno if you have this already, but ...
Go download RPG Maker 2000. That tile editor has a sweet feature where you can select large portions of a tileset or map and just paste it in a "pattern" kind of way wherever you want it. Try Drawing a wall, selecting it, and then drawing a large area with that brush.
You should have that.
I agree with Matthew: Scrolling should change tiles
The mouse wheel? DIdn't X-G propose that first?
I'm going to have to pick up a mouse with 3 buttons and a wheel this paycheck ... oh, and Win32 can handle the wheel as well
That tile editor has a sweet feature where you can select large portions of a tileset or map and just paste it in a "pattern" kind of way wherever you want it.
*cough*Clone Tool*cough* Did anyone fully read the docs?
Go download RPG Maker 2000.
Ooooh, feature plagarism! I love it!
It's more of a combination between the Stamp and Clone tools. Clicking once places ALL OF IT, like a Stamp, but if you keep placing, it won't place the whole Stamp again at the same position.
Can you give me a reliable link for RM2K? A lot of the sites I found on Google either don't have it or give me the runaround
I see what you're saying; that's an interesting idea. A Pattern Brush; could come in handy ...
I can't give you a link, but after trying your "MapSlapper", a lot of good could come from you seeing RM2K's editor. I'm not saying yours is bad...because it's not...it's just that I have very high standards after using RM2K (for way too many hours!)...my map editor pales in comparison to yours, yet. Good job!
EDIT: Here's the support site for it by the guy that translated it: http://rpgmaker2000.narod.ru/
When compiling with MingW, it complains about there not being a newline at the end of the file.
(Was just trying to have an icon for the exe file )
Just so you know
And nothing happens when you choose Help->About either. (And I mean NOTHING!)
[edit] Just found this. On the 'Edit Tile Blit Style' If you hold down on a mouse button and move the mouse left and right a few times, it crashes.
End of what file? I wasn't aware this was something the compiler cared about ...
And nothing happens when you choose Help->About either. (And I mean NOTHING!)
This is noted in the docs
i havent attempted to compile it for linux, it probbaly has windows specific things in it, but if you want to write portable happy code, gcc will also complain about newlines at the end of every file. its quite annoying to see such things.
main.cpp, Sorry, thought I said that...
And I should read the docs shouldn't I?
i havent attempted to compile it for linux, it probbaly has windows specific things in it
Oh yes, oh yes ...
it complains about there not being a newline at the end of the file.
....
gcc will also complain about newlines at the end of every file.
So there should be one or there shouldn't be one? This is totally news to me ...
Just found this. On the 'Edit Tile Blit Style' If you hold down on a mouse button and move the mouse left and right a few times, it crashes.
I'll be buggered; you're right. I thought I took care of all that ...
There should be a newline there.
Yeah, I never got the "missing new line" warning until I used linux. I wasn't aware it gave a warning in any windows-based compiler. Doesn't even make sense, really.
I'm going to have to pick up a mouse with 3 buttons and a wheel this paycheck
Just so you know, on most mice the wheel is also the middle button
If you want to be really pedantic, the wheel is the third, fourth, and fifth buttons.
...straying OT, but fourth and fifth? You can only press it in one direction.
Dezero, the wheel? You press it down, and you scroll it up and down
Wow. Can't see how I missed this thread at all. I just downloaded MapSlapper and tried it out. (I'm on a computer at my workstudy job at school right now, so it was a little clunky and slow.. stupid machine)
Anyways, I like the feel. It's really nice. When I use it I want to shed tears because my editor for ZD is so ugly looking. Kudos to that. The only thing I find really weird and awkward is how there are two separated windows, one that contains the map and another that contains the selectable tiles. If anything I would say put them together? Maybe this is something people don't like, but I for one find it very weird to switch to a new window to select a tile. I was thinking the tiles would either be shown in some kind of side pane, or horizontal pane along the bottom of the editor. Whatever floats your boat, however. This is just mere preference. Everything else (that I was able to check out in the short amount of time I have left before class starts) works pretty much perfectly. I like the scrollbars. It's annoying to use arrow keys to scroll around in a map, you know?
Good job on this. I'd like to play around with it just a little more, but alas, I don't have much time. You don't happen to have a little binary of an engine that runs these puppies, do you? (Well, one that's available to the public?)
Yes, let us dock the tile window to arbitrary positions in the main window!
I kinda like it that way, too. I'm not much for the whole tile window thing.
Ooooh. Docking would be really sweet. Then I could put my tiles wherever I wanted. Left, right, top, bottom... Oooh. Docky goodness. That's a really neat idea. I'd love to see that.
Update for chris: Disabling themes did the trick for me, very nice work. You've made an entire toolset in win32 for your game, very nice indeed.
Keep up the good work,
-Flecko
Flecko: I did? What's a "toolset"?
Okay, dockable windows and such, that's not bad. Unfortunately I have no clue how to do that but I'll note the idea for future development. If anyone's wondering, the reason tilesets are 20 tiles wide is because that's how KQ works, and I thought it was easy to add new tiles to a tileset (and it is
). I guess in the future a tileset should be skinnier. I only say this because I can't picture a tileset that wide being in a side panel. But I guess that's just an old idea that can be done away with now; I can make the program use different sized tilesets now. So, yeah. I'll note it for later.
(actually, I'm starting to get some new ideas runs off)
X-G: can you compile it now? Maybe I should upgrade MinGW (using 2.95.3-6 right now)
Yup.
Add a newline at the end of main.cpp, though ...
I did; I guess I didn't upload that one yet ...
Toolset...I guess that means your animation editor and your tile editor. Debatable, but I think it means all the tools needed outside of your game to make it work.
Impressive to say the least.
-Flecko
23: "Toolset" <-> "Set of tools"....
Aw, fug I did fix that blit type window too; I just forgot to change one line that was referencing the wrong variables
Okay, hopefully it a) runs for everyone now and b) the crashes are gone. I'm going to add a note to the docs that XP users might have to Disable Themes; I guess that covers it then?
Is it a rare thing to have to Disable Themes to get a program to run? Matthew says it runs with Themes on for him (maybe now that I'm not fudging my iterator code )
If you don't have a clue what's happenin',
let MapSlapper do the slappin'.
It'll whip you up a great map in no time flat.
It's better than its cousin Mappy
(well of course, it's a lot more slappy)
and its map format isn't all bloated and fat.
Feel free to add more, anyone . I had another verse but I forgot it
.
23.. I don't think it has anything to do with your map code but rather the windows API code you are using. There's a reason why there are XP only downloads for most products and that's probably a main reason. For some reason XP needs some special code or something to deal with themes, it's kinda stupid, but as long as you put it in the docs to disable themes everything should be OK. That or you could have someone e-mail you an executable with themes pre-disabled in the executable (unless XP uses some strange config file for it) and it should run carry over... maybe not...
Cage: Too much time. That's what you've got. Way too much time.
Is it a rare thing to have to Disable Themes to get a program to run?
This is a first for me.
Feel free to add more, anyone . I had another verse but I forgot it .
This is the MapSlapper rap,
cause I can't hold back,
when the tiles are stack'in,
no, I'll never stop mapp'in,
as long as I'm slapp'in
Mike_Vox
Edit: Oooh! Note the time and date!
Edit2: I just like when the clock turns 22.22. And when it was the 22nd, even better! But now I realised that only people in my timezone will actually see the time stamp of this post as 22.22, and thus miss the fun. Ah, well.
This is a first for me.
Me too, and I have run many both old and weird programs. You must be doing something strange.
The file doesn't do anything for me. I get a wait cursor, and that's it. No window, no msg box, nothing.
Oh, I'm running XP as well.
SC: Did you Disable Themes?
Trum: What about the time and date? Lots of two's and three's?
Cage: Get help.
Cage: Get help.
I asked for help, but only Mike Vox would submit some .
SC: Did you Disable Themes?
No, and you can be sure that I won't disable them just to run a program.
Spellcaster: You can disable them for just that prog. Click properties, and there's a compatibility option that disables themes for that program only.
X-G, I know.
But I'd prefer if 23 could simply fix the bug
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.
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?
Compiling from scratch didn't help when I tried it, so I doubt it's going to work for SC.
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.
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:
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.
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
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.
Sounds like I either need to give windows their own DC or stop doing so Either someone will have to narrow it down for me or I release 50 versions which you try until it works
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
Google turns up nothing on AliasDXDC, so heck if I know what to do with this info 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?
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.
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 ...
Still the same.
(Btw: Tried to compile it with VC 6... tons of errors and warnings. _argc and _argv for example)
So what should I use for VC6? _argc and _argv work fine in MinGW
I made a minor change or two; any difference?
Crash, boom, bang.
GetCommandLine() - (That's what the Allegro sources use.)
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
Nope. Still crash.
Edit: This one crashes with disabled themes aswell. And with AliasDXDC. Weird.
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 ...
"hello world"
"Registering classes!"
"Creating Window!"
Boom!
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!" ...
Dies immediately.
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.
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" 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.
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
And for me it crashed right away, no matter what I do.
There must be something about this on the msdn site or gamedev or something.
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 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 ...
I took a look at the source before, got lost easy 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.
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
...
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 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.
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?
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 ...
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?
What kind of error checking/verifying are you doing on the values you receive?
You're looking at it Should I have the program log the values in a file for you XP guys?
That might be a good idea - and so may things like checking that they are both > 0 and so on.
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?
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.
New version up which seems to have nailed it. Any more problems?
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 )
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?
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 ...
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!
The icon in the zip is for the files 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 ...
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?
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?
I've never seen that, save for a few weird crashes on obscure programs...
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.
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.
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
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
Auto-scroll in a windowed app is nasty!
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.
Everything you mentioned is in there or planned
CO: that's what I'm thinking. The fact you can zoom out so far should make that less necessary anyway IMHO.
23: Auto scroll is bad... But how bout if you press the middle button (or one that isn't being used), then when you move the mouse arround the map scrolls?
A pan button? Not bad If all else fails the Space Bar could do that (I think PhotoShop uses Space for panning, so there's precedence
) but the middle mouse button could work too.
jots it down
Well, I find it to be quite usefull in IE