From f863e346f505510bc9b5e499665996508487ab90 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 26 Feb 2026 06:01:30 +0500 Subject: [PATCH] engine: reduce dependency on eiface.h --- engine/client/cl_parse.c | 21 ++++++++++----------- engine/client/mod_dbghulls.c | 1 - engine/common/cvar.c | 1 - engine/common/imagelib/img_main.c | 1 - engine/common/mod_local.h | 5 ++--- engine/common/model.c | 4 ++-- engine/common/net_encode.h | 3 +-- engine/physint.h | 2 +- engine/server/server.h | 2 +- 9 files changed, 17 insertions(+), 23 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 27ed16c1..cebfef4c 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -20,6 +20,8 @@ GNU General Public License for more details. #include "cl_tent.h" #include "shake.h" #include "input.h" +#include "eiface.h" + #if XASH_LOW_MEMORY != 2 int CL_UPDATE_BACKUP = SINGLEPLAYER_BACKUP; #endif @@ -801,7 +803,6 @@ void CL_ParseServerData( sizebuf_t *msg, connprotocol_t proto ) string mapfile; qboolean background; int i, required_version; - uint32_t mapCRC; HPAK_CheckSize( hpk_custom_file.string ); @@ -1539,13 +1540,11 @@ static const char *CL_CheckTypeToString( int check_type ) static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) { - qboolean user_changed_diskfile; - vec3_t mins, maxs; - string filename; - CRC32_t crcFile; - byte md5[16] = { 0 }; - consistency_t *pc; - int i, pos; + qboolean user_changed_diskfile; + vec3_t mins, maxs; + string filename; + byte md5[16] = { 0 }; + int pos; if( !cl.need_force_consistency_response ) return; @@ -1561,11 +1560,10 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) FS_AllowDirectPaths( true ); - for( i = 0; i < cl.num_consistency; i++ ) + for( int i = 0; i < cl.num_consistency; i++ ) { qboolean have_file = true; - - pc = &cl.consistency_list[i]; + consistency_t *pc = &cl.consistency_list[i]; user_changed_diskfile = false; MSG_WriteOneBit( msg, 1 ); @@ -1580,6 +1578,7 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) if( Q_strstr( filename, "models/" ) && have_file ) { + uint32_t crcFile; CRC32_Init( &crcFile ); CRC32_File( &crcFile, filename ); crcFile = CRC32_Final( crcFile ); diff --git a/engine/client/mod_dbghulls.c b/engine/client/mod_dbghulls.c index a1af8774..ae44ce5d 100644 --- a/engine/client/mod_dbghulls.c +++ b/engine/client/mod_dbghulls.c @@ -19,7 +19,6 @@ GNU General Public License for more details. #include "mod_local.h" #include "xash3d_mathlib.h" #include "world.h" -#include "eiface.h" // offsetof #define MAX_CLIPNODE_DEPTH 256 // should never exceeds diff --git a/engine/common/cvar.c b/engine/common/cvar.c index 827e58d3..dbfdfb2e 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -16,7 +16,6 @@ GNU General Public License for more details. #include // fabs... #include "common.h" #include "base_cmd.h" -#include "eiface.h" // ARRAYSIZE static convar_t *cvar_vars = NULL; // head of list static poolhandle_t cvar_pool; diff --git a/engine/common/imagelib/img_main.c b/engine/common/imagelib/img_main.c index 93297e9c..7863dfdb 100644 --- a/engine/common/imagelib/img_main.c +++ b/engine/common/imagelib/img_main.c @@ -15,7 +15,6 @@ GNU General Public License for more details. #include #include "imagelib.h" -#include "eiface.h" // ARRAYSIZE #define DEBUG_LOOKUPS_COUNT 0 #define USE_FS_SEARCH_FOR_LOOKUPS 1 diff --git a/engine/common/mod_local.h b/engine/common/mod_local.h index 2fa6b605..8d58c08b 100644 --- a/engine/common/mod_local.h +++ b/engine/common/mod_local.h @@ -18,7 +18,6 @@ GNU General Public License for more details. //#include "common.h" #include "edict.h" -#include "eiface.h" #include "ref_api.h" #include "studio.h" @@ -53,7 +52,7 @@ typedef struct consistency_s typedef struct { int flags; - CRC32_t initialCRC; + uint32_t initialCRC; } model_info_t; // values for model_t's needload @@ -156,7 +155,7 @@ void *Mod_StudioExtradata( model_t *mod ); model_t *Mod_FindName( const char *name, qboolean trackCRC ); model_t *Mod_LoadModel( model_t *mod, qboolean crash ); model_t *Mod_ForName( const char *name, qboolean crash, qboolean trackCRC ); -qboolean Mod_ValidateCRC( const char *name, CRC32_t crc ); +qboolean Mod_ValidateCRC( const char *name, uint32_t crc ); void Mod_NeedCRC( const char *name, qboolean needCRC ); void Mod_FreeUnused( void ); diff --git a/engine/common/model.c b/engine/common/model.c index 5d45cc8a..3e5ce81d 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -398,7 +398,7 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) if( FBitSet( p->flags, FCRC_SHOULD_CHECKSUM )) { - CRC32_t currentCRC; + uint32_t currentCRC; CRC32_Init( ¤tCRC ); CRC32_ProcessBuffer( ¤tCRC, buf, length ); @@ -620,7 +620,7 @@ Mod_ValidateCRC ================== */ -qboolean Mod_ValidateCRC( const char *name, CRC32_t crc ) +qboolean Mod_ValidateCRC( const char *name, uint32_t crc ) { model_info_t *p; model_t *mod; diff --git a/engine/common/net_encode.h b/engine/common/net_encode.h index 9a3ac92e..13bf6473 100644 --- a/engine/common/net_encode.h +++ b/engine/common/net_encode.h @@ -16,8 +16,6 @@ GNU General Public License for more details. #ifndef NET_ENCODE_H #define NET_ENCODE_H -#include "eiface.h" - enum { CUSTOM_NONE = 0, @@ -80,6 +78,7 @@ typedef struct goldsrc_delta_s float postmultiply; } goldsrc_delta_t; +typedef struct delta_s delta_t; typedef void (*pfnDeltaEncode)( struct delta_s *pFields, const byte *from, const byte *to ); typedef struct diff --git a/engine/physint.h b/engine/physint.h index d5baeeab..5e4538fc 100644 --- a/engine/physint.h +++ b/engine/physint.h @@ -16,7 +16,7 @@ GNU General Public License for more details. #ifndef PHYSINT_H #define PHYSINT_H -#include "eiface.h" // offsetof +#include "xash3d_types.h" // offsetof #define SV_PHYSICS_INTERFACE_VERSION 6 diff --git a/engine/server/server.h b/engine/server/server.h index 05c57d0f..356440e0 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -133,7 +133,7 @@ typedef struct server_s struct sv_client_s *current_client; // current client who network message sending on int hostflags; // misc server flags: predicting etc - CRC32_t worldmapCRC; // check crc for catch cheater maps + uint32_t worldmapCRC; // check crc for catch cheater maps int progsCRC; // this is used with feature ENGINE_QUAKE_COMPATIBLE char name[MAX_QPATH]; // map name