mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-11 14:42:05 +08:00
code cleanup
This commit is contained in:
@@ -54,13 +54,13 @@ extern int SV_UPDATE_BACKUP;
|
||||
#define GROUP_OP_AND 0
|
||||
#define GROUP_OP_NAND 1
|
||||
|
||||
#if defined( NDEBUG ) || XASH_OPT
|
||||
#if defined( NDEBUG )
|
||||
#define SV_IsValidEdict( e ) ( e && !e->free )
|
||||
#else
|
||||
#define SV_IsValidEdict( e ) SV_CheckEdict( e, __FILE__, __LINE__ )
|
||||
#endif
|
||||
#define NUM_FOR_EDICT(e) ((int)((edict_t *)(e) - svgame.edicts))
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT == 2
|
||||
#define EDICT_NUM( num ) ( ( ( ( num ) >= 0 ) && ( ( num ) < GI->max_edicts) ) ? svgame.edicts + ( num ) : NULL )
|
||||
#else
|
||||
#define EDICT_NUM( num ) SV_EdictNum( num )
|
||||
@@ -480,7 +480,7 @@ void Master_Packet( void );
|
||||
//
|
||||
void SV_ActivateServer( int runPhysics );
|
||||
qboolean SV_SpawnServer( const char *server, const char *startspot, qboolean background );
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT == 2
|
||||
#define SV_ModelHandle( modelindex ) ( ( modelindex < 0 || modelindex >= MAX_MODELS ) ? NULL : sv.models[( modelindex )] )
|
||||
model_t *pfnSV_ModelHandle( int modelindex );
|
||||
#else
|
||||
@@ -499,7 +499,7 @@ qboolean SV_RunThink( edict_t *ent );
|
||||
qboolean SV_PlayerRunThink( edict_t *ent, float frametime, double time );
|
||||
qboolean SV_TestEntityPosition( edict_t *ent, edict_t *blocker );
|
||||
void SV_Impact( edict_t *e1, edict_t *e2, trace_t *trace );
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT == 2
|
||||
// filter movetypes to collide with
|
||||
#define SV_CanPushed( ent ) ( ( ent )->v.movetype == MOVETYPE_NONE || \
|
||||
( ent )->v.movetype == MOVETYPE_PUSH || \
|
||||
@@ -652,7 +652,7 @@ void SV_RestartAmbientSounds( void );
|
||||
void SV_RestartDecals( void );
|
||||
void SV_RestartStaticEnts( void );
|
||||
int pfnGetCurrentPlayer( void );
|
||||
#if !XASH_OPT
|
||||
#if XASH_EXT_OPT != 2
|
||||
edict_t *SV_EdictNum( int n );
|
||||
#endif
|
||||
char *SV_Localinfo( void );
|
||||
|
||||
@@ -35,14 +35,14 @@ static vec3_t viewPoint[MAX_CLIENTS];
|
||||
// exports
|
||||
typedef void (__cdecl *LINK_ENTITY_FUNC)( entvars_t *pev );
|
||||
typedef void (__stdcall *GIVEFNPTRSTODLL)( enginefuncs_t* engfuncs, globalvars_t *pGlobals );
|
||||
#if !XASH_OPT
|
||||
#if XASH_EXT_OPT != 2
|
||||
edict_t *SV_EdictNum( int n )
|
||||
{
|
||||
if(( n >= 0 ) && ( n < GI->max_edicts ))
|
||||
return svgame.edicts + n;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifndef NDEBUG
|
||||
qboolean SV_CheckEdict( const edict_t *e, const char *file, const int line )
|
||||
{
|
||||
@@ -59,7 +59,7 @@ qboolean SV_CheckEdict( const edict_t *e, const char *file, const int line )
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
=============
|
||||
EntvarsDescription
|
||||
|
||||
@@ -266,7 +266,7 @@ SV_ModelHandle
|
||||
get model by handle
|
||||
================
|
||||
*/
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT > 1
|
||||
model_t *pfnSV_ModelHandle( int modelindex )
|
||||
{
|
||||
return SV_ModelHandle( modelindex );
|
||||
|
||||
@@ -842,7 +842,7 @@ SV_CanPushed
|
||||
filter entities for push
|
||||
============
|
||||
*/
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT > 1
|
||||
qboolean pfnSV_CanPushed( edict_t *ent )
|
||||
{
|
||||
return SV_CanPushed( ent );
|
||||
@@ -947,7 +947,7 @@ static edict_t *SV_PushMove( edict_t *pusher, float movetime )
|
||||
// filter movetypes to collide with
|
||||
if( !SV_CanPushed( check ))
|
||||
continue;
|
||||
#if !XASH_OPT
|
||||
#if !XASH_EXT_OPT
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
block = SV_TestEntityPosition( check, pusher );
|
||||
pusher->v.solid = oldsolid;
|
||||
@@ -968,7 +968,7 @@ static edict_t *SV_PushMove( edict_t *pusher, float movetime )
|
||||
if( !SV_TestEntityPosition( check, NULL ))
|
||||
continue;
|
||||
}
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
block = SV_TestEntityPosition( check, pusher );
|
||||
pusher->v.solid = oldsolid;
|
||||
@@ -1072,7 +1072,7 @@ static edict_t *SV_PushRotate( edict_t *pusher, float movetime )
|
||||
// filter movetypes to collide with
|
||||
if( !SV_CanPushed( check ))
|
||||
continue;
|
||||
#if !XASH_OPT
|
||||
#if !XASH_EXT_OPT
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
block = SV_TestEntityPosition( check, pusher );
|
||||
pusher->v.solid = oldsolid;
|
||||
@@ -1093,7 +1093,7 @@ static edict_t *SV_PushRotate( edict_t *pusher, float movetime )
|
||||
if( !SV_TestEntityPosition( check, NULL ))
|
||||
continue;
|
||||
}
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
block = SV_TestEntityPosition( check, pusher );
|
||||
pusher->v.solid = oldsolid;
|
||||
@@ -2039,7 +2039,7 @@ static server_physics_api_t gPhysicsAPI =
|
||||
SV_LinkEdict,
|
||||
SV_GetServerTime,
|
||||
SV_GetFrameTime,
|
||||
#if XASH_OPT
|
||||
#if XASH_EXT_OPT > 1
|
||||
(void*)pfnSV_ModelHandle,
|
||||
#else
|
||||
(void*)SV_ModelHandle,
|
||||
|
||||
@@ -32,7 +32,7 @@ half-life implementation of saverestore system
|
||||
#define SAVEGAME_HEADER (('V'<<24)+('A'<<16)+('S'<<8)+'J') // little-endian "JSAV"
|
||||
#define SAVEGAME_VERSION 0x0071 // Version 0.71 GoldSrc compatible
|
||||
#define CLIENT_SAVEGAME_VERSION 0x0067 // Version 0.67
|
||||
#ifdef XASH_PSP
|
||||
#if XASH_PSP
|
||||
#define SAVE_HEAPSIZE 0x200000 // reserve 2Mb for now
|
||||
#else
|
||||
#define SAVE_HEAPSIZE 0x400000 // reserve 4Mb for now
|
||||
|
||||
Reference in New Issue
Block a user