I was wondering how most people deal with using multiple pictures
in their games.
For example: if you have a sprite animation (your character in your
game) with say 20 frames of animation in bmps or pngs…
I usually store my graphics as “tile maps” (tiles, sprites, fonts,
everything…), which are basically just plain images of any size
with all frames aligned after a grid. The only problem is that the
game has to know the tile size for each image, but that’s been a
minor problem for the tiny projects I’ve done so far. One could
reserve the first tile for an outline that defines the tile size or
some other graphics artist friendly hack… (Nowadays we generally
don’t have to worry much about 8/16/32 pixel alignment, so that could
work just as well as it appears.)
How do you group all those files together so you don’t load them
individually?
Do you make some sort of datafile?
No, not so far. Only had a few dozens of files to deal with, though…
(Speaking of which, I’d really like to port that Project Spitfire
game to SDL, just to get started with something fun. But first MAIA,
then the Utah-GLX retrace sync, and then some audio hacks to
demonstrate MAIA, and then that Generic 2D Game Graphics Engine,
and… Any century now!
Plus I’d want to store wav files… and any other junk.
I guess it would just be like a WAD file right?
Could throw it in a *.(tar(|.gz|.bz2)|zip) and then use standard
libraries to dig out the files.
Does SDL already support some kind of datafile for grouping files?
Not that I know of, but there seems to be a way to hook it in behind
the SDL file access API. Someone that actually looked into it should
answer that!
//David
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
--------------------------------------> david at linuxdj.com -'On Friday 09 February 2001 00:36, Dwight Follick wrote: