Mail Archives: djgpp/1998/02/25/20:00:47
From: | "Jeremy Lounds" <jlounds AT voyager DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Datafiles
|
Date: | Wed, 25 Feb 1998 11:19:24 -0500
|
Lines: | 42
|
NNTP-Posting-Host: | 207.74.100.10
|
Message-ID: | <34f45f31.0@news7.kcdata.com>
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I am working on a game with DJGPP, Allegro, and VPE. Normaly, VPE loads all
the data out of the GFX sub-directory, and I would like to change it and
load it out of one datafile (ala the Allegro data file rountines). Any help
would be greatly appreciated!
Here is the orginal routine that reads the files in:
long int FileRead(char *Name, long int Start, long int Len, void *buffer)
{
char buf[20], *ptr;
int handle;
long int size;
// Small hack for gfx resources which are in GFX directory
// Normally when using resource file you'll have all of them in the same
place.
buf[0]='\0';
ptr=strchr(Name,'.');
if (ptr) {
ptr++;
if ((*ptr)=='P'||(*ptr)=='T')
strcpy(buf,"GFX\\");
}
strcat(buf,Name);
handle=open(buf,O_RDONLY|O_BINARY);
lseek(handle,Start,SEEK_SET);
size=read(handle,buffer,Len);
close(handle);
return(size);
}
How can I change it so that it loads out of a datafile (hopefully, also,
with password encryption). I read the GRABBER.TXT and the ALLEGRO docs, and
they don't help me. Thank you very much in advance....
Jeremy Lounds
- Raw text -