This topic is now archived and is closed to further replies.

My one-surface tile editor is killing me!

This topic is 5529 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been working on a tile map editor that uses DirectDraw surfaces in a child window to show a map. At first, I had a LARGE offscreen surface that was the entire map... and to get the tiles to show up when I clicked my mouse, I had it changing the number in the array, going through the entire array to put tiles back on this surface, and then taking the rect of where the map view was and blitting that to the display surface. Needless to say, this made my program go SLOOOOOWWWWW!!! So, I changed it so that all it did was put the new tile on the surface, and re-blit the rect without having it redo the whole array... a little faster but still too slow... Now I got the bright idea to just use one surface, the display surface, and draw to it when I need to by taking the relative position in the array (upper-left) and putting only the tiles that should be within view. This would make my editor go a little faster, and eat less processes. However, it seems no matter what I do, my surface always wants to stick to the top-left corner of the screen, and not the top-left corner of my child window like it should... I use OffsetRect() and still no luck. I am fresh out of ideas... can anyone help?

Share this post

Link to post
Share on other sites