Browse Source

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

pull/2/head
Wei Mingzhi 5 years ago committed by Alibek Omarov
parent
commit
88772a1c34
  1. 2
      engine/client/cl_game.c
  2. 2
      engine/common/common.c
  3. 22
      engine/eiface.h
  4. 35
      engine/server/sv_game.c

2
engine/client/cl_game.c

@ -2607,7 +2607,7 @@ const char *pfnGetGameDirectory( void ) @@ -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;
}

2
engine/common/common.c

@ -1123,7 +1123,7 @@ pfnGetGameDir @@ -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 )

22
engine/eiface.h

@ -262,17 +262,17 @@ typedef struct enginefuncs_s @@ -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 );

35
engine/server/sv_game.c

@ -4550,10 +4550,19 @@ pfnEngineStub @@ -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 = @@ -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,

Loading…
Cancel
Save