engine: common: make Host_IsLocalGame and Host_IsLocalClient inlined

This commit is contained in:
Alibek Omarov 2024-06-13 01:20:14 +03:00
parent b3026a7991
commit 3434005e66
2 changed files with 12 additions and 29 deletions

View file

@ -510,8 +510,6 @@ void Host_WriteServerConfig( const char *name );
void Host_WriteOpenGLConfig( void );
void Host_WriteVideoConfig( void );
void Host_WriteConfig( void );
qboolean Host_IsLocalGame( void );
qboolean Host_IsLocalClient( void );
void Host_ShutdownServer( void );
void Host_Error( const char *error, ... ) _format( 1 );
void Host_ValidateEngineFeatures( uint32_t features );
@ -745,6 +743,18 @@ int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCom
char *va( const char *format, ... ) _format( 1 );
qboolean CRC32_MapFile( dword *crcvalue, const char *filename, qboolean multiplayer );
static inline qboolean Host_IsLocalGame( void )
{
if( SV_Active( ))
return SV_GetMaxClients() == 1 ? true : false;
return CL_GetMaxClients() == 1 ? true : false;
}
static inline qboolean Host_IsLocalClient( void )
{
return CL_Initialized( ) && SV_Initialized( ) ? true : false;
}
// soundlib shared exports
qboolean S_Init( void );
void S_Shutdown( void );

View file

@ -514,33 +514,6 @@ static void Host_Minimize_f( void )
#endif
}
/*
=================
Host_IsLocalGame
singleplayer game detect
=================
*/
qboolean Host_IsLocalGame( void )
{
if( SV_Active( ))
{
return ( SV_GetMaxClients() == 1 ) ? true : false;
}
else
{
return ( CL_GetMaxClients() == 1 ) ? true : false;
}
}
qboolean Host_IsLocalClient( void )
{
// only the local client have the active server
if( CL_Initialized( ) && SV_Initialized( ))
return true;
return false;
}
/*
=================
Host_RegisterDecal