mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2025-01-16 13:20:00 +01:00
filesystem: unify prototypes of archive opening functions
This commit is contained in:
parent
b84aba68fa
commit
653eb00cc6
@ -285,7 +285,7 @@ void FS_CreatePath( char *path )
|
||||
FS_AddArchive_Fullpath
|
||||
================
|
||||
*/
|
||||
static qboolean FS_AddArchive_Fullpath( const char *file, qboolean *already_loaded, int flags )
|
||||
static searchpath_t *FS_AddArchive_Fullpath( const char *file, qboolean *already_loaded, int flags )
|
||||
{
|
||||
const char *ext = COM_FileExtension( file );
|
||||
|
||||
@ -295,7 +295,7 @@ static qboolean FS_AddArchive_Fullpath( const char *file, qboolean *already_load
|
||||
return FS_AddPak_Fullpath( file, already_loaded, flags );
|
||||
|
||||
// skip wads, this function only meant to be used for extras
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -193,17 +193,17 @@ searchpath_t *FS_FindFile( const char *name, int *index, char *fixedname, size_t
|
||||
//
|
||||
// pak.c
|
||||
//
|
||||
qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int flags );
|
||||
searchpath_t *FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int flags );
|
||||
|
||||
//
|
||||
// wad.c
|
||||
//
|
||||
qboolean FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int flags );
|
||||
searchpath_t *FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int flags );
|
||||
|
||||
//
|
||||
// zip.c
|
||||
//
|
||||
qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int flags );
|
||||
searchpath_t *FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int flags );
|
||||
|
||||
//
|
||||
// dir.c
|
||||
|
@ -330,7 +330,7 @@ If keep_plain_dirs is set, the pack will be added AFTER the first sequence of
|
||||
plain directories.
|
||||
================
|
||||
*/
|
||||
qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int flags )
|
||||
searchpath_t *FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int flags )
|
||||
{
|
||||
searchpath_t *search;
|
||||
pack_t *pak = NULL;
|
||||
@ -342,7 +342,7 @@ qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int
|
||||
if( search->type == SEARCHPATH_PAK && !Q_stricmp( search->filename, pakfile ))
|
||||
{
|
||||
if( already_loaded ) *already_loaded = true;
|
||||
return true; // already loaded
|
||||
return search; // already loaded
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,12 +384,12 @@ qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return search;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( errorcode != PAK_LOAD_NO_FILES )
|
||||
Con_Reportf( S_ERROR "FS_AddPak_Fullpath: unable to load pak \"%s\"\n", pakfile );
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ static byte *W_ReadLump( searchpath_t *search, const char *path, int pack_ind, f
|
||||
FS_AddWad_Fullpath
|
||||
====================
|
||||
*/
|
||||
qboolean FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int flags )
|
||||
searchpath_t *FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int flags )
|
||||
{
|
||||
searchpath_t *search;
|
||||
wfile_t *wad = NULL;
|
||||
@ -647,7 +647,7 @@ qboolean FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int
|
||||
if( search->type == SEARCHPATH_WAD && !Q_stricmp( search->filename, wadfile ))
|
||||
{
|
||||
if( already_loaded ) *already_loaded = true;
|
||||
return true; // already loaded
|
||||
return search; // already loaded
|
||||
}
|
||||
}
|
||||
|
||||
@ -677,10 +677,10 @@ qboolean FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int
|
||||
fs_searchpaths = search;
|
||||
|
||||
Con_Reportf( "Adding wadfile: %s (%i files)\n", wadfile, wad->numlumps );
|
||||
return true;
|
||||
return search;
|
||||
}
|
||||
|
||||
if( errorcode != WAD_LOAD_NO_FILES )
|
||||
Con_Reportf( S_ERROR "FS_AddWad_Fullpath: unable to load wad \"%s\"\n", wadfile );
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ FS_AddZip_Fullpath
|
||||
|
||||
===========
|
||||
*/
|
||||
qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int flags )
|
||||
searchpath_t *FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int flags )
|
||||
{
|
||||
searchpath_t *search;
|
||||
zip_t *zip = NULL;
|
||||
@ -676,7 +676,7 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int
|
||||
if( search->type == SEARCHPATH_ZIP && !Q_stricmp( search->filename, zipfile ))
|
||||
{
|
||||
if( already_loaded ) *already_loaded = true;
|
||||
return true; // already loaded
|
||||
return search; // already loaded
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,13 +718,14 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int
|
||||
FS_AddWad_Fullpath( fullpath, NULL, flags );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
return search;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( errorcode != ZIP_LOAD_NO_FILES )
|
||||
Con_Reportf( S_ERROR "FS_AddZip_Fullpath: unable to load zip \"%s\"\n", zipfile );
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user