diff --git a/common/port.h b/common/port.h index e792cf9f..62240040 100644 --- a/common/port.h +++ b/common/port.h @@ -162,4 +162,8 @@ GNU General Public License for more details. #define USHRT_MAX 65535 #endif +#ifdef XASH_SDL +#include +#endif + #endif // PORT_H diff --git a/common/xash3d_types.h b/common/xash3d_types.h index 04ea8f79..da71f4aa 100644 --- a/common/xash3d_types.h +++ b/common/xash3d_types.h @@ -129,4 +129,12 @@ typedef struct dll_info_s typedef void (*setpair_t)( const char *key, const char *value, void *buffer, void *numpairs ); +// config strings are a general means of communication from +// the server to all connected clients. +// each config string can be at most CS_SIZE characters. +#define MAX_QPATH 64 // max length of a game pathname +#define MAX_OSPATH 260 // max length of a filesystem pathname +#define CS_SIZE 64 // size of one config string +#define CS_TIME 16 // size of time string + #endif // XASH_TYPES_H diff --git a/engine/client/client.h b/engine/client/client.h index a1f0fb9e..f98950ed 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -40,13 +40,6 @@ GNU General Public License for more details. typedef int sound_t; -typedef enum -{ - DEMO_INACTIVE = 0, - DEMO_XASH3D, - DEMO_QUAKE1 -} demo_mode; - //============================================================================= typedef struct netbandwithgraph_s { @@ -425,16 +418,6 @@ typedef struct float applied_angle; } screen_shake_t; -typedef struct remap_info_s -{ - unsigned short textures[MAX_SKINS];// alias textures - struct mstudiotex_s *ptexture; // array of textures with local copy of remapped textures - short numtextures; // textures count - short topcolor; // cached value - short bottomcolor; // cached value - model_t *model; // for catch model changes -} remap_info_t; - typedef enum { NET_REQUEST_CANCEL = 0, // request was cancelled for some reasons diff --git a/engine/client/mod_dbghulls.c b/engine/client/mod_dbghulls.c index 769b43b9..aa5094c2 100644 --- a/engine/client/mod_dbghulls.c +++ b/engine/client/mod_dbghulls.c @@ -12,11 +12,12 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ - +#include "common.h" +#include "client.h" #include "mod_local.h" #include "mathlib.h" #include "world.h" -#include "client.h" + #define MAX_CLIPNODE_DEPTH 256 // should never exceeds diff --git a/engine/common/common.h b/engine/common/common.h index 2ec6ed02..6b493c91 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -145,14 +145,6 @@ typedef enum #define CIN_MAIN 0 #define CIN_LOGO 1 -// config strings are a general means of communication from -// the server to all connected clients. -// each config string can be at most CS_SIZE characters. -#define MAX_QPATH 64 // max length of a game pathname -#define MAX_OSPATH 260 // max length of a filesystem pathname -#define CS_SIZE 64 // size of one config string -#define CS_TIME 16 // size of time string - #define MAX_DECALS 512 // touching TE_DECAL messages, etc #define MAX_STATIC_ENTITIES 3096 // static entities that moved on the client when level is spawn @@ -566,7 +558,6 @@ void COM_NormalizeAngles( vec3_t angles ); int COM_FileSize( const char *filename ); void COM_FixSlashes( char *pname ); void COM_FreeFile( void *buffer ); -#define COM_CheckString( string ) ( ( !string || !*string ) ? 0 : 1 ) int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare ); search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly ); file_t *FS_Open( const char *filepath, const char *mode, qboolean gamedironly ); @@ -1021,6 +1012,10 @@ void NET_InitMasters( void ); void NET_SaveMasters( void ); qboolean NET_SendToMasters( netsrc_t sock, size_t len, const void *data ); +#ifdef REF_DLL +#error "common.h in ref_dll" +#endif + #ifdef __cplusplus } #endif diff --git a/engine/common/crtlib.c b/engine/common/crtlib.c index 20ee9648..2895ae20 100644 --- a/engine/common/crtlib.c +++ b/engine/common/crtlib.c @@ -12,12 +12,15 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ - +#include "port.h" +#include "xash3d_types.h" +#include "const.h" #include #include #include -#include "common.h" - +#include +#include "stdio.h" +#include "crtlib.h" void Q_strnupr( const char *in, char *out, size_t size_out ) { if( size_out == 0 ) return; diff --git a/engine/common/crtlib.h b/engine/common/crtlib.h index 9f4b831a..439065f7 100644 --- a/engine/common/crtlib.h +++ b/engine/common/crtlib.h @@ -77,5 +77,6 @@ void COM_ReplaceExtension( char *path, const char *extension ); void COM_ExtractFilePath( const char *path, char *dest ); const char *COM_FileWithoutPath( const char *in ); void COM_StripExtension( char *path ); - +#define COM_CheckString( string ) ( ( !string || !*string ) ? 0 : 1 ) + #endif//STDLIB_H diff --git a/engine/common/mathlib.c b/engine/common/mathlib.c index 6db5d532..4351cf83 100644 --- a/engine/common/mathlib.c +++ b/engine/common/mathlib.c @@ -12,9 +12,11 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ - +#include "port.h" +#include "xash3d_types.h" +#include "const.h" +#include "com_model.h" #include -#include "common.h" #include "mathlib.h" #include "eiface.h" diff --git a/engine/common/matrixlib.c b/engine/common/matrixlib.c index d656d53a..18ded0e1 100644 --- a/engine/common/matrixlib.c +++ b/engine/common/matrixlib.c @@ -13,7 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#include "common.h" +#include "port.h" +#include "xash3d_types.h" +#include "const.h" +#include "com_model.h" #include "mathlib.h" const matrix3x4 matrix3x4_identity = @@ -845,4 +848,4 @@ qboolean Matrix4x4_Invert_Full( matrix4x4 out, const matrix4x4 in1 ) } } return false; -} \ No newline at end of file +} diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index b648ef5c..ffd027c6 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ - +#include "common.h" #include "mod_local.h" #include "sprite.h" #include "mathlib.h" diff --git a/engine/common/mod_local.h b/engine/common/mod_local.h index 8e85ab4c..4056d0ec 100644 --- a/engine/common/mod_local.h +++ b/engine/common/mod_local.h @@ -16,7 +16,7 @@ GNU General Public License for more details. #ifndef MOD_LOCAL_H #define MOD_LOCAL_H -#include "common.h" +//#include "common.h" #include "edict.h" #include "eiface.h" #include "ref_api.h" diff --git a/engine/common/model.c b/engine/common/model.c index fcfd9b30..55324b83 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ - +#include "common.h" #include "mod_local.h" #include "sprite.h" #include "mathlib.h" diff --git a/engine/ref_api.h b/engine/ref_api.h index 2d130779..6ed3abfa 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -60,6 +60,13 @@ GNU General Public License for more details. #define FWORLD_WATERALPHA BIT( 2 ) #define FWORLD_HAS_DELUXEMAP BIT( 3 ) +typedef enum +{ + DEMO_INACTIVE = 0, + DEMO_XASH3D, + DEMO_QUAKE1 +} demo_mode; + typedef struct { msurface_t *surf; @@ -211,7 +218,17 @@ enum struct con_nprint_s; -struct remap_info_s; +struct engine_studio_api_s; +typedef struct remap_info_s +{ + unsigned short textures[MAX_SKINS];// alias textures + struct mstudiotex_s *ptexture; // array of textures with local copy of remapped textures + short numtextures; // textures count + short topcolor; // cached value + short bottomcolor; // cached value + model_t *model; // for catch model changes +} remap_info_t; + typedef struct ref_api_s { diff --git a/ref_gl/gl_alias.c b/ref_gl/gl_alias.c index e8bae0f5..64c8d0d8 100644 --- a/ref_gl/gl_alias.c +++ b/ref_gl/gl_alias.c @@ -20,8 +20,6 @@ GNU General Public License for more details. #include "alias.h" #include "pm_local.h" #include "cl_tent.h" -#include "common.h" -#include "client.h" #include "pmtrace.h" extern cvar_t r_shadows; diff --git a/ref_gl/gl_backend.c b/ref_gl/gl_backend.c index 482e1724..412d0100 100644 --- a/ref_gl/gl_backend.c +++ b/ref_gl/gl_backend.c @@ -16,7 +16,6 @@ GNU General Public License for more details. #include "gl_local.h" #include "mathlib.h" -#include "common.h" char r_speeds_msg[MAX_SYSPATH]; ref_speeds_t r_stats; // r_speeds counters diff --git a/ref_gl/gl_decals.c b/ref_gl/gl_decals.c index a81a750b..c1d3a923 100644 --- a/ref_gl/gl_decals.c +++ b/ref_gl/gl_decals.c @@ -15,7 +15,6 @@ GNU General Public License for more details. #include "gl_local.h" #include "cl_tent.h" -#include "common.h" #define DECAL_OVERLAP_DISTANCE 2 #define DECAL_DISTANCE 4 // too big values produce more clipped polygons diff --git a/ref_gl/gl_image.c b/ref_gl/gl_image.c index 7de445eb..88a8aa40 100644 --- a/ref_gl/gl_image.c +++ b/ref_gl/gl_image.c @@ -14,7 +14,7 @@ GNU General Public License for more details. */ #include "gl_local.h" -#include "common.h" + #define TEXTURES_HASH_SIZE (MAX_TEXTURES >> 2) diff --git a/ref_gl/gl_refrag.c b/ref_gl/gl_refrag.c index 84e131a0..f26b0aad 100644 --- a/ref_gl/gl_refrag.c +++ b/ref_gl/gl_refrag.c @@ -16,7 +16,6 @@ GNU General Public License for more details. #include "gl_local.h" #include "entity_types.h" #include "studio.h" -#include "common.h" #include "world.h" // BOX_ON_PLANE_SIDE /* diff --git a/ref_gl/gl_rlight.c b/ref_gl/gl_rlight.c index 38ee1235..5cce45e8 100644 --- a/ref_gl/gl_rlight.c +++ b/ref_gl/gl_rlight.c @@ -16,7 +16,6 @@ GNU General Public License for more details. #include "gl_local.h" #include "pm_local.h" #include "studio.h" -#include "common.h" #include "mathlib.h" #include "ref_params.h" diff --git a/ref_gl/gl_sprite.c b/ref_gl/gl_sprite.c index 634b87ca..fed3361a 100644 --- a/ref_gl/gl_sprite.c +++ b/ref_gl/gl_sprite.c @@ -19,7 +19,6 @@ GNU General Public License for more details. #include "studio.h" #include "entity_types.h" #include "cl_tent.h" -#include "common.h" // it's a Valve default value for LoadMapSprite (probably must be power of two) #define MAPSPRITE_SIZE 128 @@ -179,7 +178,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui break; case SPR_ALPHTEST: pal = gEngfuncs.FS_LoadImage( "#masked.pal", src, 768 ); - break; + break; default: pal = gEngfuncs.FS_LoadImage( "#normal.pal", src, 768 ); break; diff --git a/ref_gl/gl_studio.c b/ref_gl/gl_studio.c index d96d3291..adc1a06c 100644 --- a/ref_gl/gl_studio.c +++ b/ref_gl/gl_studio.c @@ -21,8 +21,8 @@ GNU General Public License for more details. #include "studio.h" #include "pm_local.h" #include "cl_tent.h" -#include "common.h" -#include "client.h" +//#include "client.h" +#include "pmtrace.h" #define EVENT_CLIENT 5000 // less than this value it's a server-side studio events #define MAX_LOCALLIGHTS 4 diff --git a/ref_gl/gl_warp.c b/ref_gl/gl_warp.c index 6e93a237..99b4532f 100644 --- a/ref_gl/gl_warp.c +++ b/ref_gl/gl_warp.c @@ -16,8 +16,6 @@ GNU General Public License for more details. #include "gl_local.h" #include "wadfile.h" -#include "common.h" - #define SKYCLOUDS_QUALITY 12 #define MAX_CLIP_VERTS 128 // skybox clip vertices #define TURBSCALE ( 256.0f / ( M_PI2 ))