Jump to content
  • Advertisement

Archived

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

ImmaGNUman

Loading and Saving maps

This topic is 6620 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

ok, heres my problem. Say I have a structure like this: struct TILE_T { int foo; char bar; double baz; LPDIRECTDRAWSURFACE *bmp; } Now considering I dont want to save a DirectDraw surface to a file, should I: 1) Create a whole new struct for saving and loading with an HBITMAP instead of DDSurface? 2) Just add a pointer to an HBitmap and during the game make it 0 and use it only for saving/loading? or 3) Make it a void*, cast it to (lpdirectdrawsurface) when i use it and when i convert it cast it to hbitmap? (this sounds coolest) Just want some input, which might give the least overhead. ----------------------------- A wise man once said "A person with half a clue is more dangerous than a person with or without one."

Share this post


Link to post
Share on other sites
Advertisement
Actually I''d stip out the LPDIRECTDRAWSURFACE *bmp (is that right? i double pointer??) and have ethier an index number for the tile or some other way to indicate the image. All 3 options you have given rely on windows re-allocating the exact same memory block each time you run your app and that these memory blocks are all pre-allocated by your system. This will never happen, unless you re-program windows and DirectX to re-allocate the blocks of memory that you want - like that''s going to happen!

The best option would be to do the following:

LPDIRECTDRAWSURFACE *IsoMaps[MAXISOIMAGES];

struct TILE_T
{
int foo;
char bar;
double baz;
int TileNum;
}

I''ve just worked out why you had the double pointer to the surface.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!