Skip to content

Commit

Permalink
engine: dedicated: make some stubs inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Jan 14, 2025
1 parent 1d4f7b2 commit 0412528
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 83 deletions.
5 changes: 0 additions & 5 deletions engine/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ qboolean CL_IsRecordDemo( void )
return cls.demorecording;
}

qboolean CL_IsTimeDemo( void )
{
return cls.timedemo;
}

qboolean CL_DisableVisibility( void )
{
return cls.envshot_disable_vis;
Expand Down
34 changes: 27 additions & 7 deletions engine/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,19 @@ CLIENT / SERVER SYSTEMS
==============================================================
*/
#if !XASH_DEDICATED
void CL_Init( void );
void CL_Shutdown( void );
void Host_ClientBegin( void );
void Host_ClientFrame( void );
int CL_Active( void );
#else
static inline void CL_Init( void ) { }
static inline void CL_Shutdown( void ) { }
static inline void Host_ClientBegin( void ) { Cbuf_Execute(); }
static inline void Host_ClientFrame( void ) { }
static inline int CL_Active( void ) { return 0; }
#endif

void SV_Init( void );
void SV_Shutdown( const char *finalmsg );
Expand Down Expand Up @@ -703,13 +711,30 @@ typedef enum connprotocol_e
struct physent_s;
struct sv_client_s;
typedef struct sizebuf_s sizebuf_t;
#if !XASH_DEDICATED
qboolean CL_Initialized( void );
qboolean CL_IsInGame( void );
qboolean CL_IsInConsole( void );
qboolean CL_IsIntermission( void );
qboolean CL_Initialized( void );
qboolean CL_DisableVisibility( void );
qboolean CL_IsRecordDemo( void );
qboolean CL_IsPlaybackDemo( void );
qboolean UI_CreditsActive( void );
int CL_GetMaxClients( void );
#else
static inline qboolean CL_Initialized( void ) { return false; }
static inline qboolean CL_IsInGame( void ) { return false; }
static inline qboolean CL_IsInConsole( void ) { return false; }
static inline qboolean CL_IsIntermission( void ) { return false; }
static inline qboolean CL_DisableVisibility( void ) { return false; }
static inline qboolean CL_IsRecordDemo( void ) { return false; }
static inline qboolean CL_IsPlaybackDemo( void ) { return false; }
static inline qboolean UI_CreditsActive( void ) { return false; }
static inline int CL_GetMaxClients( void ) { return SV_GetMaxClients(); }
#endif

char *CL_Userinfo( void );
void CL_CharEvent( int key );
qboolean CL_DisableVisibility( void );
byte *COM_LoadFile( const char *filename, int usehunk, int *pLength ) MALLOC_LIKE( free, 1 );
struct cmd_s *Cmd_GetFirstFunctionHandle( void );
struct cmd_s *Cmd_GetNextFunctionHandle( struct cmd_s *cmd );
Expand All @@ -727,13 +752,8 @@ const char *CL_MsgInfo( int cmd );
void SV_DrawDebugTriangles( void );
void SV_DrawOrthoTriangles( void );
double CL_GetDemoFramerate( void );
qboolean UI_CreditsActive( void );
void CL_StopPlayback( void );
int CL_GetMaxClients( void );
int SV_GetMaxClients( void );
qboolean CL_IsRecordDemo( void );
qboolean CL_IsTimeDemo( void );
qboolean CL_IsPlaybackDemo( void );
qboolean SV_Initialized( void );
void CL_ProcessFile( qboolean successfully_received, const char *filename );
int SV_GetSaveComment( const char *savename, char *comment );
Expand Down
71 changes: 0 additions & 71 deletions engine/common/dedicated.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,52 +49,6 @@ const char *CL_MsgInfo( int cmd )
return sz;
}

int GAME_EXPORT CL_Active( void )
{
return false;
}

qboolean CL_Initialized( void )
{
return false;
}

qboolean CL_IsInGame( void )
{
return true; // always active for dedicated servers
}

qboolean CL_IsInConsole( void )
{
return false;
}

qboolean CL_IsIntermission( void )
{
return false;
}

qboolean CL_IsPlaybackDemo( void )
{
return false;
}

qboolean CL_IsRecordDemo( void )
{
return false;
}


qboolean CL_DisableVisibility( void )
{
return false;
}

void CL_Init( void )
{

}

void Key_Init( void )
{

Expand Down Expand Up @@ -130,16 +84,6 @@ void CL_WriteMessageHistory( void )

}

void Host_ClientBegin( void )
{
Cbuf_Execute();
}

void Host_ClientFrame( void )
{

}

void Host_InputFrame( void )
{
}
Expand All @@ -159,11 +103,6 @@ void GAME_EXPORT S_StopSound(int entnum, int channel, const char *soundname)

}

int GAME_EXPORT CL_GetMaxClients( void )
{
return 0;
}

void IN_TouchInitConfig( void )
{

Expand All @@ -189,11 +128,6 @@ void Host_Credits( void )

}

qboolean UI_CreditsActive( void )
{
return false;
}

void S_StopBackgroundTrack( void )
{

Expand All @@ -204,11 +138,6 @@ void SCR_BeginLoadingPlaque( qboolean is_background )

}

int S_GetCurrentDynamicSounds( soundlist_t *pout, int size )
{
return 0;
}

void S_StopAllSounds( qboolean ambient )
{

Expand Down

0 comments on commit 0412528

Please sign in to comment.