From 33c6bf853e1292816882ca4df9ba2a79f8a7288a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 11:30:56 +0100 Subject: Diagnose prop tinting: log prop materials and studio draw model names Log the first crate materials the tint pass modifies and the first DrawModel/ DrawModelArray calls with their model names, to see whether the crates are brush materials that were never reached, materials loaded after the tint was applied, or a studio draw path that is still missed. --- src/studio.cpp | 13 ++++++++++--- src/world.cpp | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/studio.cpp b/src/studio.cpp index 01f4830..fa004de 100644 --- a/src/studio.cpp +++ b/src/studio.cpp @@ -40,6 +40,8 @@ bool g_installed = false; int g_prop_depth = 0; int g_static_calls = 0; int g_static_props = 0; +int g_model_logs = 0; +int g_array_logs = 0; bool prop_tint_on() { return feature_active(FEAT_WORLD_TINT) && g_tint_prop_on; @@ -105,8 +107,11 @@ void hook_draw_model(void *self, void *results, void *info, void *bone, void *flex, void *flex_delayed, int flags) { const char *model = info_model_name(info); bool prop = prop_tint_on() && is_prop_model(model); - if (g_static_calls < 3 && prop) - logf("studio: DrawModel prop model=\"%s\"", model ? model : "?"); + if (g_model_logs < 10) { + g_model_logs++; + logf("studio: DrawModel model=\"%s\" prop=%d", model ? model : "?", + (int)prop); + } if (prop) { force_prop_color(self); g_prop_depth++; @@ -120,9 +125,11 @@ void hook_draw_array(void *self, void *info, int count, void *instances, int stride, int flags) { const char *model = info_model_name(info); bool prop = prop_tint_on() && is_prop_model(model); - if (g_static_calls < 3) + if (g_array_logs < 10) { + g_array_logs++; logf("studio: DrawModelArray count=%d model=\"%s\" prop=%d", count, model ? model : "?", (int)prop); + } if (prop) { force_prop_color(self); g_prop_depth++; diff --git a/src/world.cpp b/src/world.cpp index 0de86c6..d7023c7 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -217,6 +217,11 @@ bool apply_tint(int world_r, int world_g, int world_b, int sky_r, int sky_g, } else if (is_prop_material(name)) { mod_fn(mat, pr, pg, pb); 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