diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 11:49:32 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 11:49:45 +0100 |
| commit | cc06dab406a0086ddcb9e4ced3759614f65e069e (patch) | |
| tree | 3506bc169caa80cddfc7a206bf54c74a9c796048 /src/studio.cpp | |
| parent | Props: force colour inside prop DrawModel; no prop material tint (diff) | |
| download | hl2h-cc06dab406a0086ddcb9e4ced3759614f65e069e.tar.gz hl2h-cc06dab406a0086ddcb9e4ced3759614f65e069e.zip | |
Props: remove studio diagnostics; document the prop tint path
Drop the temporary DrawModel/SetColor logs now that the prop tint works, and
document the IStudioRender hook layout, the short model-name format used for
prop detection, the SetColor-before-DrawModel ordering, and why prop
materials cannot be tinted directly.
Diffstat (limited to 'src/studio.cpp')
| -rw-r--r-- | src/studio.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/studio.cpp b/src/studio.cpp index c4c3cfb..485b4fb 100644 --- a/src/studio.cpp +++ b/src/studio.cpp | |||
| @@ -40,8 +40,6 @@ 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; | ||
| 45 | 43 | ||
| 46 | bool prop_tint_on() { | 44 | bool prop_tint_on() { |
| 47 | return feature_active(FEAT_WORLD_TINT) && g_tint_prop_on; | 45 | return feature_active(FEAT_WORLD_TINT) && g_tint_prop_on; |
| @@ -89,15 +87,7 @@ bool is_prop_model(const char *name) { | |||
| 89 | strncmp(name, "props_", 6) == 0; | 87 | strncmp(name, "props_", 6) == 0; |
| 90 | } | 88 | } |
| 91 | 89 | ||
| 92 | int g_color_logs = 0; | ||
| 93 | |||
| 94 | void hook_set_color(void *self, const float *color) { | 90 | void hook_set_color(void *self, const float *color) { |
| 95 | if (g_color_logs < 10) { | ||
| 96 | g_color_logs++; | ||
| 97 | logf("studio: SetColorModulation depth=%d color=%.2f,%.2f,%.2f", | ||
| 98 | g_prop_depth, color ? color[0] : 0.0f, color ? color[1] : 0.0f, | ||
| 99 | color ? color[2] : 0.0f); | ||
| 100 | } | ||
| 101 | if (g_prop_depth > 0 && prop_tint_on()) { | 91 | if (g_prop_depth > 0 && prop_tint_on()) { |
| 102 | float c[4]; | 92 | float c[4]; |
| 103 | prop_color(c); | 93 | prop_color(c); |
| @@ -120,11 +110,6 @@ void hook_draw_model(void *self, void *results, void *info, void *bone, | |||
| 120 | void *flex, void *flex_delayed, int flags) { | 110 | void *flex, void *flex_delayed, int flags) { |
| 121 | const char *model = info_model_name(info); | 111 | const char *model = info_model_name(info); |
| 122 | bool prop = prop_tint_on() && is_prop_model(model); | 112 | bool prop = prop_tint_on() && is_prop_model(model); |
| 123 | if (g_model_logs < 10) { | ||
| 124 | g_model_logs++; | ||
| 125 | logf("studio: DrawModel model=\"%s\" prop=%d", model ? model : "?", | ||
| 126 | (int)prop); | ||
| 127 | } | ||
| 128 | if (prop) { | 113 | if (prop) { |
| 129 | float c[4]; | 114 | float c[4]; |
| 130 | prop_color(c); | 115 | prop_color(c); |
| @@ -140,11 +125,6 @@ void hook_draw_array(void *self, void *info, int count, void *instances, | |||
| 140 | int stride, int flags) { | 125 | int stride, int flags) { |
| 141 | const char *model = info_model_name(info); | 126 | const char *model = info_model_name(info); |
| 142 | bool prop = prop_tint_on() && is_prop_model(model); | 127 | bool prop = prop_tint_on() && is_prop_model(model); |
| 143 | if (g_array_logs < 10) { | ||
| 144 | g_array_logs++; | ||
| 145 | logf("studio: DrawModelArray count=%d model=\"%s\" prop=%d", count, | ||
| 146 | model ? model : "?", (int)prop); | ||
| 147 | } | ||
| 148 | if (prop) | 128 | if (prop) |
| 149 | g_prop_depth++; | 129 | g_prop_depth++; |
| 150 | g_orig_draw_array(self, info, count, instances, stride, flags); | 130 | g_orig_draw_array(self, info, count, instances, stride, flags); |
