www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/30/13:40:37

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Reading compressed files
Date: 30 Apr 1997 10:58:19 GMT
Organization: Oxford University, England
Lines: 21
Message-ID: <5k78kb$j15@news.ox.ac.uk>
References: <33669FEA DOT 3D20 AT worldnet DOT att DOT net>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019