mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 11:35:05 +08:00
filesystem: archive mounting refactoring
This commit is contained in:
@@ -470,19 +470,11 @@ public:
|
||||
bool AddPackFile( const char *path, const char *id ) override
|
||||
{
|
||||
char dir[MAX_VA_STRING], fullpath[MAX_VA_STRING];
|
||||
const char *ext = COM_FileExtension( path );
|
||||
|
||||
IdToDir( dir, sizeof( dir ), id );
|
||||
Q_snprintf( fullpath, sizeof( fullpath ), "%s/%s", dir, path );
|
||||
COM_FixSlashes( fullpath );
|
||||
|
||||
for( const fs_archive_t *archive = g_archives; archive->ext; archive++ )
|
||||
{
|
||||
if( archive->type == SEARCHPATH_PAK && !Q_stricmp( ext, archive->ext ))
|
||||
return FS_AddArchive_Fullpath( archive, fullpath, FS_CUSTOM_PATH );
|
||||
}
|
||||
|
||||
return false;
|
||||
return FS_MountArchive_Fullpath( fullpath, FS_CUSTOM_PATH ) != NULL;
|
||||
}
|
||||
|
||||
FileHandle_t OpenFromCacheForRead( const char *path , const char *mode, const char *id ) override
|
||||
|
||||
Reference in New Issue
Block a user