From d7201a987ba6cc56fda3d3ea69275307385f7c3e Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 18:43:28 +0100 Subject: 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. --- src/world.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/world.cpp') 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) { logf("chams: material %s = %p", name, mat); return mat; } - static const char *fallbacks[] = {"debug/debugtranslucentsinglecolor", - "models/debug/debugwhite", "vgui/white", - nullptr}; - for (int i = 0; fallbacks[i]; i++) { - mat = walk(fallbacks[i]); - if (!mat) - mat = find(fallbacks[i]); - if (mat) { - logf("chams: material %s (fallback for %s) = %p", fallbacks[i], name, - mat); - return mat; - } - } - logf("chams: material %s not found", name); + logd("chams: material %s not found", name); return nullptr; } -- cgit v1.2.3