engine: client: make both UI and Render API to use same implementation of GetFilesList function

This commit is contained in:
Alibek Omarov
2026-01-13 05:42:05 +05:00
parent cb7f2ad8af
commit 79f7fba83c
3 changed files with 4 additions and 27 deletions

View File

@@ -998,7 +998,7 @@ pfnGetFilesList
release prev search on a next call
=========
*/
static char ** GAME_EXPORT pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
char **GAME_EXPORT CL_GetFilesList( const char *pattern, int *numFiles, int gamedironly )
{
static search_t *t = NULL;
@@ -1238,7 +1238,7 @@ static const ui_enginefuncs_t gEngfuncs =
pfnMemFree,
pfnGetOldGameInfo,
pfnGetGamesList,
pfnGetFilesList,
CL_GetFilesList,
SV_GetSaveComment,
CL_GetDemoComment,
pfnCheckGameDll,

View File

@@ -45,30 +45,6 @@ static void R_Mem_Free( void *mem, const char *filename, const int fileline )
_Mem_Free( mem, filename, fileline );
}
/*
=========
pfnGetFilesList
=========
*/
static char **pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
{
static search_t *t = NULL;
if( t ) Mem_Free( t ); // release prev search
t = FS_Search( pattern, true, gamedironly );
if( !t )
{
if( numFiles ) *numFiles = 0;
return NULL;
}
if( numFiles ) *numFiles = t->numfilenames;
return t->filenames;
}
static uint pfnFileBufferCRC32( const void *buffer, const int length )
{
uint modelCRC = 0;
@@ -296,7 +272,7 @@ static render_api_t gRenderAPI =
NULL,
R_Mem_Alloc,
R_Mem_Free,
pfnGetFilesList,
CL_GetFilesList,
pfnFileBufferCRC32,
pfnCompareFileTime,
Host_Error,

View File

@@ -1181,6 +1181,7 @@ void UI_ConnectionProgress_Precache( void );
void UI_ConnectionProgress_Connect( const char *server );
void UI_ConnectionProgress_ChangeLevel( void );
void UI_ConnectionProgress_ParseServerInfo( const char *server );
char **GAME_EXPORT CL_GetFilesList( const char *pattern, int *numFiles, int gamedironly ); // used by both UI and Render APIs
//
// cl_mobile.c