summaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 18:43:28 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 18:43:28 +0100
commitd7201a987ba6cc56fda3d3ea69275307385f7c3e (patch)
tree54d5247ac75adc3b9241c323dbc0ca5db5d35c96 /src/world.cpp
parentChams: style flags on the resident debug material (diff)
downloadhl2h-d7201a987ba6cc56fda3d3ea69275307385f7c3e.tar.gz
hl2h-d7201a987ba6cc56fda3d3ea69275307385f7c3e.zip
Chams: preload style materials outside the model draw
FindMaterial inside DrawModelExecute did not load the style VMTs, so every style fell back to the solid material. Preload the six style materials from outer_draw (throttled) and have the render hook use the cached pointers only. world_find_material now returns only the exact requested material; the caller falls back to the solid style. Add a vgui/white probe and per-style preload logs.
Diffstat (limited to '')
-rw-r--r--src/world.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/world.cpp b/src/world.cpp
index d071281..ea186b4 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -1065,19 +1065,6 @@ void *world_find_material(const char *name) {
1065 logf("chams: material %s = %p", name, mat); 1065 logf("chams: material %s = %p", name, mat);
1066 return mat; 1066 return mat;
1067 } 1067 }
1068 static const char *fallbacks[] = {"debug/debugtranslucentsinglecolor", 1068 logd("chams: material %s not found", name);
1069 "models/debug/debugwhite", "vgui/white",
1070 nullptr};
1071 for (int i = 0; fallbacks[i]; i++) {
1072 mat = walk(fallbacks[i]);
1073 if (!mat)
1074 mat = find(fallbacks[i]);
1075 if (mat) {
1076 logf("chams: material %s (fallback for %s) = %p", fallbacks[i], name,
1077 mat);
1078 return mat;
1079 }
1080 }
1081 logf("chams: material %s not found", name);
1082 return nullptr; 1069 return nullptr;
1083} 1070}