summaryrefslogtreecommitdiffstats
path: root/src/studio.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 11:46:40 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 11:46:40 +0100
commit0adb4eba090dfa5684b661a01ea9d67244fede75 (patch)
tree67e6ace7a981ad3a182a720bf0bc1fb231f39ac9 /src/studio.cpp
parentProps: install the studio hooks again (diff)
downloadhl2h-0adb4eba090dfa5684b661a01ea9d67244fede75.tar.gz
hl2h-0adb4eba090dfa5684b661a01ea9d67244fede75.zip
Props: force colour inside prop DrawModel; no prop material tint
The engine calls SetColorModulation(1,1,1) immediately before DrawModel, so the in-draw flag never sees it. Set the prop colour at the start of the prop DrawModel hook instead (colour only, not alpha), and stop applying ColorModulate to prop materials so only one mechanism touches props.
Diffstat (limited to 'src/studio.cpp')
-rw-r--r--src/studio.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/studio.cpp b/src/studio.cpp
index 110ce74..c4c3cfb 100644
--- a/src/studio.cpp
+++ b/src/studio.cpp
@@ -125,8 +125,12 @@ void hook_draw_model(void *self, void *results, void *info, void *bone,
125 logf("studio: DrawModel model=\"%s\" prop=%d", model ? model : "?", 125 logf("studio: DrawModel model=\"%s\" prop=%d", model ? model : "?",
126 (int)prop); 126 (int)prop);
127 } 127 }
128 if (prop) 128 if (prop) {
129 float c[4];
130 prop_color(c);
131 g_orig_set_color(self, c);
129 g_prop_depth++; 132 g_prop_depth++;
133 }
130 g_orig_draw_model(self, results, info, bone, flex, flex_delayed, flags); 134 g_orig_draw_model(self, results, info, bone, flex, flex_delayed, flags);
131 if (prop) 135 if (prop)
132 g_prop_depth--; 136 g_prop_depth--;