summaryrefslogtreecommitdiffstats
path: root/src/hl2h.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-03 23:32:16 +0100
committersalmonik <salmonik@tuta.io>2026-11-03 23:32:16 +0100
commitedba65625dd5823705619a2e682a99d6ad91ae8b (patch)
treecae03d46267469d1076937ad22c7b2aec63b068e /src/hl2h.cpp
parentGUI: add inline colour picker control (diff)
downloadhl2h-edba65625dd5823705619a2e682a99d6ad91ae8b.tar.gz
hl2h-edba65625dd5823705619a2e682a99d6ad91ae8b.zip
World: add prop tint and fog override
- World tint now also colours prop materials (models/props*) with their own colour, covering static props and prop_physics while leaving NPC, player and weapon materials untouched. - New Fog card: fog_override colour/start/end via ClientCmd, optional skybox fog, and a Remove fog mode. Restores the map fog (fog_override 0) when disabled and re-applies after level changes. - Config sections [worldtint] prop/colour keys and [fog].
Diffstat (limited to '')
-rw-r--r--src/hl2h.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/hl2h.cpp b/src/hl2h.cpp
index dfe4e57..3f1acb4 100644
--- a/src/hl2h.cpp
+++ b/src/hl2h.cpp
@@ -130,17 +130,23 @@ static int g_modified_logged = 0;
130// ConCommandBase has two dtor slots, then IsCommand, IsFlagSet, AddFlags, 130// ConCommandBase has two dtor slots, then IsCommand, IsFlagSet, AddFlags,
131// GetName, GetHelpText, IsRegistered, GetDLLIdentifier; ConVar then adds 131// GetName, GetHelpText, IsRegistered, GetDLLIdentifier; ConVar then adds
132// SetValue(const char*), SetValue(float), SetValue(int) -> slot 11. 132// SetValue(const char*), SetValue(float), SetValue(int) -> slot 11.
133bool console_cmd(const char *cmd) {
134 if (!cmd || !*cmd || !g_iface.engine)
135 return false;
136 using CmdFn = void (*)(void *, const char *);
137 vfunc<CmdFn>(g_iface.engine, 7)(g_iface.engine, cmd);
138 logd("cmd: %s", cmd);
139 return true;
140}
141
133bool cvar_set_int(const char *name, int value) { 142bool cvar_set_int(const char *name, int value) {
134 if (!name || !g_iface.engine) 143 if (!name)
135 return false; 144 return false;
136 // Use the stable IVEngineClient ClientCmd slot rather than poking ConVar's 145 // Use the stable IVEngineClient ClientCmd slot rather than poking ConVar's
137 // vtable; the installed VEngineCvar004 layout differs enough to crash. 146 // vtable; the installed VEngineCvar004 layout differs enough to crash.
138 char cmd[96]; 147 char cmd[96];
139 snprintf(cmd, sizeof(cmd), "%s %d", name, value); 148 snprintf(cmd, sizeof(cmd), "%s %d", name, value);
140 using CmdFn = void (*)(void *, const char *); 149 return console_cmd(cmd);
141 vfunc<CmdFn>(g_iface.engine, 7)(g_iface.engine, cmd);
142 logd("cvar: command '%s'", cmd);
143 return true;
144} 150}
145 151
146void note_modified(const CUserCmd *cmd, int flags, const float *vel) { 152void note_modified(const CUserCmd *cmd, int flags, const float *vel) {
@@ -585,6 +591,7 @@ static void do_move(int seq, float frametime) {
585 silentaim_reset_lock(); 591 silentaim_reset_lock();
586 fullbright_invalidate(); 592 fullbright_invalidate();
587 world_tint_invalidate(); 593 world_tint_invalidate();
594 fog_invalidate();
588 } 595 }
589 596
590 if (feature_active(FEAT_SPREAD)) { 597 if (feature_active(FEAT_SPREAD)) {