filesystem: load on-disk archives like PAK and PK3 through VFS (disk-only for now)

* Track from which archive the file has been opened and provide needed functions for it
This commit is contained in:
Alibek Omarov
2024-06-27 07:31:09 +03:00
parent 64aa476330
commit ec107dfba5
8 changed files with 145 additions and 135 deletions

View File

@@ -457,10 +457,14 @@ static int FS_FileTime_DIR( searchpath_t *search, const char *filename )
static file_t *FS_OpenFile_DIR( searchpath_t *search, const char *filename, const char *mode, int pack_ind )
{
file_t *f;
char path[MAX_SYSPATH];
Q_snprintf( path, sizeof( path ), "%s%s", search->filename, filename );
return FS_SysOpen( path, mode );
f = FS_SysOpen( path, mode );
f->searchpath = search;
return f;
}
void FS_InitDirectorySearchpath( searchpath_t *search, const char *path, int flags )