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]; static char szGetGameDir[MAX_SYSPATH];
Q_sprintf( szGetGameDir, "%s/%s", host.rootdir, GI->gamefolder ); Q_strcpy( szGetGameDir, GI->gamefolder );
return szGetGameDir; return szGetGameDir;
} }

View File

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

View File

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

View File

@ -4550,10 +4550,19 @@ pfnEngineStub
extended iface stubs 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 // engine callbacks
static enginefuncs_t gEngfuncs = static enginefuncs_t gEngfuncs =
{ {
@ -4701,17 +4710,17 @@ static enginefuncs_t gEngfuncs =
pfnVoice_GetClientListening, pfnVoice_GetClientListening,
pfnVoice_SetClientListening, pfnVoice_SetClientListening,
pfnGetPlayerAuthId, pfnGetPlayerAuthId,
pfnEngineStub, pfnSequenceGet,
pfnEngineStub, pfnSequencePickSentence,
pfnEngineStub, pfnGetFileSize,
pfnEngineStub, pfnGetApproxWavePlayLen,
pfnEngineStub, pfnIsCareerMatch,
pfnEngineStub, pfnGetLocalizedStringLength,
pfnEngineStub, pfnRegisterTutorMessageShown,
pfnEngineStub, pfnGetTimesTutorMessageShown,
pfnEngineStub, pfnProcessTutorMessageDecayBuffer,
pfnEngineStub, pfnConstructTutorMessageDecayBuffer,
pfnEngineStub, pfnResetTutorMessageDecayData,
pfnQueryClientCvarValue, pfnQueryClientCvarValue,
pfnQueryClientCvarValue2, pfnQueryClientCvarValue2,
COM_CheckParm, COM_CheckParm,