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) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-21 00:44:38 -05:00
co-authored by Claude Opus 4.8
parent f2eaf3d0ac
commit 66dcdf23db
2 changed files with 22 additions and 1 deletions
+20
View File
@@ -2054,6 +2054,26 @@ void BallisticWeaponCluster::Execute()
WeaponCluster::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 // @004c9adc -- TestInstance: True unless the ammo bin is present and the eject
// wipe is mid-cycle. // wipe is mid-cycle.
+2 -1
View File
@@ -493,7 +493,7 @@
~WeaponCluster(); // @004c91d4 ~WeaponCluster(); // @004c91d4
void BecameActive(); // @004c9258 void BecameActive(); // @004c9258
void Execute(); // @004c9290 void Execute(); // @004c9290
void DrawWarningLamp(int color); // @004c932c virtual void DrawWarningLamp(int on); // @004c932c (virtual: BallisticWeaponCluster overrides)
protected: protected:
char *clusterImage; // @0xCC this[0x33] char *clusterImage; // @0xCC this[0x33]
GraphicGauge *rechargeArc; // @0xD0 this[0x34] SegmentArc270 GraphicGauge *rechargeArc; // @0xD0 this[0x34] SegmentArc270
@@ -535,6 +535,7 @@
~BallisticWeaponCluster(); // @004c9940 ~BallisticWeaponCluster(); // @004c9940
void BecameActive(); // @004c99cc void BecameActive(); // @004c99cc
void Execute(); // @004c9a38 void Execute(); // @004c9a38
void DrawWarningLamp(int on); // @004c9b50 (override: dot + ammo colour swap)
Logical TestInstance() const; // @004c9adc Logical TestInstance() const; // @004c9adc
protected: protected:
Logical jammed; // @0xE8 this[0x3A] Logical jammed; // @0xE8 this[0x3A]