Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Hooray for Datafiles!

Sign in to follow this  


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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!