vehicleSubSystems follow-up: reconstruct SegmentArc270 recharge dial
Reconstruct SegmentArc270 (@004c6244): engine SegmentArc base + a Scalar connection driving currentValue + the |n|/(|n|-1)*0.75 segment-span factor. Wire it into WeaponCluster as the recharge dial (was a deferred NULL), reading the weapon's real PercentDone attribute. Render-verified (BT_DEV_GAUGES_DOCK): the green segmented recharge circles draw in the weapon panels; 7 panels build, 0 crashes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f4ad0f4340
commit
fbf5118c9c
@@ -1124,10 +1124,12 @@ WeaponCluster::WeaponCluster(
|
||||
warningCenterY = 0x6d - (img->Data.Size.y >> 1);
|
||||
}
|
||||
|
||||
// rechargeArc (SegmentArc270 @004c6244, 0..360 recharge dial reading PercentDone).
|
||||
// BRING-UP: the SegmentArc270 ctor is a placeholder in btl4gaug.hpp (its real
|
||||
// @004c6244 body is not yet reconstructed); tracked NULL until it lands.
|
||||
rechargeArc = NULL; // @0x34
|
||||
// rechargeArc (SegmentArc270 @004c6244): the 0..360 recharge dial reading the
|
||||
// weapon's PercentDone attribute (a real 0..1 fraction).
|
||||
rechargeArc = (GraphicGauge *)new SegmentArc270((GaugeRate)0xffff, mfd_mode, // @004c6244
|
||||
renderer_in, owner_ID, mfd_port, x + 0x41, y + 0x6d, 40.0f, 60.0f, 40.0f,
|
||||
60.0f, 0.0f, 360.0f, 0x14, 0, 0xff, (Scalar *)percentDoneAttr, True,
|
||||
"SegmentArc270");
|
||||
|
||||
configMap = new ConfigMapGauge(ChildRate(), mfd_mode, renderer_in, // @004c6d80
|
||||
mfd_port, x + 0xee, y + 0x38, (Entity *)subsystem_in, "ConfigMap");
|
||||
|
||||
@@ -2143,4 +2143,31 @@ void
|
||||
SegmentArc::Execute(); // 0x474300 -- the base draw
|
||||
}
|
||||
|
||||
//
|
||||
// @004c6244 -- SegmentArc270 ctor (vtable 0x5189d0). Engine SegmentArc base + one
|
||||
// Scalar connection driving currentValue (a 0..1 fraction, e.g. a weapon's
|
||||
// PercentDone recharge) + the segment-span factor (|n|/(|n|-1) * 0.75, integer
|
||||
// division == 0.75 for n>=2). Inherits SegmentArc::Execute (draws the lit segments
|
||||
// up to currentValue). Used as the WeaponCluster recharge dial.
|
||||
//
|
||||
SegmentArc270::SegmentArc270(
|
||||
GaugeRate rate, ModeMask mode_mask, L4GaugeRenderer *renderer_in, int owner_ID,
|
||||
int graphics_port_number, int center_x, int center_y,
|
||||
Scalar inner0, Scalar outer0, Scalar inner1, Scalar outer1,
|
||||
Scalar deg0, Scalar deg1, int number_of_segs,
|
||||
int background_color, int foreground_color,
|
||||
Scalar *value_pointer, Logical use_thick_lines, const char *identification_string
|
||||
):
|
||||
SegmentArc(rate, mode_mask, renderer_in, owner_ID, graphics_port_number,
|
||||
center_x, center_y, inner0, outer0, inner1, outer1, deg0, deg1,
|
||||
number_of_segs, background_color, foreground_color, use_thick_lines,
|
||||
identification_string)
|
||||
{
|
||||
AddConnection(new GaugeConnectionDirectOf<Scalar>(0, ¤tValue, value_pointer));
|
||||
int n = (number_of_segs < 0) ? -number_of_segs : number_of_segs;
|
||||
segmentSpan = (Scalar)(n / (n - 1)) * 0.75f; // _DAT_004c62d4 = 0.75
|
||||
}
|
||||
|
||||
SegmentArc270::~SegmentArc270() {} // @004c66b3 (base chain)
|
||||
|
||||
// === btl4gau2.cpp begins at @004c6798 (SeekVoltage gauge) -- not part of this TU.
|
||||
|
||||
@@ -517,13 +517,20 @@
|
||||
// SegmentArcRatio @004c6394 Make @004c62fc (adds two connections)
|
||||
//#######################################################################
|
||||
class SegmentArc270 :
|
||||
public SegmentArc // MUNGA L4 base (FUN_004745e0; engine class SegmentArc)
|
||||
public SegmentArc // MUNGA L4 base (engine class SegmentArc)
|
||||
{
|
||||
public:
|
||||
SegmentArc270(/* ...arc geometry... */); // @004c6244
|
||||
SegmentArc270( // @004c6244
|
||||
GaugeRate, ModeMask, L4GaugeRenderer *, int owner_ID,
|
||||
int graphics_port_number, int center_x, int center_y,
|
||||
Scalar inner0, Scalar outer0, Scalar inner1, Scalar outer1,
|
||||
Scalar deg0, Scalar deg1, int number_of_segs,
|
||||
int background_color, int foreground_color,
|
||||
Scalar *value_pointer, Logical use_thick_lines,
|
||||
const char *identification_string);
|
||||
~SegmentArc270(); // dtor thunk @004c66b3
|
||||
protected:
|
||||
int segmentSpan; // @0xC0 this[0x30]
|
||||
Scalar segmentSpan; // @0xC0 this[0x30]
|
||||
};
|
||||
|
||||
class SegmentArcRatio :
|
||||
|
||||
Reference in New Issue
Block a user