From fad34584b3019a9c46b4b2255e6428ffc3aa04b3 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Wed, 15 Jun 2011 22:09:26 +0000 Subject: - Small change to search path order - local files not in .pk3s take precedence over files in pk3s. Should make life easier for modders/mappers wanting to override textures that are already contained in some older pk3 - Make VM loading more robust, change loading order: when vm_* == 0 first try loading DLL, then QVM in *each* search directory/path - Fix FS_FileForHandle that would return a FILE pointer to invalid file handle 0 --- src/qcommon/qcommon.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/qcommon/qcommon.h') diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h index d09ee299..2cf2b27b 100644 --- a/src/qcommon/qcommon.h +++ b/src/qcommon/qcommon.h @@ -602,7 +602,7 @@ qboolean FS_FileExists( const char *file ); qboolean FS_CreatePath (char *OSPath); -char *FS_FindDll( const char *filename ); +vmInterpret_t FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll); char *FS_BuildOSPath( const char *base, const char *game, const char *qpath ); qboolean FS_CompareZipChecksum(const char *zipfile); @@ -618,9 +618,9 @@ fileHandle_t FS_FCreateOpenPipeFile( const char *filename ); // will properly create any needed paths and deal with seperater character issues fileHandle_t FS_SV_FOpenFileWrite( const char *filename ); -int FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp ); +long FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp ); void FS_SV_Rename( const char *from, const char *to ); -int FS_FOpenFileRead( const char *qpath, fileHandle_t *file, qboolean uniqueFILE ); +long FS_FOpenFileRead( const char *qpath, fileHandle_t *file, qboolean uniqueFILE ); // if uniqueFILE is true, then a new FILE will be fopened even if the file // is found in an already open pak file. If uniqueFILE is false, you must call // FS_FCloseFile instead of fclose, otherwise the pak FILE would be improperly closed @@ -639,7 +639,8 @@ int FS_Read( void *buffer, int len, fileHandle_t f ); void FS_FCloseFile( fileHandle_t f ); // note: you can't just fclose from another DLL, due to MS libc issues -int FS_ReadFile( const char *qpath, void **buffer ); +long FS_ReadFileDir(const char *qpath, void *searchPath, void **buffer); +long FS_ReadFile(const char *qpath, void **buffer); // returns the length of the file // a null buffer will just return the file length without loading // as a quick check for existance. -1 length == not present @@ -656,7 +657,7 @@ void FS_FreeFile( void *buffer ); void FS_WriteFile( const char *qpath, const void *buffer, int size ); // writes a complete file, creating any subdirectories needed -int FS_filelength( fileHandle_t f ); +long FS_filelength(fileHandle_t f); // doesn't work for files that are opened from a pack file int FS_FTell( fileHandle_t f ); @@ -713,6 +714,7 @@ void FS_FilenameCompletion( const char *dir, const char *ext, qboolean stripExt, void(*callback)(const char *s), qboolean allowNonPureFilesOnDisk ); const char *FS_GetCurrentGameDir(void); +qboolean FS_Which(const char *filename, void *searchPath); /* ============================================================== -- cgit