#87: mech armour PANELS now darken with damage -- the .DZM material system was loaded and unused

Players: "the actual enemy mech in external view is not showing darkened armor
panels".  We swapped destroyed LIMB meshes but never darkened a panel.

The 1995 game darkens armour through the MATERIALS.  MakeMechRenderables
(FUN_004cef28) built, per (damage zone, material), a watcher
FUN_004573e4(material, &zone->damageLevel, 0.1f) that snapshotted the materials
This commit is contained in:
Joe DiPrima
2026-07-31 19:52:55 -05:00
parent 5410371b0c
commit 137c151951
14 changed files with 589 additions and 1 deletions
+7
View File
@@ -619,6 +619,9 @@ struct Builder {
uint32_t currentColor = 0xFFB0B0B8u;
bool currentHasDiffuse = false; // material carried an explicit diffuse tag
std::string currentTex;
// authored (pre-substitution) "library:material_mtl" of the material in force --
// the .DZM armour-damage lists key on this (issue #87)
std::string currentMatName;
int currentTexChannel = 0; // BSL bit-slice (BMF tag 0x18)
bool currentTexScroll = false; // TEXTURE SPECIAL " SCROLL" (tag 0x2037)
float currentTexScrollU = 0.0f, currentTexScrollV = 0.0f;
@@ -872,6 +875,7 @@ struct Builder {
batch.color = pureEmissive ? currentColor // keep BLACK: L4D3D's
: (useRamp ? rampTint : currentColor); // pure-emissive test keys on it
batch.texPath = currentTex;
batch.matName = currentMatName; // .DZM armour-damage key (issue #87)
batch.texChannel = currentTexChannel;
batch.texScroll = currentTexScroll;
batch.texScrollU = currentTexScrollU;
@@ -1185,6 +1189,9 @@ struct Builder {
size_t maxn = ch.len - 1, n = 0;
while (n < maxn && s[n]) ++n;
std::string full(s, n);
// remember the AUTHORED name (before the paint callback rewrites
// it) -- the .DZM zone material lists are authored against it
currentMatName = full;
// baked ground-shadow material (basev:shadow_mtl etc.)
currentShadowMat = false;
for (size_t si = 0; si + 6 <= full.size(); ++si)