• 9
• 10
• 10
• 9
• 10
• entries
686
1952
• views
386916

# Hooray for Datafiles!

99 views

Well, I finally got around to doing something with Stompy that I should have done a LONG time ago. Stompy now loads all of it's resources from an Allegro datafile. The advantage of this is two-fold:

1. The game loads much faster now. Lets face it, for a game as simple as Stompy, it shouldn't take a long time to load. Now it only has to load one datafile instead of 20 bajillion bitmap files.

2. It just looks better to have just 3 files (Allegro DLL, Stompy.exe, Stompy.dat) than a garbled mess of resources.

The only thing was it took a little time to change my loading code. I first loaded the Datafile, than cast the data to my premade BITMAP pointers. For instance, here was the old code to load my player sprite:

this->m_Sglobals.player = load_bitmap("Stompy.bmp", NULL);

and here is the new one:

this->m_Sglobals.player = (BITMAP*)this->m_Sglobals.GameRes[STOMPY_BMP].dat;

Kindof annoying, but it is a small price to pay considering all of the advantages. I'm now thinking of submitting my game to some game hosting sites and seeing if I can get more exposure for it.

There are no comments to display.