From 8a75104cbcee2f72bf7394731fc8089cb57e5486 Mon Sep 17 00:00:00 2001 From: lewa_j Date: Mon, 12 Jan 2026 03:24:40 +0300 Subject: [PATCH] commoon: engine: Fix not including all dependencies for headers. (Just some used in ref) --- common/beamdef.h | 2 ++ common/bspfile.h | 1 + common/cl_entity.h | 2 ++ common/com_image.h | 22 +++++++++++++++++++++- common/com_model.h | 2 +- common/const.h | 2 -- common/dlight.h | 2 ++ common/lightstyle.h | 2 ++ common/particledef.h | 2 ++ common/r_efx.h | 8 ++++---- common/ref_params.h | 2 ++ common/xash3d_types.h | 1 + engine/alias.h | 2 ++ engine/edict.h | 1 + engine/progdefs.h | 2 ++ engine/ref_api.h | 2 +- engine/sprite.h | 1 + engine/studio.h | 2 ++ 18 files changed, 49 insertions(+), 9 deletions(-) diff --git a/common/beamdef.h b/common/beamdef.h index b2904df4..d7df9974 100644 --- a/common/beamdef.h +++ b/common/beamdef.h @@ -16,6 +16,8 @@ #ifndef BEAMDEF_H #define BEAMDEF_H +#include "xash3d_types.h" + #define FBEAM_STARTENTITY 0x00000001 #define FBEAM_ENDENTITY 0x00000002 #define FBEAM_FADEIN 0x00000004 diff --git a/common/bspfile.h b/common/bspfile.h index 7499bd2a..3bfd0005 100644 --- a/common/bspfile.h +++ b/common/bspfile.h @@ -16,6 +16,7 @@ GNU General Public License for more details. #define BSPFILE_H #include +#include "xash3d_types.h" /* ============================================================================== diff --git a/common/cl_entity.h b/common/cl_entity.h index 9f4cdc14..87842934 100644 --- a/common/cl_entity.h +++ b/common/cl_entity.h @@ -16,6 +16,8 @@ #ifndef CL_ENTITY_H #define CL_ENTITY_H +#include "const.h" + typedef struct efrag_s { struct mleaf_s *leaf; diff --git a/common/com_image.h b/common/com_image.h index 2732079b..1fb4ac68 100644 --- a/common/com_image.h +++ b/common/com_image.h @@ -1,4 +1,23 @@ -#pragma once +/* +com_image.h - image definitions common between client and server +Copyright (C) 2007 Uncle Mike + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +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. +*/ + +#ifndef COM_IMAGE_H +#define COM_IMAGE_H + +#include "xash3d_types.h" + /* ======================================================================== @@ -130,3 +149,4 @@ typedef struct rgbdata_s size_t size; // for bounds checking } rgbdata_t; +#endif//COM_IMAGE_H diff --git a/common/com_model.h b/common/com_model.h index febb214c..375e75bf 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -16,7 +16,7 @@ GNU General Public License for more details. #ifndef COM_MODEL_H #define COM_MODEL_H -#include "xash3d_types.h" +#include "const.h" #include "bspfile.h" // we need some declarations from it /* diff --git a/common/const.h b/common/const.h index fe4469fa..349c62a8 100644 --- a/common/const.h +++ b/common/const.h @@ -723,8 +723,6 @@ enum typedef int func_t; typedef int string_t; -typedef unsigned short word; - #include "xash3d_types.h" typedef struct diff --git a/common/dlight.h b/common/dlight.h index 5847e8a2..4fbdb4df 100644 --- a/common/dlight.h +++ b/common/dlight.h @@ -16,6 +16,8 @@ #ifndef DLIGHT_H #define DLIGHT_H +#include "const.h" + typedef struct dlight_s { vec3_t origin; diff --git a/common/lightstyle.h b/common/lightstyle.h index a695e981..8f9ca980 100644 --- a/common/lightstyle.h +++ b/common/lightstyle.h @@ -16,6 +16,8 @@ GNU General Public License for more details. #ifndef LIGHTSTYLE_H #define LIGHTSTYLE_H +#include "xash3d_types.h" + typedef struct { char pattern[256]; diff --git a/common/particledef.h b/common/particledef.h index 3b8db9d7..4b235c42 100644 --- a/common/particledef.h +++ b/common/particledef.h @@ -16,6 +16,8 @@ #ifndef PARTICLEDEF_H #define PARTICLEDEF_H +#include "xash3d_types.h" + typedef enum { pt_static, diff --git a/common/r_efx.h b/common/r_efx.h index 7fdca48a..2e37a201 100644 --- a/common/r_efx.h +++ b/common/r_efx.h @@ -17,22 +17,22 @@ #define R_EFX_H // particle_t -#if !defined( PARTICLEDEFH ) +#if !defined( PARTICLEDEF_H ) #include "particledef.h" #endif // BEAM -#if !defined( BEAMDEFH ) +#if !defined( BEAMDEF_H ) #include "beamdef.h" #endif // dlight_t -#if !defined ( DLIGHTH ) +#if !defined ( DLIGHT_H ) #include "dlight.h" #endif // cl_entity_t -#if !defined( CL_ENTITYH ) +#if !defined( CL_ENTITY_H ) #include "cl_entity.h" #endif diff --git a/common/ref_params.h b/common/ref_params.h index a4d3d60d..3537ce25 100644 --- a/common/ref_params.h +++ b/common/ref_params.h @@ -16,6 +16,8 @@ #ifndef REF_PARAMS_H #define REF_PARAMS_H +#include "xash3d_types.h" + typedef struct ref_params_s { // output diff --git a/common/xash3d_types.h b/common/xash3d_types.h index f8bc3968..7e92b118 100644 --- a/common/xash3d_types.h +++ b/common/xash3d_types.h @@ -38,6 +38,7 @@ typedef byte rgb_t[3]; // unsigned byte colorpack typedef vec_t matrix3x4[3][4] MAYBE_ALIGNED( 16 ); typedef vec_t matrix4x4[4][4] MAYBE_ALIGNED( 16 ); typedef uint32_t poolhandle_t; +typedef uint16_t word; typedef uint32_t dword; typedef char string[MAX_STRING]; typedef off_t fs_offset_t; diff --git a/engine/alias.h b/engine/alias.h index 17e50686..2f5e9c0b 100644 --- a/engine/alias.h +++ b/engine/alias.h @@ -19,6 +19,8 @@ #include "build.h" #include #include "synctype.h" +#include "xash3d_types.h" +#include "com_model.h" /* ============================================================================== diff --git a/engine/edict.h b/engine/edict.h index d0e76715..27ac8c26 100644 --- a/engine/edict.h +++ b/engine/edict.h @@ -20,6 +20,7 @@ #define MAX_ENT_LEAFS_16 48 #include "progdefs.h" +#include "const.h" struct edict_s { diff --git a/engine/progdefs.h b/engine/progdefs.h index 2a0e133b..41b373e0 100644 --- a/engine/progdefs.h +++ b/engine/progdefs.h @@ -16,6 +16,8 @@ #ifndef PROGDEFS_H #define PROGDEFS_H +#include "const.h" + typedef struct { float time; diff --git a/engine/ref_api.h b/engine/ref_api.h index e117cce5..835b6a5e 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -26,9 +26,9 @@ GNU General Public License for more details. #include "com_model.h" #include "studio.h" #include "r_efx.h" -#include "com_image.h" #include "filesystem.h" #include "common/protocol.h" +#include "cvardef.h" // RefAPI changelog: // 1. Initial release diff --git a/engine/sprite.h b/engine/sprite.h index 5557b451..3dc79683 100644 --- a/engine/sprite.h +++ b/engine/sprite.h @@ -19,6 +19,7 @@ #include "build.h" #include #include "synctype.h" +#include "xash3d_types.h" /* ============================================================================== diff --git a/engine/studio.h b/engine/studio.h index 692a1d33..22b90308 100644 --- a/engine/studio.h +++ b/engine/studio.h @@ -16,6 +16,8 @@ #ifndef STUDIO_H #define STUDIO_H +#include "xash3d_types.h" + /* ==============================================================================