mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2025-01-11 10:55:12 +01:00
engine: provide compatible replacement for CompareFileTime function
This commit is contained in:
parent
30db748dcb
commit
0ceb0d9e11
@ -1249,7 +1249,7 @@ static const ui_enginefuncs_t gEngfuncs =
|
||||
pfnSetCursor,
|
||||
pfnIsMapValid,
|
||||
GL_ProcessTexture,
|
||||
COM_CompareFileTime,
|
||||
pfnCompareFileTime,
|
||||
VID_GetModeString,
|
||||
(void*)COM_SaveFile,
|
||||
pfnDelete
|
||||
|
@ -296,7 +296,7 @@ static render_api_t gRenderAPI =
|
||||
R_Mem_Free,
|
||||
pfnGetFilesList,
|
||||
pfnFileBufferCRC32,
|
||||
COM_CompareFileTime,
|
||||
pfnCompareFileTime,
|
||||
Host_Error,
|
||||
(void*)CL_ModelHandle,
|
||||
pfnTime,
|
||||
|
@ -840,30 +840,30 @@ cvar_t *GAME_EXPORT pfnCVarGetPointer( const char *szVarName )
|
||||
|
||||
/*
|
||||
=============
|
||||
COM_CompareFileTime
|
||||
pfnCompareFileTime
|
||||
|
||||
=============
|
||||
*/
|
||||
int GAME_EXPORT COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare )
|
||||
int GAME_EXPORT pfnCompareFileTime( const char *path1, const char *path2, int *retval )
|
||||
{
|
||||
int bRet = 0;
|
||||
int t1, t2;
|
||||
*retval = 0;
|
||||
|
||||
*iCompare = 0;
|
||||
if( !path1 || !path2 )
|
||||
return 0;
|
||||
|
||||
if( filename1 && filename2 )
|
||||
{
|
||||
int ft1 = FS_FileTime( filename1, false );
|
||||
int ft2 = FS_FileTime( filename2, false );
|
||||
if(( t1 = g_fsapi.FileTime( path1, false )) == -1 )
|
||||
return 0;
|
||||
|
||||
// one of files is missing
|
||||
if( ft1 == -1 || ft2 == -1 )
|
||||
return bRet;
|
||||
if(( t2 = g_fsapi.FileTime( path2, false )) == -1 )
|
||||
return 0;
|
||||
|
||||
*iCompare = ft1 < ft2 ? -1 : ( ft1 > ft2 ? 1 : 0 );
|
||||
bRet = 1;
|
||||
}
|
||||
if( t1 < t2 )
|
||||
*retval = -1;
|
||||
else if( t1 > t2 )
|
||||
*retval = 1;
|
||||
|
||||
return bRet;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -773,7 +773,7 @@ void Rcon_Print( host_redirect_t *rd, const char *pMsg );
|
||||
qboolean COM_ParseVector( char **pfile, float *v, size_t size );
|
||||
int COM_FileSize( const char *filename );
|
||||
void COM_FreeFile( void *buffer );
|
||||
int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare );
|
||||
int pfnCompareFileTime( const char *path1, const char *path2, int *retval );
|
||||
char *va( const char *format, ... ) FORMAT_CHECK( 1 ) RETURNS_NONNULL;
|
||||
qboolean CRC32_MapFile( dword *crcvalue, const char *filename, qboolean multiplayer );
|
||||
|
||||
|
@ -1699,7 +1699,7 @@ static qboolean Mod_LoadColoredLighting( model_t *mod, dbspmodel_t *bmod )
|
||||
Q_snprintf( path, sizeof( path ), "maps/%s.lit", modelname );
|
||||
|
||||
// make sure what deluxemap is actual
|
||||
if( !COM_CompareFileTime( path, mod->name, &iCompare ))
|
||||
if( !pfnCompareFileTime( path, mod->name, &iCompare ))
|
||||
return false;
|
||||
|
||||
if( iCompare < 0 ) // this may happens if level-designer used -onlyents key for hlcsg
|
||||
@ -1754,7 +1754,7 @@ static void Mod_LoadDeluxemap( model_t *mod, dbspmodel_t *bmod )
|
||||
Q_snprintf( path, sizeof( path ), "maps/%s.dlit", modelname );
|
||||
|
||||
// make sure what deluxemap is actual
|
||||
if( !COM_CompareFileTime( path, mod->name, &iCompare ))
|
||||
if( !pfnCompareFileTime( path, mod->name, &iCompare ))
|
||||
return;
|
||||
|
||||
if( iCompare < 0 ) // this may happens if level-designer used -onlyents key for hlcsg
|
||||
|
@ -4732,7 +4732,7 @@ static enginefuncs_t gEngfuncs =
|
||||
COM_LoadFileForMe,
|
||||
COM_FreeFile,
|
||||
pfnEndSection,
|
||||
COM_CompareFileTime,
|
||||
pfnCompareFileTime,
|
||||
pfnGetGameDir,
|
||||
pfnCvar_RegisterEngineVariable,
|
||||
pfnFadeClientVolume,
|
||||
|
Loading…
Reference in New Issue
Block a user