vehicleSubSystems follow-up: reconstruct BitMapInverseWipe::Execute (LeakGauge)

Replace the minimal-safe Execute stub with the authentic wipe (@004c5d08): round
the level, repaint `frames` segments stacked vertically, each picking its strip
frame (empty/half/full via colorA/colorB) from the level.  The coolant LeakGauge in
every SubsystemCluster now renders faithfully from its CoolantMassLeakRate value.
Build clean, 7 panels, 0 crashes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-07 07:34:12 -05:00
co-authored by Claude Opus 4.8
parent fbf5118c9c
commit 4ab6748563
+25 -6
View File
@@ -1703,21 +1703,40 @@ void BitMapInverseWipe::BecameActive() // @004c5cf4
}
//
// @004c5d08 -- Execute. BRING-UP: the authentic wipe (reveal the bitmap columns
// up to the level, coloured by colorA/colorB) needs the frame-strip blit math;
// a safe minimal repaint (blit the base frame on level change) keeps the vtable
// complete + non-crashing until the full wipe lands.
// @004c5d08 -- Execute. Round the level to [0, fullWidth] (a tiny non-zero value
// forces at least 1); on a change repaint `frames` segments stacked vertically,
// each picking its strip frame from the level: <1 = empty (colorA, frame 0), ==1 =
// half (colorB, middle frame), >1 = full (colorB, last frame), decrementing the
// level by 2 per segment. (The coolant LeakGauge; value = CoolantMassLeakRate.)
//
void BitMapInverseWipe::Execute()
{
int level = (int)value;
int level = (int)(value + (value < 0.0f ? -0.5f : 0.5f)); // FUN_004dcd94 round
if (level < 0) level = 0;
if (level > fullWidth) level = fullWidth;
if (value > 0.0025f && level < 1) level = 1; // _DAT_0050e3d8
if (level != previousLevel)
{
previousLevel = level;
L4Warehouse *warehouse = (L4Warehouse *)renderer->warehousePointer;
BitMap *bmp = warehouse->bitMapBin.Get(imageName);
if (bmp != NULL)
localView.DrawBitMapOpaque(0, 0, bmp);
{
int y = -frameHeight;
for (int seg = frames; seg > 0; seg--)
{
localView.MoveToAbsolute(0, y); // vtbl+0x24
int frameIndex;
if (level < 1) { localView.SetColor(colorA); frameIndex = 0; }
else if (level == 1) { localView.SetColor(colorB); frameIndex = frameWidth; }
else { localView.SetColor(colorB); frameIndex = frameWidth * 2; }
localView.DrawBitMap(0, bmp, frameIndex, 0, // vtbl+0x54
frameWidth + frameIndex, frameHeight);
level -= 2;
y -= frameHeight;
}
}
warehouse->bitMapBin.Release(imageName);
}
}