engine: GetGameDir should return gamedir only. Add proper stub functions for some engine APIs.

This commit is contained in:
Wei Mingzhi 2019-10-07 11:59:21 +08:00 committed by Alibek Omarov
parent 1c21590e96
commit 88772a1c34
4 changed files with 35 additions and 26 deletions

View File

@ -2607,7 +2607,7 @@ const char *pfnGetGameDirectory( void )
{
static char szGetGameDir[MAX_SYSPATH];
Q_sprintf( szGetGameDir, "%s/%s", host.rootdir, GI->gamefolder );
Q_strcpy( szGetGameDir, GI->gamefolder );
return szGetGameDir;
}

View File

@ -1123,7 +1123,7 @@ pfnGetGameDir
void pfnGetGameDir( char *szGetGameDir )
{
if( !szGetGameDir ) return;
Q_sprintf( szGetGameDir, "%s/%s", host.rootdir, GI->gamefolder );
Q_strcpy( szGetGameDir, GI->gamefolder );
}
qboolean COM_IsSafeFileToDownload( const char *filename )

View File

@ -262,17 +262,17 @@ typedef struct enginefuncs_s
const char *(*pfnGetPlayerAuthId) ( edict_t *e );
void (*pfnUnused1)( void );
void (*pfnUnused2)( void );
void (*pfnUnused3)( void );
void (*pfnUnused4)( void );
void (*pfnUnused5)( void );
void (*pfnUnused6)( void );
void (*pfnUnused7)( void );
void (*pfnUnused8)( void );
void (*pfnUnused9)( void );
void (*pfnUnused10)( void );
void (*pfnUnused11)( void );
void* (*pfnSequenceGet) ( const char* fileName, const char* entryName );
void* (*pfnSequencePickSentence) ( const char* groupName, int pickMethod, int *picked );
int (*pfnGetFileSize) ( char *filename );
unsigned int (*pfnGetApproxWavePlayLen) (const char *filepath);
int (*pfnIsCareerMatch) ( void );
int (*pfnGetLocalizedStringLength) (const char *label);
void (*pfnRegisterTutorMessageShown) (int mid);
int (*pfnGetTimesTutorMessageShown) (int mid);
void (*pfnProcessTutorMessageDecayBuffer) (int *buffer, int bufferLength);
void (*pfnConstructTutorMessageDecayBuffer) (int *buffer, int bufferLength);
void (*pfnResetTutorMessageDecayData) ( void );
// three useable funcs
void (*pfnQueryClientCvarValue)( const edict_t *player, const char *cvarName );

View File

@ -4550,10 +4550,19 @@ pfnEngineStub
extended iface stubs
=============
*/
static void pfnEngineStub( void )
static int pfnGetFileSize( char *filename )
{
return 0;
}
static unsigned int pfnGetApproxWavePlayLen(const char *filepath)
{
return 0;
}
static int pfnGetLocalizedStringLength(const char *label)
{
return 0;
}
// engine callbacks
static enginefuncs_t gEngfuncs =
{
@ -4701,17 +4710,17 @@ static enginefuncs_t gEngfuncs =
pfnVoice_GetClientListening,
pfnVoice_SetClientListening,
pfnGetPlayerAuthId,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnEngineStub,
pfnSequenceGet,
pfnSequencePickSentence,
pfnGetFileSize,
pfnGetApproxWavePlayLen,
pfnIsCareerMatch,
pfnGetLocalizedStringLength,
pfnRegisterTutorMessageShown,
pfnGetTimesTutorMessageShown,
pfnProcessTutorMessageDecayBuffer,
pfnConstructTutorMessageDecayBuffer,
pfnResetTutorMessageDecayData,
pfnQueryClientCvarValue,
pfnQueryClientCvarValue2,
COM_CheckParm,