From 18d55c1de2b359d52658a5d494f15364479a64e8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 27 May 2023 20:48:48 +0300 Subject: [PATCH] filesystem: zip: adapt to new interface --- filesystem/zip.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/filesystem/zip.c b/filesystem/zip.c index cfb73bd8..4107c7a8 100644 --- a/filesystem/zip.c +++ b/filesystem/zip.c @@ -420,11 +420,10 @@ FS_LoadZIPFile =========== */ -byte *FS_LoadZIPFile( const char *path, fs_offset_t *sizeptr, qboolean gamedironly ) +static byte *FS_LoadZIPFile( searchpath_t *search, const char *path, int pack_ind, fs_offset_t *sizeptr ) { - searchpath_t *search; + zipfile_t *file; int index; - zipfile_t *file = NULL; byte *compressed_buffer = NULL, *decompressed_buffer = NULL; int zlib_result = 0; dword test_crc, final_crc; @@ -433,12 +432,7 @@ byte *FS_LoadZIPFile( const char *path, fs_offset_t *sizeptr, qboolean gamediron if( sizeptr ) *sizeptr = 0; - search = FS_FindFile( path, &index, NULL, 0, gamedironly ); - - if( !search || search->type != SEARCHPATH_ZIP ) - return NULL; - - file = &search->zip->files[index]; + file = &search->zip->files[pack_ind]; FS_EnsureOpenZip( search->zip ); @@ -709,6 +703,7 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int search->pfnFileTime = FS_FileTime_ZIP; search->pfnFindFile = FS_FindFile_ZIP; search->pfnSearch = FS_Search_ZIP; + search->pfnLoadFile = FS_LoadZIPFile; fs_searchpaths = search;