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 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/studio.cpp') 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++; -- cgit v1.2.3