diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 11:30:56 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 11:30:56 +0100 |
| commit | 33c6bf853e1292816882ca4df9ba2a79f8a7288a (patch) | |
| tree | a65d1112e5a1a10c3417912900442ac876c80d50 /src/studio.cpp | |
| parent | Props: tint through DrawModel/DrawModelArray; drop m_clrRender writes (diff) | |
| download | hl2h-33c6bf853e1292816882ca4df9ba2a79f8a7288a.tar.gz hl2h-33c6bf853e1292816882ca4df9ba2a79f8a7288a.zip | |
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.
Diffstat (limited to 'src/studio.cpp')
| -rw-r--r-- | src/studio.cpp | 13 |
1 files changed, 10 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; | |||
| 40 | int g_prop_depth = 0; | 40 | int g_prop_depth = 0; |
| 41 | int g_static_calls = 0; | 41 | int g_static_calls = 0; |
| 42 | int g_static_props = 0; | 42 | int g_static_props = 0; |
| 43 | int g_model_logs = 0; | ||
| 44 | int g_array_logs = 0; | ||
| 43 | 45 | ||
| 44 | bool prop_tint_on() { | 46 | bool prop_tint_on() { |
| 45 | return feature_active(FEAT_WORLD_TINT) && g_tint_prop_on; | 47 | 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, | |||
| 105 | void *flex, void *flex_delayed, int flags) { | 107 | void *flex, void *flex_delayed, int flags) { |
| 106 | const char *model = info_model_name(info); | 108 | const char *model = info_model_name(info); |
| 107 | bool prop = prop_tint_on() && is_prop_model(model); | 109 | bool prop = prop_tint_on() && is_prop_model(model); |
| 108 | if (g_static_calls < 3 && prop) | 110 | if (g_model_logs < 10) { |
| 109 | logf("studio: DrawModel prop model=\"%s\"", model ? model : "?"); | 111 | g_model_logs++; |
| 112 | logf("studio: DrawModel model=\"%s\" prop=%d", model ? model : "?", | ||
| 113 | (int)prop); | ||
| 114 | } | ||
| 110 | if (prop) { | 115 | if (prop) { |
| 111 | force_prop_color(self); | 116 | force_prop_color(self); |
| 112 | g_prop_depth++; | 117 | g_prop_depth++; |
| @@ -120,9 +125,11 @@ void hook_draw_array(void *self, void *info, int count, void *instances, | |||
| 120 | int stride, int flags) { | 125 | int stride, int flags) { |
| 121 | const char *model = info_model_name(info); | 126 | const char *model = info_model_name(info); |
| 122 | bool prop = prop_tint_on() && is_prop_model(model); | 127 | bool prop = prop_tint_on() && is_prop_model(model); |
| 123 | if (g_static_calls < 3) | 128 | if (g_array_logs < 10) { |
| 129 | g_array_logs++; | ||
| 124 | logf("studio: DrawModelArray count=%d model=\"%s\" prop=%d", count, | 130 | logf("studio: DrawModelArray count=%d model=\"%s\" prop=%d", count, |
| 125 | model ? model : "?", (int)prop); | 131 | model ? model : "?", (int)prop); |
| 132 | } | ||
| 126 | if (prop) { | 133 | if (prop) { |
| 127 | force_prop_color(self); | 134 | force_prop_color(self); |
| 128 | g_prop_depth++; | 135 | g_prop_depth++; |
