From 0adb4eba090dfa5684b661a01ea9d67244fede75 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 11:46:40 +0100 Subject: 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. --- src/world.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/world.cpp') diff --git a/src/world.cpp b/src/world.cpp index d7023c7..2fa1fc4 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -180,7 +180,9 @@ bool apply_tint(int world_r, int world_g, int world_b, int sky_r, int sky_g, float wr = world_r / 255.0f, wg = world_g / 255.0f, wb = world_b / 255.0f; float sr = sky_r / 255.0f, sg = sky_g / 255.0f, sb = sky_b / 255.0f; - float pr = prop_r / 255.0f, pg = prop_g / 255.0f, pb = prop_b / 255.0f; + (void)prop_r; + (void)prop_g; + (void)prop_b; unsigned short inv = invalid(ms); int seen = 0, world_hits = 0, sky_hits = 0, prop_hits = 0; @@ -215,13 +217,10 @@ bool apply_tint(int world_r, int world_g, int world_b, int sky_r, int sky_g, mod_fn(mat, sr, sg, sb); sky_hits++; } else if (is_prop_material(name)) { - mod_fn(mat, pr, pg, pb); + // Props are tinted through IStudioRender (studio.cpp); material + // modulation is overridden per draw by the engine, so leave prop + // materials untouched here. prop_hits++; - static int crate_logs = 0; - if (crate_logs < 8 && strstr(name, "crate")) { - crate_logs++; - logf("tint: prop material \"%s\"", name); - } } } logf("tint: applied world=%d(%d,%d,%d) sky=%d(%d,%d,%d) props=%d(%d,%d,%d) " -- cgit v1.2.3