Mail Archives: djgpp/1997/04/30/13:40:37
Patrick J. Morris (danalas AT worldnet DOT att DOT net) wrote:
: I am currently writing a tile-based game and was thinking about
: how I could store the map in and Allegro DAT file. I was just wondering
: if I could read in the map file and change it if I need to and then
: save it again to the DAT file. If this is possible then please tell
: me how.
In short, yes. You can make the map as a file on the disk, then use the
grabber utility to put the map into a datafile. Having done this, you use
the Allegro datafile reading routines to load up the datafile, and perform
a bit of conversion on the results, similar to your current map loading
routine.
Alternatively you can use the file compressor which comes with Allegro and
read/write your maps using the packfile routines. This would require less
changes to your existing code (s/FILE/PACKFILE/s/fopen/pack_fopen/... or
something like that).
--
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford
- Raw text -