mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-22 01:45:19 +01:00
filesystem: drop direct path hacks for WAD files, let VFS decide how to open WAD archives
This commit is contained in:
parent
244b9dc02b
commit
42f6719e8d
@ -387,9 +387,6 @@ void FS_AddGameDirectory( const char *dir, uint flags )
|
||||
|
||||
for( archive = g_archives; archive->ext; archive++ )
|
||||
{
|
||||
if( archive->type == SEARCHPATH_WAD ) // HACKHACK: wads need direct paths but only in this function
|
||||
FS_AllowDirectPaths( true );
|
||||
|
||||
for( i = 0; i < list.numstrings; i++ )
|
||||
{
|
||||
const char *ext = COM_FileExtension( list.strings[i] );
|
||||
@ -400,8 +397,6 @@ void FS_AddGameDirectory( const char *dir, uint flags )
|
||||
Q_snprintf( fullpath, sizeof( fullpath ), "%s%s", dir, list.strings[i] );
|
||||
FS_AddArchive_Fullpath( archive, fullpath, flags );
|
||||
}
|
||||
|
||||
FS_AllowDirectPaths( false );
|
||||
}
|
||||
|
||||
stringlistfreecontents( &list );
|
||||
|
@ -60,7 +60,7 @@ struct file_s
|
||||
#endif
|
||||
};
|
||||
|
||||
enum
|
||||
typedef enum searchpathtype_e
|
||||
{
|
||||
SEARCHPATH_PLAIN = 0,
|
||||
SEARCHPATH_PAK,
|
||||
@ -68,7 +68,7 @@ enum
|
||||
SEARCHPATH_ZIP,
|
||||
SEARCHPATH_PK3DIR, // it's actually a plain directory but it must behave like a ZIP archive,
|
||||
SEARCHPATH_ANDROID_ASSETS
|
||||
};
|
||||
} searchpathtype_t;
|
||||
|
||||
typedef struct stringlist_s
|
||||
{
|
||||
@ -81,7 +81,7 @@ typedef struct stringlist_s
|
||||
typedef struct searchpath_s
|
||||
{
|
||||
string filename;
|
||||
int type;
|
||||
searchpathtype_t type;
|
||||
int flags;
|
||||
|
||||
union
|
||||
|
@ -293,29 +293,9 @@ static wfile_t *W_Open( const char *filename, int *error )
|
||||
dlumpinfo_t *srclumps;
|
||||
size_t lat_size;
|
||||
dwadinfo_t header;
|
||||
const char *basename = COM_FileWithoutPath( filename );
|
||||
|
||||
// NOTE: FS_Open is load wad file from the first pak in the list (while fs_ext_path is false)
|
||||
if( fs_ext_path )
|
||||
{
|
||||
int ind;
|
||||
searchpath_t *search = FS_FindFile( filename, &ind, NULL, 0, false );
|
||||
|
||||
// allow direct absolute paths
|
||||
// TODO: catch them in FS_FindFile_DIR!
|
||||
if( !search || ind < 0 )
|
||||
{
|
||||
wad->handle = FS_SysOpen( filename, "rb" );
|
||||
}
|
||||
else
|
||||
{
|
||||
wad->handle = search->pfnOpenFile( search, filename, "rb", ind );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *basename = COM_FileWithoutPath( filename );
|
||||
wad->handle = FS_Open( basename, "rb", false );
|
||||
}
|
||||
wad->handle = FS_Open( basename, "rb", false );
|
||||
|
||||
if( wad->handle == NULL )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user