From 66dcdf23dbef015f78ce9d9ed765eefa2034c8a8 Mon Sep 17 00:00:00 2001 From: arcattack Date: Tue, 21 Jul 2026 00:44:38 -0500 Subject: [PATCH] Gauges: ammo count stencils out of the fire-ready dot (BallisticWeaponCluster) The base-page missile/round count sat on the fire-ready "dot" (the cluster image blitted green when charged) as green digits on an opaque black box -- a messy dark rectangle punched into the solid green dot. The binary swaps the ammo count's colours with the dot state. Verified from the decomp: BallisticWeaponCluster overrides DrawWarningLamp (@004c9b50) -- it chains the base (@004c932c, which blits the dot in on-colour 0xff / off-colour 0) and then calls the ammo NumericDisplayInteger's SetColors: dot ABSENT -> SetColors(0, 0xff) == green digits on black dot PRESENT -> SetColors(0xff, 0) == BLACK digits cut out of the green dot so the count is always legible (a stencil against the solid dot -- the same black-on-green look as the loop/generator squares). SetColors ForceUpdate()s the numeric so it repaints over the freshly drawn dot. The port had only the base WeaponCluster::DrawWarningLamp (non-virtual, no swap), so the count stayed green-on-black and clashed with the green dot. Made DrawWarningLamp virtual and added the BallisticWeaponCluster override. Render-verified (STREAK "0024" now black-cut-out of the solid dot); energy weapons (no ammo count) unaffected. Both builds clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- game/reconstructed/btl4gau2.cpp | 20 ++++++++++++++++++++ game/reconstructed/btl4gau2.hpp | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/game/reconstructed/btl4gau2.cpp b/game/reconstructed/btl4gau2.cpp index cc9bddb..ca926f2 100644 --- a/game/reconstructed/btl4gau2.cpp +++ b/game/reconstructed/btl4gau2.cpp @@ -2054,6 +2054,26 @@ void BallisticWeaponCluster::Execute() WeaponCluster::Execute(); } +// +// @004c9b50 -- DrawWarningLamp override: draw the fire-ready "dot" (the base +// blits the cluster image in on-colour 0xff / off-colour 0), THEN swap the +// base-page ammo count's colours so the digits stay legible against it: +// dot ABSENT (on==0) -> SetColors(bg=0, fg=0xff) == GREEN digits on black +// dot PRESENT (on!=0) -> SetColors(bg=0xff, fg=0) == BLACK digits cut out of +// the solid green dot (the stencil look) +// The SetColors call ForceUpdate()s the numeric so it repaints over the freshly +// drawn dot on the next child-execute pass. (Verified vs binary FUN_004c9b50 + +// the base DrawWarningLamp FUN_004c932c; the port had only the base, so the +// ammo count stayed green-on-black and clashed with the green dot.) +// +void BallisticWeaponCluster::DrawWarningLamp(int on) +{ + WeaponCluster::DrawWarningLamp(on); // FUN_004c932c: draw the dot + if (ammoCountA) + ((NumericDisplayInteger *)ammoCountA)->SetColors(on ? 0xff : 0, + on ? 0 : 0xff); +} + // // @004c9adc -- TestInstance: True unless the ammo bin is present and the eject // wipe is mid-cycle. diff --git a/game/reconstructed/btl4gau2.hpp b/game/reconstructed/btl4gau2.hpp index 53d4f90..a464378 100644 --- a/game/reconstructed/btl4gau2.hpp +++ b/game/reconstructed/btl4gau2.hpp @@ -493,7 +493,7 @@ ~WeaponCluster(); // @004c91d4 void BecameActive(); // @004c9258 void Execute(); // @004c9290 - void DrawWarningLamp(int color); // @004c932c + virtual void DrawWarningLamp(int on); // @004c932c (virtual: BallisticWeaponCluster overrides) protected: char *clusterImage; // @0xCC this[0x33] GraphicGauge *rechargeArc; // @0xD0 this[0x34] SegmentArc270 @@ -535,6 +535,7 @@ ~BallisticWeaponCluster(); // @004c9940 void BecameActive(); // @004c99cc void Execute(); // @004c9a38 + void DrawWarningLamp(int on); // @004c9b50 (override: dot + ammo colour swap) Logical TestInstance() const; // @004c9adc protected: Logical jammed; // @0xE8 this[0x3A]