summaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 18:03:09 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 18:03:09 +0100
commitccd5256bfacf27ed81fbf13087ba04978d6913f8 (patch)
tree8729b2e3e9bc7a43c1babb0376ea8b67fb5c9af5 /src/world.cpp
parentChams: material fallbacks and FindMaterial diagnostics (diff)
downloadhl2h-ccd5256bfacf27ed81fbf13087ba04978d6913f8.tar.gz
hl2h-ccd5256bfacf27ed81fbf13087ba04978d6913f8.zip
Chams: tint through $color/$color2 and log the chosen material
ColorModulate alone left the forced material white. Also set the shader's $color and $color2 vars (IMaterialVar SetVecValue 3-float) and restore them to white after the draw. Log which fallback material was selected.
Diffstat (limited to '')
-rw-r--r--src/world.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 15a93ec..284e64e 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -1038,8 +1038,10 @@ void *world_find_material(const char *name) {
1038 const char *n = mat_name(mat); 1038 const char *n = mat_name(mat);
1039 if (n) { 1039 if (n) {
1040 for (int c = 0; candidates[c]; c++) 1040 for (int c = 0; candidates[c]; c++)
1041 if (strcmp(n, candidates[c]) == 0) 1041 if (strcmp(n, candidates[c]) == 0) {
1042 logf("chams: material %s = %p", n, mat);
1042 return mat; 1043 return mat;
1044 }
1043 } 1045 }
1044 } 1046 }
1045 h = next(ms, h); 1047 h = next(ms, h);