From d3e698d042e6dac1180beb5ebf423d95d989e799 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 14 Jan 2024 15:44:22 +0300 Subject: [PATCH] common: add mirror definitions --- common/bspfile.h | 1 + common/com_model.h | 4 +++- common/const.h | 2 ++ common/enginefeatures.h | 2 ++ engine/ref_api.h | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/bspfile.h b/common/bspfile.h index be6642ab..b8799165 100644 --- a/common/bspfile.h +++ b/common/bspfile.h @@ -54,6 +54,7 @@ BRUSH MODELS #define SURF_CONVEYOR BIT( 6 ) // scrolled texture (was SURF_DRAWBACKGROUND) #define SURF_UNDERWATER BIT( 7 ) // caustics #define SURF_TRANSPARENT BIT( 8 ) // it's a transparent texture (was SURF_DONTWARP) +#define SURF_REFLECT BIT( 31 ) // mirrors // lightstyle management #define LM_STYLES 4 // MAXLIGHTMAPS diff --git a/common/com_model.h b/common/com_model.h index 5f4b70c0..1457d1d8 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -228,7 +228,9 @@ typedef struct mextrasurf_s unsigned short numverts; // world->vertexes[] int firstvertex; // fisrt look up in tr.tbn_vectors[], then acess to world->vertexes[] - intptr_t reserved[32]; // just for future expansions or mod-makers + struct mextrasurf_s *mirrorchain; // engine-side mirrors, may be ignored in mods with custom renderers + + intptr_t reserved[31]; // just for future expansions or mod-makers } mextrasurf_t; struct msurface_s diff --git a/common/const.h b/common/const.h index fe4469fa..bd65b7d5 100644 --- a/common/const.h +++ b/common/const.h @@ -114,6 +114,8 @@ #define EF_LIGHT 64 // rocket flare glow sprite #define EF_NODRAW 128 // don't draw entity +#define EF_NOREFLECT (1U<<24) // Entity won't reflecting in mirrors +#define EF_REFLECTONLY (1U<<25) // Entity will be drawing only in mirrors #define EF_WATERSIDES (1U<<26) // Do not remove sides for func_water entity #define EF_FULLBRIGHT (1U<<27) // Just get fullbright #define EF_NOSHADOW (1U<<28) // ignore shadow for this entity diff --git a/common/enginefeatures.h b/common/enginefeatures.h index f2f9e199..8d6c4597 100644 --- a/common/enginefeatures.h +++ b/common/enginefeatures.h @@ -27,6 +27,7 @@ GNU General Public License for more details. #define ENGINE_COMPUTE_STUDIO_LERP (1<<7) // enable MOVETYPE_STEP lerping back in engine #define ENGINE_LINEAR_GAMMA_SPACE (1<<8) // disable influence of gamma/brightness cvars to textures/lightmaps, for mods with custom renderer +#define ENGINE_ALLOW_MIRRORS (1U<<30) // allow mirrors in engine renderer #define ENGINE_STEP_POSHISTORY_LERP (1U<<31) // enable MOVETYPE_STEP interpolation based on position history. Incompatible with ENGINE_COMPUTE_STUDIO_LERP! // adjust the mask when features will be added or removed @@ -40,6 +41,7 @@ GNU General Public License for more details. | ENGINE_IMPROVED_LINETRACE \ | ENGINE_COMPUTE_STUDIO_LERP \ | ENGINE_LINEAR_GAMMA_SPACE \ + | ENGINE_ALLOW_MIRRORS \ | ENGINE_STEP_POSHISTORY_LERP ) #endif//FEATURES_H diff --git a/engine/ref_api.h b/engine/ref_api.h index ce11df90..cf684a3d 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -77,6 +77,7 @@ GNU General Public License for more details. #define FWORLD_CUSTOM_SKYBOX BIT( 1 ) #define FWORLD_WATERALPHA BIT( 2 ) #define FWORLD_HAS_DELUXEMAP BIT( 3 ) +#define FWORLD_HAS_MIRRORS BIT( 4 ) // special rendermode for screenfade modulate // (probably will be expanded at some point)