mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: make both UI and Render API to use same implementation of GetFilesList function
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user