Gauges: fix temp/status bar colours (black remainder, not green)

Follow-up to the tiled-render fix: the two colour params were swapped.  The
binary caller (@004c8269) pushes the colours 0xff then 0; they land at
[this+0xA0]=fillColor (0xff green) and [this+0xA4]=backgroundColor (0 black).
The binary uses the GREEN for zone 1 (tile SetColor / dots) and zone 2 (the
over-degrade fill), and BLACK only for zone 3 (the unfilled remainder
[valPix,width]).

The port had them reversed -- zone 3 used fillColor -- so the whole remainder
of the bar (most of it, since valPix is small when cold) rendered solid green
instead of black.  Swapped: zone 1 + zone 2 = fillColor (green), zone 3 =
backgroundColor (black).  Render-verified: black background + green dotted tick
scale + a green hatch fill growing from the left, matching the reference.
Both builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-21 08:19:05 -05:00
co-authored by Claude Opus 4.8
parent 2e9c1c7c0d
commit 4fbc911f55
+14 -9
View File
@@ -1758,27 +1758,32 @@ void HorizTwoPartBar::Execute()
if (warnPix != previousFull || valPix != previousFill)
{
// Zone 1 [0, warnPix): the striped tile (the binary's tiled blit, NOT a
// solid fill). SetColor(backgroundColor) is the tile's opaque backdrop.
// COLOUR MAP (binary @004c4340): the two colour params land at [this+0xA0]
// = fillColor (0xff, green) and [this+0xA4] = backgroundColor (0, black).
// Zone 1 SetColor + the tile dots + the zone-2 over-degrade fill use the
// GREEN; only zone 3 (the unfilled remainder) is BLACK. The port had these
// swapped -> the whole [valPix,width] remainder rendered green.
//
// Zone 1 [0, warnPix): the striped tile, green dots on black.
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);
localView.SetColor(fillColor); // vtbl+0x18 @004c443a ([0xA0]=green)
DrawTiledBitmap(&localView, 0, 0, warnPix - 1, height, backgroundColor, 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.
// Zone 2 [warnPix, valPix): the green over-degrade fill (binary keeps the
// current colour, still fillColor from zone 1) -- only when value > low.
if (valPix > warnPix)
{
localView.SetColor(backgroundColor);
localView.SetColor(fillColor);
localView.MoveToAbsolute(warnPix, 0); // vtbl+0x24
localView.DrawFilledRectangleToAbsolute(valPix - 1, height); // vtbl+0x48
}
// Zone 3 [valPix, width): the solid fill colour.
// Zone 3 [valPix, width): the unfilled remainder -- backgroundColor (black).
if (valPix < width)
{
localView.SetColor(fillColor); // @004c44da
localView.SetColor(backgroundColor); // @004c44da ([0xA4]=black)
localView.MoveToAbsolute(valPix, 0);
localView.DrawFilledRectangleToAbsolute(width, height);
}