mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-14 16:01:44 +00:00
added file_from_pak as a new flobal, made COM_FindFile() to set it properly.
from quakeworld sources. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@352 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
f4b0b373cb
commit
82ccf48171
2 changed files with 5 additions and 0 deletions
|
@ -1365,6 +1365,7 @@ typedef struct
|
|||
|
||||
char com_gamedir[MAX_OSPATH];
|
||||
char com_basedir[MAX_OSPATH];
|
||||
int file_from_pak; // ZOID: global indicating that file came from a pak
|
||||
|
||||
typedef struct searchpath_s
|
||||
{
|
||||
|
@ -1499,6 +1500,8 @@ int COM_FindFile (const char *filename, int *handle, FILE **file)
|
|||
if (!file && !handle)
|
||||
Sys_Error ("COM_FindFile: neither handle or file set");
|
||||
|
||||
file_from_pak = 0;
|
||||
|
||||
//
|
||||
// search through the path, one element at a time
|
||||
//
|
||||
|
@ -1531,6 +1534,7 @@ int COM_FindFile (const char *filename, int *handle, FILE **file)
|
|||
if (*file)
|
||||
fseek (*file, pak->files[i].filepos, SEEK_SET);
|
||||
}
|
||||
file_from_pak = 1;
|
||||
com_filesize = pak->files[i].filelen;
|
||||
return com_filesize;
|
||||
}
|
||||
|
|
|
@ -183,6 +183,7 @@ struct cache_user_s;
|
|||
|
||||
extern char com_basedir[MAX_OSPATH];
|
||||
extern char com_gamedir[MAX_OSPATH];
|
||||
extern int file_from_pak; // global indicating that file came from a pak
|
||||
|
||||
void COM_WriteFile (const char *filename, const void *data, int len);
|
||||
int COM_OpenFile (const char *filename, int *hndl);
|
||||
|
|
Loading…
Reference in a new issue