From 5153c37de890c42c8da97a0bcf0df724ef25f7f7 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 11:25:50 +0100 Subject: World tint: include props/ materials; log static studio draws Static props commonly use brush-style props/... materials (props/woodcrate001a is LightmappedGeneric), so the models/props-only filter missed them. Include the props/ prefix. Also log the first static prop studio draws and a 500-draw summary so we can see whether the engine draws props through DrawModelStaticProp at all. --- src/studio.cpp | 14 +++++++++++++- src/world.cpp | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/studio.cpp b/src/studio.cpp index dd6f109..0c988dc 100644 --- a/src/studio.cpp +++ b/src/studio.cpp @@ -33,6 +33,8 @@ DrawStaticFn g_orig_draw_static = nullptr; bool g_install_tried = false; bool g_installed = false; int g_prop_depth = 0; +int g_static_calls = 0; +int g_static_props = 0; bool prop_tint_on() { return feature_active(FEAT_WORLD_TINT) && g_tint_prop_on; @@ -89,7 +91,17 @@ void hook_set_alpha(void *self, float alpha) { void hook_draw_static_prop(void *self, void *info, void *model_to_world, int flags) { - bool prop = prop_tint_on() && is_prop_model(info_model_name(info)); + const char *model = info_model_name(info); + bool prop = prop_tint_on() && is_prop_model(model); + g_static_calls++; + if (prop) + g_static_props++; + if (g_static_calls <= 3) + logf("studio: static draw model=\"%s\" prop=%d", model ? model : "?", + (int)prop); + if (g_static_calls == 500) + logf("studio: static draws=%d prop_draws=%d", g_static_calls, + g_static_props); if (prop) { // The engine may have set the modulation just before this call; override // it here as well as from the SetColorModulation hook (the static-prop diff --git a/src/world.cpp b/src/world.cpp index 38d302f..0de86c6 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -58,7 +58,11 @@ Tint g_applied{false, 255, 255, 255, 255, 255, 255, 255, 255, 255}; // map prop lives under models/props*, which keeps NPC/player/weapon materials // out of the prop pass. bool is_prop_material(const char *name) { - return name && strncmp(name, "models/props", 12) == 0; + // Static props often use the brush-style "props/..." materials (e.g. + // props/woodcrate001a, LightmappedGeneric), while dynamic props use + // models/props_junk/... . + return name && (strncmp(name, "models/props", 12) == 0 || + strncmp(name, "props/", 6) == 0); } struct MatCalls { -- cgit v1.2.3