From b9293c675ac704aa7be91880e416fb3eb557e2d7 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 29 May 2024 12:08:10 +0300 Subject: [PATCH 1/3] commit: cvardef: sync header with the engine tree * We moved FCVAR_LATCH down to 30-th bit because 11-th bit was taken by GoldSrc. * GoldSrc's filterable/privileged flags are supported and now exposed for mods. * FCVAR_MOVEVARS became private because movevars are defined by the engine. --- common/cvardef.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/common/cvardef.h b/common/cvardef.h index d0ded9e4..fb50c307 100644 --- a/common/cvardef.h +++ b/common/cvardef.h @@ -1,9 +1,9 @@ /*** * * Copyright (c) 1996-2002, Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. * All Rights Reserved. * * Use, distribution, and modification of this source code and/or resulting @@ -25,14 +25,18 @@ #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log #define FCVAR_NOEXTRAWHITEPACE (1<<9) // strip trailing/leading white space from this cvar +#define FCVAR_PRIVILEGED (1<<10) // only available in privileged mode +#define FCVAR_FILTERABLE (1<<11) // filtered in unprivileged mode if cl_filterstuffcmd is 1 -#define FCVAR_MOVEVARS (1<<10) // this cvar is a part of movevars_t struct that shared between client and server -#define FCVAR_LATCH (1<<11) // notify client what this cvar will be applied only after server restart (but don't does more nothing) -#define FCVAR_GLCONFIG (1<<12) // write it into opengl.cfg +// Xash3D extensions +#define FCVAR_GLCONFIG (1<<12) // write it into .cfg(see RefAPI) #define FCVAR_CHANGED (1<<13) // set each time the cvar is changed #define FCVAR_GAMEUIDLL (1<<14) // defined by the menu DLL #define FCVAR_CHEAT (1<<15) // can not be changed if cheats are disabled - + +// a1ba: let's reuse higher bits for flags extensions from now on +#define FCVAR_LATCH (1<<30) // notify client what this cvar will be applied only after server restart (but don't does more nothing) + typedef struct cvar_s { char *name; From 3062e629695089e6c5ca94794136483b5d99a5ab Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 29 May 2024 12:18:55 +0300 Subject: [PATCH 2/3] common: enginefeatures: sync header with engine tree, rename from xash3d_features.h --- client/parsemsg.cpp | 2 +- client/render/gl_local.h | 2 +- client/render/r_weather.cpp | 2 +- common/{xash3d_features.h => enginefeatures.h} | 15 +++++++++++++++ server/physic.cpp | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) rename common/{xash3d_features.h => enginefeatures.h} (74%) diff --git a/client/parsemsg.cpp b/client/parsemsg.cpp index ef81ad14..4dc23288 100644 --- a/client/parsemsg.cpp +++ b/client/parsemsg.cpp @@ -17,7 +17,7 @@ #include "utils.h" #include "gl_local.h" #include "pm_movevars.h" -#include "xash3d_features.h" +#include "enginefeatures.h" static byte *gpBuf; static const char *gpszName; diff --git a/client/render/gl_local.h b/client/render/gl_local.h index 304d3c49..f45bcadf 100644 --- a/client/render/gl_local.h +++ b/client/render/gl_local.h @@ -31,7 +31,7 @@ GNU General Public License for more details. #include "cl_dlight.h" #include "cl_entity.h" #include "texture_handle.h" -#include "xash3d_features.h" +#include "enginefeatures.h" #include #include "vector.h" #include diff --git a/client/render/r_weather.cpp b/client/render/r_weather.cpp index eba49a7c..2b9c22d4 100644 --- a/client/render/r_weather.cpp +++ b/client/render/r_weather.cpp @@ -20,7 +20,7 @@ GNU General Public License for more details. #include "triangleapi.h" #include "custom_alloc.h" #include "parsemsg.h" -#include "xash3d_features.h" +#include "enginefeatures.h" #include "r_weather.h" #include "gl_local.h" #include "gl_debug.h" diff --git a/common/xash3d_features.h b/common/enginefeatures.h similarity index 74% rename from common/xash3d_features.h rename to common/enginefeatures.h index dc949dbf..f2f9e199 100644 --- a/common/xash3d_features.h +++ b/common/enginefeatures.h @@ -27,4 +27,19 @@ 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_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 +#define ENGINE_FEATURES_MASK \ + ( ENGINE_WRITE_LARGE_COORD \ + | ENGINE_QUAKE_COMPATIBLE \ + | ENGINE_LOAD_DELUXEDATA \ + | ENGINE_PHYSICS_PUSHER_EXT \ + | ENGINE_LARGE_LIGHTMAPS \ + | ENGINE_COMPENSATE_QUAKE_BUG \ + | ENGINE_IMPROVED_LINETRACE \ + | ENGINE_COMPUTE_STUDIO_LERP \ + | ENGINE_LINEAR_GAMMA_SPACE \ + | ENGINE_STEP_POSHISTORY_LERP ) + #endif//FEATURES_H diff --git a/server/physic.cpp b/server/physic.cpp index 663f30a5..0ce209a4 100644 --- a/server/physic.cpp +++ b/server/physic.cpp @@ -25,7 +25,7 @@ GNU General Public License for more details. #include "com_model.h" #include "studio.h" #include "movelist.h" -#include "xash3d_features.h" +#include "enginefeatures.h" #include "render_api.h" #include "physic.h" #include "triangleapi.h" From 3f60908c45129912c2ed75dc06a04b234e1dd4c3 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 29 May 2024 12:20:01 +0300 Subject: [PATCH 3/3] common: render_api: sync header with engine tree * We removed TF_ALLOW_EMBOSS that was used for fake bumpmapping/deep frying the texture. Fun but useless feature. * Added TF_ALLOW_NEAREST flag that allows switching to nearest filtering for textures without a mipmap (fonts, HUD, etc). --- common/render_api.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/render_api.h b/common/render_api.h index 18f567d1..32b48a0d 100644 --- a/common/render_api.h +++ b/common/render_api.h @@ -87,7 +87,7 @@ typedef enum TF_KEEP_SOURCE = (1<<1), // some images keep source TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20 TF_EXPAND_SOURCE = (1<<3), // Don't keep source as 8-bit expand to RGBA - TF_ALLOW_EMBOSS = (1<<4), // Allow emboss-mapping for this image +// reserved TF_RECTANGLE = (1<<5), // this is GL_TEXTURE_RECTANGLE TF_CUBEMAP = (1<<6), // it's cubemap texture TF_DEPTHMAP = (1<<7), // custom texture filter used @@ -112,7 +112,8 @@ typedef enum TF_ARB_FLOAT = (1<<26), // float textures TF_NOCOMPARE = (1<<27), // disable comparing for depth textures TF_ARB_16BIT = (1<<28), // keep image as 16-bit (not 24) - TF_MULTISAMPLE = (1<<29), // multisample texture + TF_MULTISAMPLE = (1<<29), // multisampling texture + TF_ALLOW_NEAREST = (1<<30), // allows toggling nearest filtering for TF_NOMIPMAP textures } texFlags_t; typedef enum @@ -280,4 +281,5 @@ typedef struct render_interface_s // shuffle previous & next states for lerping void (*CL_UpdateLatchedVars)( struct cl_entity_s *e, qboolean reset ); } render_interface_t; + #endif//RENDER_API_H