diff --git a/game/reconstructed/btl4gaug.cpp b/game/reconstructed/btl4gaug.cpp index a01ae2f..3e54f0c 100644 --- a/game/reconstructed/btl4gaug.cpp +++ b/game/reconstructed/btl4gaug.cpp @@ -1737,33 +1737,52 @@ void HorizTwoPartBar::BecameActive() // @004c4324 // // @004c4340 -- Execute: clamp value to [0,high], map value/warn to bar pixels -// (half-up round of width*x/high), repaint on change (mirror of VertTwoPartBar -// but along X). +// (half-up round of width*x/high), repaint on change. THREE zones along X +// (mirror of VertTwoPartBar along Y): +// [0, warnPix) striped TILE pattern (DrawTiledBitmap @004c4482) +// [warnPix, valPix) backgroundColor solid (only when value > low) @004c449d +// [valPix, width) fillColor solid @004c44da +// FIX 2026-07-21: the port had solid-filled from warnPix (no tile, no [0,warnPix] +// zone) -- so the bar read as "starts in the middle" + "not striped". Restored +// the tiled first zone + the correct zone colours from the binary disasm. // void HorizTwoPartBar::Execute() { - if (value < 0.0f) value = 0.0f; - else if (value > high) value = high; + if (value < 0.0f) value = 0.0f; // @004c434c fcomp 0.0 + else if (value > high) value = high; // @004c4367 fcomp high - int warnPix = (int)((Scalar)width * low / high + 0.5f); - int valPix = (int)((Scalar)width * value / high + 0.5f); + int warnPix = (int)((Scalar)width * low / high + 0.5f); // low/warn threshold pixel + int valPix = (int)((Scalar)width * value / high + 0.5f); // current value pixel if (warnPix < 0) warnPix = 0; else if (warnPix > width) warnPix = width; if (valPix < 0) valPix = 0; else if (valPix > width) valPix = width; if (warnPix != previousFull || valPix != previousFill) { - if (warnPix < valPix) - { - localView.SetColor(fillColor); - localView.MoveToAbsolute(warnPix, 0); - localView.DrawFilledRectangleToAbsolute(valPix - 1, height); - } - if (valPix < width) + // Zone 1 [0, warnPix): the striped tile (the binary's tiled blit, NOT a + // solid fill). SetColor(backgroundColor) is the tile's opaque backdrop. + L4Warehouse *warehouse = (L4Warehouse *)renderer->warehousePointer; + BitMap *tile = warehouse->bitMapBin.Get(tileImage); // FUN_00442aec + localView.SetColor(backgroundColor); // vtbl+0x18 @004c443a + DrawTiledBitmap(&localView, 0, 0, warnPix - 1, height, fillColor, tile); + warehouse->bitMapBin.Release(tileImage); // FUN_00442c12 + + // Zone 2 [warnPix, valPix): backgroundColor (binary keeps the current + // colour, still backgroundColor from zone 1) -- only when value > low. + if (valPix > warnPix) { localView.SetColor(backgroundColor); + localView.MoveToAbsolute(warnPix, 0); // vtbl+0x24 + localView.DrawFilledRectangleToAbsolute(valPix - 1, height); // vtbl+0x48 + } + + // Zone 3 [valPix, width): the solid fill colour. + if (valPix < width) + { + localView.SetColor(fillColor); // @004c44da localView.MoveToAbsolute(valPix, 0); localView.DrawFilledRectangleToAbsolute(width, height); } + previousFull = warnPix; previousFill = valPix; }