mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: filesystem: allow extras ZIPs
This commit is contained in:
parent
606b5354e6
commit
13cf909b99
@ -1192,7 +1192,7 @@ static qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int flags )
|
static qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int flags )
|
||||||
{
|
{
|
||||||
searchpath_t *search;
|
searchpath_t *search;
|
||||||
zip_t *zip = NULL;
|
zip_t *zip = NULL;
|
||||||
@ -1245,6 +1245,24 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
FS_AddArchive_Fullpath
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
static qboolean FS_AddArchive_Fullpath( const char *file, qboolean *already_loaded, int flags )
|
||||||
|
{
|
||||||
|
const char *ext = COM_FileExtension( file );
|
||||||
|
|
||||||
|
if( !Q_stricmp( ext, "zip" ) || !Q_stricmp( ext, "pk3" ))
|
||||||
|
return FS_AddZip_Fullpath( file, already_loaded, flags );
|
||||||
|
else if ( !Q_stricmp( ext, "pak" ))
|
||||||
|
return FS_AddPak_Fullpath( file, already_loaded, flags );
|
||||||
|
|
||||||
|
// skip wads, this function only meant to be used for extras
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
FS_AddGameDirectory
|
FS_AddGameDirectory
|
||||||
@ -1470,11 +1488,12 @@ void FS_Rescan( void )
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
str = getenv( "XASH3D_EXTRAS_PAK1" );
|
str = getenv( "XASH3D_EXTRAS_PAK1" );
|
||||||
if( COM_CheckString( str ) )
|
if( COM_CheckString( str ))
|
||||||
FS_AddPak_Fullpath( str, NULL, extrasFlags );
|
FS_AddArchive_Fullpath( str, NULL, extrasFlags );
|
||||||
|
|
||||||
str = getenv( "XASH3D_EXTRAS_PAK2" );
|
str = getenv( "XASH3D_EXTRAS_PAK2" );
|
||||||
if( COM_CheckString( str ) )
|
if( COM_CheckString( str ))
|
||||||
FS_AddPak_Fullpath( str, NULL, extrasFlags );
|
FS_AddArchive_Fullpath( str, NULL, extrasFlags );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( Q_stricmp( GI->basedir, GI->gamefolder ))
|
if( Q_stricmp( GI->basedir, GI->gamefolder ))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user