BT410 Phase 5.3.26: THE COCKPIT GAUGE BLOCK -- the first rendered milestone

Six TUs born in one wave (4-agent re-hosting workflow from the BT411 donors
+ inline integration): BTL4GAUG (16 widget primitives + 5 connections, the
TU anchor @004c3f6c), BTL4GAU2 (13 composite panel clusters), BTL4GAU3
(PilotList/PlayerStatus/SectorDisplay/MessageBoard/mapping group), BTL4RDR
(the MapDisplay radar vs the authentic surviving header), BTL4GRND (the
real renderer: L4LampManager + L4Warehouse + BuildConfigurationFile with
the 19-entry BT registry chained onto the engine table).  btl4.lib grows
7 -> 11 members; all 50 game TUs compile; link clean.

VERIFIED LIVE: with L4GAUGE=640x480x16 the interpreter parses the full
authentic L4GAUGE.CFG, Bhk1Init runs, ColorMapperArmor binds the live
mech's damage zones by name (cross-chassis names take the authentic inert
path), and the complete mutual missile fight runs with the cockpit stack
updating from real combat -- 16/16 rounds, 138 zone hits, zero faults.
Gauges-off regressions untouched.

Engine bring-up deviation (documented): ParseAttribute normalizes
unpublished attribute names to a shared writable zero cell -- the 1995
GaugeConnectionDirectOf ctor hard-derefs its source (first boot crashed
there); widgets on unpublished names draw static zeros and light up
automatically as the attribute waves publish the 1995 CFG spellings the
bindings already carry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-24 19:02:04 -05:00
co-authored by Claude Fable 5
parent f11cc0247e
commit 64e208f121
10 changed files with 10474 additions and 11 deletions
File diff suppressed because it is too large Load Diff
+572
View File
@@ -0,0 +1,572 @@
//===========================================================================//
// File: btl4gau2.hpp //
// Project: BattleTech Brick: Gauge Renderer Manager //
// Contents: Cockpit instrument library, part 2 -- the COMPOSITE "panel" //
// gauges that the BattleTech engineering / weapon-status HUD is //
// assembled from. Where btl4gaug.cpp holds the primitive widgets //
// (bars, dials, lamps, colour-mappers), btl4gau2.cpp holds the //
// higher-level gauges that AGGREGATE those primitives into a single //
// subsystem read-out: //
// * SeekVoltageGraph -- energy-weapon seek-voltage curve //
// * ConfigMapGauge -- joystick / config-manager state lamp //
// * GeneratorCluster -- generator voltage + coolant + leak panel //
// * PrepEngrScreen -- per-weapon engineering screen builder //
// * SubsystemCluster +-> HeatSinkCluster //
// +-> MyomerCluster //
// +-> WeaponCluster +-> EnergyWeaponCluster //
// +-> BallisticWeaponClu.//
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/22/96 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
//
// STAGED RECONSTRUCTION. No BTL4GAU2.HPP survived; recovered from the shipped
// binary (BTL4OPT.EXE) and re-hosted onto the authentic 1995 engine headers
// (MUNGA GAUGE/GAUGREND + MUNGA_L4 L4GAUGE) for the BC++4.52 build.
//
// Translation-unit extent (BTL4.MAK link order:
// btl4mode -> btl4rdr -> btl4gaug -> btl4gau2 -> btl4gau3 -> btl4grnd -> ...):
// first gau2 code @004c6798 (SeekVoltageGraph::SeekVoltageGraph)
// last gau2 code @004c9b50 (BallisticWeaponCluster helpers)
// plus VehicleSubSystems::Make @004cbaf0
//
// Class names recovered from the CODE name-string pool around 0x519760
// (the gauge name list) and the per-instance identification strings:
// "GeneratorCluster" 0x519a8c "PrepEngr" 0x519a9d
// "ConfigMap" 0x519a38 "CoolingLoop" 0x519a42 "PowerSource" 0x519a4e
// "GeneratorVoltage(scalar)" 0x519a73 "GeneratorVoltage(slotOf)" 0x519a5a
// "EngrGraph" 0x519a2e "WeaponCluster ... " 0x519dcb
// Field offsets in comments are the BINARY's byte offsets (e.g. "@0x90" ==
// this[0x24]); the recompiled objects are NOT byte-locked to them.
//
// Names flagged "(best-effort)" exist in the binary but their identification
// string could not be tied to them unambiguously.
//
#if !defined(BTL4GAU2_HPP)
# define BTL4GAU2_HPP
# if !defined(SLOT_HPP)
# include <slot.hpp>
# endif
# if !defined(L4GREND_HPP)
# include <l4grend.hpp>
# endif
# if !defined(L4GAUGE_HPP)
# include <l4gauge.hpp>
# endif
# if !defined(BTL4GAUG_HPP)
# include <btl4gaug.hpp>
# endif
# if !defined(HEAT_HPP)
# include <heat.hpp>
# endif
// (see btl4gaug.hpp -- <powersub.hpp> intentionally not pulled in; the
// composite gauges reference subsystems by pointer/attribute, not by type.)
//
// Reconstruction type: the original referenced an "AttributeAccessor" handle
// (a small object that samples one named subsystem attribute). Only its
// address is used here (it is immediately reinterpreted as a Scalar*), so an
// opaque forward declaration is sufficient for this translation unit.
//
class AttributeAccessor;
//#######################################################################
// SeekVoltageGraph -- the energy-weapon / myomer "seek voltage" response
// graph on the engineering detail pages (the "POWER" box).
// @004c6798 ctor / @004c68ac dtor / @004c6920 BecameActive / @004c6934 Execute.
// vtable PTR_FUN_0051a1fc. Resolves the four SeekVoltage attribute
// POINTERS off the weapon subsystem by NAME ("CurrentSeekVoltageIndex" /
// "MinSeekVoltageIndex" / "MaxSeekVoltageIndex" / "SeekVoltage") and plots
// the subsystem's voltage-response curve (binary vtbl slot 15 sampler:
// Emitter @004bb42c / Myomers @004b8f94) over the top data box
// (0x97,0x80)-(0x17d,0x13b): x = response(v)*230 (0..1 normalised sqrt
// response), y = v/12000*187 (voltage axis), with per-gear tick marks (the
// current gear drawn as a full L) and, when draw_cursor, a live 8x8 XOR
// cursor at the subsystem's live voltage. When the subsystem is destroyed
// (simulationState == 1) it shows a centred "destroyed" bitmap instead.
// Its Execute's full-box CLEAR (@004c6be4) is what erases the sibling eng
// pages' stale pixels on the shared Eng bit-plane -- the widget IS the
// top-box eraser (Gitea #10 finding A).
//#######################################################################
class SeekVoltageGraph :
public GraphicGauge
{
public:
SeekVoltageGraph( // @004c6798
GaugeRate rate, ModeMask mode_mask, L4GaugeRenderer *renderer,
int graphics_port_number, Entity *subsystem,
AttributeAccessor *seek_voltage_pointer,
const char *destroyed_image, Logical draw_cursor,
const char *identification_string);
~SeekVoltageGraph(); // @004c68ac
Logical TestInstance() const;
void BecameActive(); // @004c6920
void Execute(); // @004c6934
protected:
void ClearGraph(); // @004c6be4 (full-box erase)
void DrawTicks(); // @004c6c6c (per-gear ticks, XOR)
void DrawCursorBox(); // @004c6c30 (8x8 cursor, XOR)
char *destroyedImage; // @0x90 this[0x24]
int *currentSeekIndexPtr; // @0x94 this[0x25] attr ptr (or NULL)
int *minSeekIndexPtr; // @0x98 this[0x26] attr ptr (or NULL)
int *maxSeekIndexPtr; // @0x9C this[0x27] attr ptr (or NULL)
Scalar *seekVoltageTablePtr; // @0xA0 this[0x28] attr ptr (array base)
Scalar *liveVoltage; // @0xA4 this[0x29] the ctor's
// seek_voltage_pointer ("OutputVoltage"
// attr ptr / cluster seekValue cache) --
// Execute derefs it for the live cursor
// (never NULL: ctor normalises a miss to
// the file-scope unbound cell)
Subsystem *subsystem; // @0xA8 this[0x2A]
Scalar previousVoltage; // @0xAC this[0x2B] cached response at
// 12000 V (9999 sentinel = force replot)
Scalar xScale; // @0xB0 this[0x2C] =230.0f
Scalar yScale; // @0xB4 this[0x2D] =187.0f
int destroyedShown; // @0xB8 this[0x2E]
Logical drawCursor; // @0xBC this[0x2F]
int cursorX; // @0xC0 this[0x30] (-1 = no cursor drawn)
int cursorY; // @0xC4 this[0x31]
int tickIndexShown; // @0xC8 this[0x32] gear index the tick
// highlight was last drawn at
};
//#######################################################################
// ConfigMapGauge -- the joystick / config-manager (control-mapper) state
// lamp. @004c6d80 ctor / @004c6e54 dtor / @004c6ee0 LinkToEntity /
// @004c6ef4 BecameActive / @004c6f1c Execute. vtable PTR_FUN_0051a1b8.
// Owns a base joystick bitmap ("btjoy.pcc") plus four config-state pixmaps
// (cm_off/cm_other/cm_only/cm_both .pcc) selected from a 4-entry table
// (DAT_00518eb8) driven by the control-mapper state. Named "ConfigMap".
//#######################################################################
class ConfigMapGauge :
public GraphicGauge
{
public:
ConfigMapGauge( // @004c6d80
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int x, int y, Entity *subsystem, const char *identification_string);
~ConfigMapGauge(); // @004c6e54
Logical TestInstance() const;
// @004c6ee0 -- the GaugeBase::LinkToEntity OVERRIDE (vtbl slot 9, +0x24),
// NOT a "SetColor": it stores the viewpoint entity into @0x94 and Execute
// gates on it. GaugeRenderer::LinkToEntity (GAUGREND.CPP:3011) broadcasts
// it to every gauge when the viewpoint binds -- THAT is what lights the
// trigger-config joystick in the shipped game. (The old "SetColor, no
// callers -> authentically dormant" claim was a mislabel.)
void LinkToEntity(Entity *entity); // @004c6ee0 writes this[0x25]
void BecameActive(); // @004c6ef4
void Execute(); // @004c6f1c
protected:
Entity *subsystem; // @0x90 this[0x24] (a Subsystem, stored
// as the ctor's Entity* -- cast back
// through Subsystem* before use)
Entity *linkedEntity; // @0x94 this[0x25] (Execute gate)
char *joystickImage; // @0x98 this[0x26] "btjoy.pcc"
char *stateImage[4]; // @0x9C this[0x27..0x2A]
int previousState[4]; // @0xAC this[0x2B..0x2E]
Logical dirty; // @0xBC this[0x2F]
};
//#######################################################################
// Two small OneOfSeveral subclasses that drive the selected frame from a
// subsystem value through a file-private GaugeConnection.
// AnimatedSubsystemLamp @004c70a4 (vtable 0051a174) -- connection @004c3134
// AnimatedSourceLamp @004c7160 (vtable 0051a130) -- connection @004c31ec
// Both chain OneOfSeveral::OneOfSeveral (@004c4d88, fromImageStrip=1) and
// share dtor FUN_004c4e7c. Used for the cooling-loop / power-source lamps.
// (Class names best-effort; the gauge is generic and reused with the
// instance strings "CoolingLoop" and "PowerSource".)
//
// SHADOW-FIELD FIX (kept on re-host): 'selected' is INHERITED from
// OneOfSeveral (@0xAC). A redeclared 'int selected;' here shadowed the
// base at a higher offset -- the connection wrote the shadow while
// OneOfSeveral::Execute read the base (always 0), freezing the lamp at
// frame 0. Neither class declares its own copy.
//#######################################################################
class AnimatedSubsystemLamp : // (best-effort)
public OneOfSeveral
{
public:
AnimatedSubsystemLamp( // @004c70a4
GaugeRate, ModeMask, L4GaugeRenderer *, int,
int x, int y, const char *image, int columns, int rows,
void *subsystem, const char *identification_string);
~AnimatedSubsystemLamp(); // @004c7134
};
class AnimatedSourceLamp : // (best-effort)
public OneOfSeveral
{
public:
AnimatedSourceLamp( // @004c7160
GaugeRate, ModeMask, L4GaugeRenderer *, int,
int x, int y, const char *image, int columns, int rows,
void *source, const char *identification_string);
~AnimatedSourceLamp(); // @004c71f0
};
//#######################################################################
// ScalarBarGauge -- a generator-voltage bar (derives from the engine
// BarGraphBitMapScalar, L4GAUGE.HPP -- WipeGaugeScalar : GraphicGauge).
// Two ctors, one vtable (0051a0e4), shared dtor @004c733c:
// @004c721c "slotOf" variant -- AddConnection(GeneratorVoltageConnection
// @004c3288) feeding the inherited currentValue from the
// subsystem's resolved voltage source.
// @004c72ac plain-Scalar variant -- a GaugeConnectionDirectOf<Scalar>
// (engine template) from a DIRECT Scalar*.
// Used with "GeneratorVoltage(slotOf)" / "GeneratorVoltage(scalar)".
//
// Its value slot @0xB4 (this[0x2D]) IS the inherited
// WipeGaugeScalar::currentValue -- the connection writes it, so NO own
// field is declared (declaring one would shadow / mis-align).
//
// BC++4.52 NOTE: the void* / Scalar* 15th-argument overload pair is
// ambiguous for a literal 0/NULL argument -- every call site must pass a
// TYPED pointer.
//#######################################################################
class ScalarBarGauge :
public BarGraphBitMapScalar
{
public:
ScalarBarGauge( // @004c721c (slotOf variant)
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int left, int bottom, int right, int top,
const char *tile_image, int foreground_color, int background_color,
WipeGaugeScalar::Direction direction, Scalar min, Scalar max,
void *voltage_source, const char *identification_string);
ScalarBarGauge( // @004c72ac (plain-Scalar variant)
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int left, int bottom, int right, int top,
const char *tile_image, int foreground_color, int background_color,
WipeGaugeScalar::Direction direction, Scalar min, Scalar max,
Scalar *value_source, const char *identification_string);
~ScalarBarGauge(); // @004c733c
};
//#######################################################################
// GeneratorCluster -- the generator read-out panel (config keyword
// "GeneratorCluster": engineering buttons 9-12, GeneratorA..D).
// @004c7368 Make / @004c746c ctor / @004c7778 dtor. vtable PTR_FUN_0051a0a0.
// A GraphicGauge that owns five child gauges, parented to its own port:
// VertTwoPartBar (temperature) this[0x26]
// ScalarBarGauge (voltage 0..12kV) this[0x27]
// BitMapInverseWipe/Leak (coolant leak) this[0x28]
// TwoState x2 (status lamps) this[0x29],this[0x2A]
// Make resolves the named generator via FindSubsystem; warns
// "Subsystem <name> not found".
//#######################################################################
class GeneratorCluster :
public GraphicGauge
{
public:
// Registered config primitive "GeneratorCluster" (15 params; NO leading
// rate token -- the panel rate is hard-wired 0xFFFF).
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c7368
GeneratorCluster( // @004c746c (BINARY param order)
ModeMask, L4GaugeRenderer *, int owner_ID, int graphics_port_number,
int x, int y, Subsystem *subsystem,
const char *background_image, int extra_color,
const char *temp_tile, int temp_bg_color, int temp_fill_color,
const char *voltage_tile, int voltage_fg_color,
const char *leak_image, int leak_color_b,
const char *lampA_image, const char *lampB_image,
int lamp_on_color, int lamp_off_color,
const char *identification_string);
~GeneratorCluster(); // @004c7778
// A container panel MUST override BecameActive + Execute: the engine
// base Gauge::Execute is Fail("not overridden") (GAUGE.CPP:598), and
// the default BecameActive self-inactivates. The panel draws its
// static background pixmap; the 5 self-registered child gauges draw
// the dynamic content.
void BecameActive();
void Execute();
protected:
char *backgroundImage; // @0x90 this[0x24] interned .pcc (AddRef'd)
int secondaryColor; // @0x94 this[0x25] = leak colorB (stored, unread)
GraphicGauge
*temperatureBar, // @0x98 this[0x26] VertTwoPartBar
*voltageBar, // @0x9C this[0x27] ScalarBarGauge (@004c72ac variant)
*leakGauge, // @0xA0 this[0x28] BitMapInverseWipe
*lampA, // @0xA4 this[0x29] TwoState
*lampB; // @0xA8 this[0x2A] TwoState
Subsystem *subsystem; // @0xAC this[0x2B]
int _reserved0xB0; // @0xB0 this[0x2C] (trailing pad -> binary sizeof 0xB4)
};
//#######################################################################
// PrepEngrScreen (config keyword "prepEngr") -- the per-engineering-screen
// STATIC LABEL overlay. @004c7b30 Make / @004c7bf0 ctor / @004c7d14 dtor /
// @004c7e48 BecameActive. vtable PTR_FUN_0051a06c.
//
// A GraphicGaugeBackground (paint-on-activation, NOT an Execute gauge --
// the same base/vtable shape as the engine's BackgroundBitmap: only the
// dtor + BecameActive slots are overridden). Interns 7 status .pcc's
// (font + 6 labels) and, when its MFD-Eng screen (1..12) activates, paints
// the labels for the ONE subsystem whose aux screen == this screen,
// dispatched by the subsystem's ClassID.
// (FIX kept from the decode: mech/screenNumber were SWAPPED in the first
// reconstruction, and the missing methodDescription parse-skipped all 12
// CFG lines.)
//#######################################################################
class PrepEngrScreen :
public GraphicGaugeBackground
{
public:
static MethodDescription methodDescription; // "prepEngr"
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c7b30
PrepEngrScreen( // @004c7bf0
ModeMask, L4GaugeRenderer *, unsigned int owner_ID,
int graphics_port_number, Entity *mech, int screen_number,
const char *img0/*font*/, const char *img1, const char *img2,
const char *img3, const char *img4, const char *img5,
const char *img6, const char *identification_string = "PrepEngr");
~PrepEngrScreen(); // @004c7d14
void BecameActive(); // @004c7e48 (the paint slot -- NOT Execute)
protected:
int screenNumber; // @0x6C this[0x1B]
Entity *mech; // @0x70 this[0x1C]
char *statusImage[7]; // @0x74 this[0x1D..0x23] (interned .pcc names)
// binary sizeof == 0x90 (Make alloc); no offset locks (every read is
// via named members).
};
//#######################################################################
// SubsystemCluster family -- the big composite panels. Each is a
// GraphicGauge that builds a dozen child gauges into one cockpit instrument.
//
// SubsystemCluster @004c8140 (vtable 0051a020) -- base "engineering"
// panel: HorizTwoPartBar + cooling/power loops + generator voltage +
// OneOfSeveralInt + OneOfSeveralStates + 2x VertTwoPartBar + LeakGauge
// + BackgroundBitmap. Uses the btXXloop / btXbus / evolt / btecmode /
// eleak art.
//
// HeatSinkCluster @004c8a6c (vtable 00519fd4) : SubsystemCluster
// adds 4 failure-annunciator TwoStates (btehfail/btepfail/btesfail)
// and a NumericDisplayScalar. Execute @004c8db0 scales heatLoad by
// 100 (_DAT_004c8df0) into the numeric read-out.
//
// MyomerCluster @004c8df4 (vtable 00519f88) : SubsystemCluster
// adds a SeekVoltageGraph ("EngrGraph") + seek-step OneOfSeveralInt.
//
// WeaponCluster @004c8fc4 (vtable 00519f38) : SubsystemCluster
// adds a SegmentArc270 (recharge dial, 0..360) + a ConfigMapGauge.
// Reads "PercentDone". Execute @004c9290 toggles the warning lamp
// past _DAT_004c92e0 (0.99).
//
// EnergyWeaponCluster @004c93b0 (vtable 00519ee8) : WeaponCluster
// adds a SeekVoltageGraph ("EngrGraph", edestryd.pcc) and a
// seek-step OneOfSeveralInt (bteseek.pcc).
// BallisticWeaponCluster @004c9558 (vtable 00519e98) : WeaponCluster
// adds 2x NumericDisplayInteger (ammo), jam/fire TwoStates
// (btejam/btefire), NumericDisplayScalarTwoState, an eject
// BitMapInverseWipeScalar (bteejtm), plus a GraphicsViewRecord
// erase tracker (this[0x3F]).
//#######################################################################
class SubsystemCluster :
public GraphicGauge
{
public:
// @004c8140. Binary param order (rate/mode are hardcoded 0xFFFF /
// ModeAlwaysActive in the base GraphicGauge ctor; the panel's two
// bit-plane MODE masks are mfd_mode (MFD-port children) and eng_mode
// (engineering-port children)).
SubsystemCluster( // @004c8140
ModeMask mfd_mode, L4GaugeRenderer *renderer, int owner_ID,
int mfd_port, int x, int y, Subsystem *subsystem, ModeMask eng_mode,
const char *eng_port_name, const char *tile_image,
const char *label, char **image_names,
const char *identification_string);
~SubsystemCluster(); // @004c87dc
Logical TestInstance() const;
void BecameActive(); // (re-host addition: forces the first repaint)
void Execute(); // @004c88e4
protected:
BackgroundBitmap
*background; // @0x90 this[0x24] BackgroundBitmap
GraphicGauge
*generatorVoltageBar, // @0x94 this[0x25] ScalarBarGauge (evolt)
*temperatureBar, // @0x98 this[0x26] HorizTwoPartBar
*coolingLoopA, // @0x9C this[0x27] AnimatedSubsystemLamp
*coolingLoopB, // @0xA0 this[0x28]
*powerSourceA, // @0xA4 this[0x29] AnimatedSourceLamp
*powerSourceB, // @0xA8 this[0x2A]
*vertBarA, // @0xAC this[0x2B] VertTwoPartBar
*vertBarB, // @0xB0 this[0x2C]
*modeLamp, // @0xB4 this[0x2D] OneOfSeveralInt
*stateLamp, // @0xB8 this[0x2E] OneOfSeveralStates
*leakGauge; // @0xBC this[0x2F] LeakGauge
Subsystem *subsystem; // @0xC0 this[0x30]
// POLARITY CORRECTED (PPC-dial fix, kept on re-host): the binary's
// *(subsystem+0x40)==1 means the subsystem FAILED -- it lights the
// destroyed-X TwoStates (the engine TwoState draws bright on NONZERO)
// and selects the dead-panel look (GetDrawState 1 = black fill). The
// old name `operating` had it backwards, inverting every consumer.
Logical failedState; // @0xC4 this[0x31] 1 = subsystem destroyed
int previousDrawState; // @0xC8 this[0x32] (Execute repaint key)
// internal helpers (non-virtual)
void DrawPanelFrame(int color); // @004c89c4
void ReleaseChildren(); // @004c8820
void SetChildrenEnable(int enable); // @004c8a28
public:
int GetDrawState(); // @004c8990 (operational-state virtual, vtbl+0x48)
};
class HeatSinkCluster : // @004c8a6c
public SubsystemCluster
{
public:
HeatSinkCluster( // @004c8a6c
ModeMask mfd_mode, L4GaugeRenderer *, int owner_ID, int mfd_port,
int x, int y, Subsystem *subsystem, Subsystem *hud, ModeMask eng_mode,
const char *eng_port_name, const char *tile_image, const char *label,
const char *fail_lamp_image, char **image_names,
const char *identification_string);
~HeatSinkCluster(); // @004c8d18
void Execute(); // @004c8db0
protected:
Subsystem *failSubsystem; // @0xCC this[0x33]
Logical failFlag; // @0xD0 this[0x34]
Scalar heatLoad; // @0xD4 this[0x35] (connection dst)
Scalar heatLoadScaled; // @0xD8 this[0x36]
GraphicGauge
*heatFailLamp, // @0xDC this[0x37] TwoState
*hsFailLamp, // @0xE0 this[0x38] TwoState (btehfail)
*powerFailLamp, // @0xE4 this[0x39] TwoState (btepfail)
*structFailLamp, // @0xE8 this[0x3A] TwoState (btesfail)
*heatNumeric; // @0xEC this[0x3B] NumericDisplayScalar
};
//
// MyomerCluster @004c8df4 (vtable 00519f88) : SubsystemCluster -- the myomer
// (muscle) panel. Adds a SeekVoltageGraph ("EngrGraph", edestryd.pcc) fed
// by a GeneratorVoltageConnection (writes seekValue) + a seek-step
// OneOfSeveralInt (bteseek.pcc). Execute = base.
//
class MyomerCluster : // @004c8df4
public SubsystemCluster
{
public:
MyomerCluster( // @004c8df4
ModeMask mfd_mode, L4GaugeRenderer *, int owner_ID, int mfd_port,
int x, int y, Subsystem *subsystem, ModeMask eng_mode,
const char *eng_port_name, const char *tile_image, const char *label,
char **image_names, const char *identification_string);
~MyomerCluster(); // @004c8f54
protected:
Scalar seekValue; // @0xCC this[0x33] (connection dst)
GraphicGauge
*seekGraph, // @0xD0 this[0x34] SeekVoltageGraph
*seekStepLamp; // @0xD4 this[0x35] OneOfSeveralInt
};
class WeaponCluster : // @004c8fc4
public SubsystemCluster
{
public:
WeaponCluster( // @004c8fc4
ModeMask mfd_mode, L4GaugeRenderer *, int owner_ID, int mfd_port,
int x, int y, Subsystem *subsystem, ModeMask eng_mode,
const char *eng_port_name, const char *tile_image, const char *label,
const char *cluster_image, char **image_names,
const char *identification_string);
~WeaponCluster(); // @004c91d4
void BecameActive(); // @004c9258
void Execute(); // @004c9290
virtual void DrawWarningLamp(int on); // @004c932c (virtual: BallisticWeaponCluster overrides)
protected:
char *clusterImage; // @0xCC this[0x33] (interned)
GraphicGauge *rechargeArc; // @0xD0 this[0x34] SegmentArc270
ConfigMapGauge *configMap; // @0xD4 this[0x35]
Scalar percentDone; // @0xD8 this[0x36] (connection dst)
int warningCenterX; // @0xDC this[0x37]
int warningCenterY; // @0xE0 this[0x38]
int warningState; // @0xE4 this[0x39]
};
class EnergyWeaponCluster : // @004c93b0
public WeaponCluster
{
public:
EnergyWeaponCluster( // @004c93b0
ModeMask mfd_mode, L4GaugeRenderer *, int owner_ID, int mfd_port,
int x, int y, Subsystem *subsystem, ModeMask eng_mode,
const char *eng_port_name, const char *tile_image, const char *label,
const char *cluster_image, char **image_names,
const char *identification_string);
~EnergyWeaponCluster(); // @004c94dc
protected:
SeekVoltageGraph *seekGraph; // @0xE8 this[0x3A]
GraphicGauge *seekStepLamp; // @0xEC this[0x3B] OneOfSeveralInt
};
class BallisticWeaponCluster : // @004c9558
public WeaponCluster
{
public:
BallisticWeaponCluster( // @004c9558
ModeMask mfd_mode, L4GaugeRenderer *, int owner_ID, int mfd_port,
int x, int y, Subsystem *subsystem, ModeMask eng_mode,
const char *eng_port_name, const char *tile_image, const char *label,
const char *cluster_image, char **image_names,
const char *font_a, const char *font_b,
const char *identification_string);
~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]
Logical firing; // @0xEC this[0x3B]
Logical reloading; // @0xF0 this[0x3C]
int reloadStartTime; // @0xF4 this[0x3D]
Scalar reloadSeconds; // @0xF8 this[0x3E]
GraphicsViewRecord
*ammoErase; // @0xFC this[0x3F] (bring-up NULL)
GraphicGauge
*ammoNumeric, // @0x100 this[0x40] NumericDisplayScalarTwoState
*destroyedLamp, // @0x104 this[0x41] TwoState
*jamLamp, // @0x108 this[0x42] TwoState (btejam)
*fireLamp, // @0x10C this[0x43] TwoState (btefire)
*ejectWipe, // @0x110 this[0x44] BitMapInverseWipeScalar (NULL)
*ammoCountA, // @0x114 this[0x45] NumericDisplayInteger
*ammoCountB; // @0x118 this[0x46] NumericDisplayInteger
};
//#######################################################################
// vehicleSubSystems -- the config primitive that builds the engineering-
// screen (MFD) subsystem cluster panels. Make @004cbaf0 (methodDescription
// @0x51c080, 8 typeString params = the 8 status strip bitmaps) is a per-
// subsystem factory: it walks the mech roster (skipping slot 0), and for
// each displayable subsystem builds the right cluster (HeatSink/Myomer/
// Energy/Ballistic) onto one of 12 auxiliary MFD positions. This holder
// just carries the registered MethodDescription + the static Make
// dispatcher (there is no instance).
//#######################################################################
class VehicleSubSystems
{
public:
static MethodDescription methodDescription;
static Logical Make( // @004cbaf0
int display_port_index, Vector2DOf<int> position,
Entity *entity, GaugeRenderer *gauge_renderer);
};
#endif
File diff suppressed because it is too large Load Diff
+439
View File
@@ -0,0 +1,439 @@
//===========================================================================//
// File: btl4gau3.hpp //
// Project: BattleTech Brick: Gauge Renderer Manager //
// Contents: Cockpit instrument library, part 3 -- the MULTIPLAYER / TACTICAL //
// HUD displays: the scoreboard, pilot roster, per-player status //
// name-tags, the sector display and the message board. These read //
// the shared "Players" roster and the live mech roster rather than //
// a single subsystem. //
// * PlayerStatusMappingGroup -- 28-zone armour colour-tint group //
// * SectorDisplay -- grid-cell blit + dual numeric //
// * TeamStatusDisplay -- 8-row scoreboard (DEFERRED) //
// * PilotList -- 8-pilot KILLS/DEATHS roster //
// * PlayerStatus -- single-player status name-tag //
// * MessageBoard -- message / sender bitmap board //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/22/96 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
//
// STAGED RECONSTRUCTION. No BTL4GAU3.HPP survived; recovered from
// BTL4OPT.EXE and re-hosted onto the authentic 1995 engine headers
// (MUNGA/GAUGE.HPP + GAUGREND.HPP, MUNGA_L4/L4GAUGE.HPP). Class names from
// the per-instance identification strings near 0x51bb34:
// "SectorDisplay" 0x51bb34 "PilotList" 0x51bb4a "PlayerStatus" 0x51bb54
// "MessageBoard" 0x51bb61 "PlayerStatusMappingGroup" 0x51bdb4
// "Players" 0x51bcba/0x51bd97 (shared roster node)
//
// Translation-unit extent (BTL4.MAK: btl4gau2 -> btl4gau3 -> btl4grnd):
// first gau3 code @004c9bd0 (PlayerStatusMappingGroup builder)
// last gau3 code @004cbea0-1 (MessageBoard::Execute @004cb82c)
// btl4grnd begins @004cbea0 (BTL4GaugeRenderer ctor -- not this TU)
//
// Vtables (recovered from the ctors): SectorDisplay 0051beec,
// TeamStatusDisplay 0051bea8, PilotList 0051be64, PlayerStatus 0051be20,
// MessageBoard 0051bddc. All derive from GraphicGauge.
//
// The @0xNN member annotations are the BINARY object offsets (provenance
// only): the reconstructed engine bases are not byte-identical to the
// shipped objects, and every read in this TU is through named members.
//
#if !defined(BTL4GAU3_HPP)
# define BTL4GAU3_HPP
# if !defined(SLOT_HPP)
# include <slot.hpp>
# endif
# if !defined(L4GREND_HPP)
# include <l4grend.hpp>
# endif
# if !defined(L4GAUGE_HPP)
# include <l4gauge.hpp>
# endif
# if !defined(BTL4GAUG_HPP)
# include <btl4gaug.hpp>
# endif
//##################### Forward Class Declarations #######################
class Player;
//
// Reconstruction alias: the binary's per-player recoloured "Pixmap" is the
// engine's 8-bit pixel map. (Only Pixmap* appears in this header / TU.)
//
typedef PixelMap8 Pixmap;
//#######################################################################
// PlayerStatusMappingGroup -- a colour-tint group of 28 ColorMapperArmor
// gauges, one per named damage zone ("dz_door"... PTR_s_dz_door_0051a240,
// 0x1C=28 entries). Built by PlayerStatus to tint a player's mech outline
// bitmap by per-zone armour damage. @004c9bd0 build / @004c9ca8 destroy /
// @004c9cf4 Execute-all / @004c9d18 SetColor-all. Each element is a
// ColorMapperArmor (btl4gaug) wired to a resolved damage-zone index.
// (palette files adpal.pcc / adpal2.pcc; name "PlayerStatusMappingGroup".)
//#######################################################################
enum { playerStatusZoneCount = 28 };
class PlayerStatusMappingGroup
{
public:
PlayerStatusMappingGroup( // @004c9bd0
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
Entity *mech,
int base_color_index,
const char *palette_a,
const char *palette_b,
const char *identification_string
);
~PlayerStatusMappingGroup(); // @004c9ca8
Logical
TestInstance() const;
void
Execute(); // @004c9cf4 (run all 28)
void
SetColor(int color); // @004c9d18 (recolour all 28)
protected:
ColorMapperArmor
*zone[playerStatusZoneCount]; // this[0..0x1B]
};
//#######################################################################
// SectorDisplay (config keyword "sectorDisplay") -- the radar SECTOR X/Z
// read-out on the Secondary overlay: a one-shot grid-cell background blit +
// two 3-digit NumericDisplays showing the linked mech's world sector coords
// (Round(-Z*0.01)+500, Round(X*0.01)+500 -> 100-unit sectors).
// @004c9d44 Make / @004c9e10 ctor / @004c9f94 dtor / @004ca038 BecameActive /
// @004ca068 LinkToEntity (slot 9) / @004ca07c Execute. vtable 0051beec.
// Was PROSE-ONLY (parse-skipped "sectorDisplay" line); reconstructed
// byte-verified from the disassembly + methodDescription PE-parse.
//#######################################################################
class SectorDisplay :
public GraphicGauge
{
public:
static MethodDescription
methodDescription; // "sectorDisplay"
static Logical
Make( // @004c9d44
int display_port_index,
Vector2DOf<int> position,
Entity *entity,
GaugeRenderer *gauge_renderer
);
SectorDisplay( // @004c9e10 (owner folded to 0, like the siblings)
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
int x, int y,
const char *image,
int color,
int ok_color,
const char *identification_string
);
~SectorDisplay(); // @004c9f94
Logical
TestInstance() const;
void
LinkToEntity(Entity *entity); // @004ca068 slot 9 -- caches the subject mech
void
BecameActive(); // @004ca038 slot 3 (non-inactivating)
void
Execute(); // @004ca07c
protected:
Entity *subject; // @0x90 LinkToEntity target (ctor=0)
char *gridImage; // @0x94 interned image name (nameCopy; blit source)
int cellWidth; // @0x98 imageWidth / 14
int gridLeft; // @0x9C cellWidth*12
int gridRight; // @0xA0 cellWidth*13 - 1
int gridHeight; // @0xA4 imageHeight
int numericColor; // @0xA8 param color (both numerics' color)
int gridColor; // @0xAC param okColor (blit color + numeric okColor)
int sectorBaseA; // @0xB0 = 500 (added to the -Z numeric)
int sectorBaseB; // @0xB4 = 500 (added to the +X numeric)
int dirty; // @0xB8 redraw flag (BecameActive=1, Execute clears)
NumericDisplay
*numericA, // @0xBC -Z sector readout
*numericB; // @0xC0 X sector readout
// Binary sizeof == 0xC4 (the Make alloc). Provenance only: the
// reconstructed GraphicGauge base is not byte-identical to 1995 and
// every read here is via named members.
};
//#######################################################################
// TeamStatusDisplay -- the 8-slot multiplayer scoreboard. @004ca208 ctor /
// @004ca39c dtor / @004ca424 SetEnable / @004ca438 BecameActive /
// @004ca478 Execute. vtable 0051bea8. Each of the 8 rows owns a
// NumericDisplay pair (player number + kill count). Execute reads the
// shared "Players" node (FindByName @00403ad0, "Players" 0x51bcba), slots
// players by their player index (entity+0x1cc), draws each player's name
// bitmap / kill numeric and a selection highlight on the local player.
//
// DEFERRED: the donor reconstruction is PROSE-ONLY (no recovered bodies,
// no methodDescription, no config keyword registered) -- declaration kept
// so the binary class inventory stays visible; NO bodies exist in
// BTL4GAU3.CPP and nothing constructs it. See the deferred note there.
//#######################################################################
class TeamStatusDisplay :
public GraphicGauge
{
public:
TeamStatusDisplay( // @004ca208
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
int x, int y,
const char *font_image,
int row_spacing,
int flags,
const char *identification_string
);
~TeamStatusDisplay(); // @004ca39c
Logical
TestInstance() const;
void
SetEnable(Logical enable); // @004ca424 this[0x24]
void
BecameActive(); // @004ca438
void
Execute(); // @004ca478
protected:
Logical enabled; // @0x90 this[0x24]
int selectedRow; // @0x94 this[0x25] (=999)
int originX; // @0x98 this[0x26]
int originY; // @0x9C this[0x27] (param y - 0x20)
int flags; // @0xA0 this[0x28]
int rowSpacing; // @0xA4 this[0x29]
int highlightWidth; // @0xA8 this[0x2A]
struct Row { // 8 rows starting at this[0x3B]
NumericDisplay *numberDisplay; // player-number numeric
NumericDisplay *killDisplay; // kill-count numeric (flags&4)
} row[8];
};
//#######################################################################
// PilotList (config keyword "pilotList") -- the Comm KILLS/DEATHS roster.
// @004ca90c Make / @004ca958 ctor / @004cab10 dtor / @004caba4 BecameActive /
// @004cabd0 Execute / @004cad70 DrawMechIcon. vtable 0051be64, binary
// sizeof 0x178. Each entry has three NumericDisplays laid out by a
// per-entry layout mode (0/1/2 -> the PE-parsed DAT_0051af88 table).
// Execute walks the pilot roster ONE slot per frame (round-robin over 8).
// Was PROSE-ONLY -> the "pilotList" line was parse-skipped and the Comm
// surface showed only the baked btcomm.pcx labels.
//#######################################################################
class PilotList :
public GraphicGauge
{
public:
static MethodDescription
methodDescription; // "pilotList"
static Logical
Make( // @004ca90c
int display_port_index,
Vector2DOf<int> position,
Entity *entity,
GaugeRenderer *gauge_renderer
);
PilotList( // @004ca958 (NO x,y: positions come from DAT_0051af88)
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
const char *font_image,
const char *identification_string
);
~PilotList(); // @004cab10
Logical
TestInstance() const;
void
BecameActive(); // @004caba4
void
Execute(); // @004cabd0
protected:
void
DrawMechIcon(Player *pilot, int selected); // @004cad70
// (DrawAmmoCount @004cae20 -- documented, no recovered caller.)
int currentSlot; // @0x90 this[0x24] (round-robin, =9 init)
Logical built; // @0x94 this[0x25]
struct Entry { // 8 entries (stride 0x1C) from this[0x26]
int x; // +0x00
int y; // +0x04
int resolvedMech; // +0x08 (=-1 after BecameActive)
int selected; // +0x0C
NumericDisplay *nameDisplay; // +0x10 KILLS numeric
NumericDisplay *mechDisplay; // +0x14 DEATHS numeric
NumericDisplay *scoreDisplay; // +0x18 erase-only
} entry[8];
};
//#######################################################################
// PlayerStatus (config keyword "PlayerStatus") -- a single-player status
// name-tag. @004cae90 Make / @004cb1a8 ctor / @004cb28c dtor / @004cb310
// BecameActive / @004cb358 Execute. vtable 0051be20, 200-byte alloc.
// Make validates the player number (must be 1..8; warns "PlayerStatus:
// Make player number <n>"). Execute resolves player N from the shared
// "Players" roster ("Players" 0x51bd97), recolours its mech-outline bitmap
// per player palette via CreateMutantPixelmap8 (@004cafac, file-private) +
// PlayerStatusMappingGroup (adpal.pcc/adpal2.pcc), and shows the player
// score + an alive/dead colour state.
//#######################################################################
class PlayerStatus :
public GraphicGauge
{
public:
static MethodDescription
methodDescription; // "PlayerStatus"
static Logical
Make( // @004cae90
int display_port_index,
Vector2DOf<int> position,
Entity *entity,
GaugeRenderer *gauge_renderer
);
PlayerStatus( // @004cb1a8 (13 args; owner folded to 0 in base call)
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
int x, int y,
int player_number,
const char *font_image,
int color,
int okColor,
int aliveColor,
int deadColor,
const char *identification_string
);
~PlayerStatus(); // @004cb28c
Logical
TestInstance() const;
void
BecameActive(); // @004cb310
void
Execute(); // @004cb358
protected:
int port; // @0x90 this[0x24] graphics_port_number
int playerIndex; // @0x94 this[0x25] (player_number-1)
Player *player; // @0x98 this[0x26] cached roster player (non-owned)
BitMap *nameImage; // @0x9C this[0x27] name-cache BitMap (cache-owned)
Pixmap *recoloredMech; // @0xA0 this[0x28] CreateMutantPixelmap8 result (owned)
int color; // @0xA4 this[0x29]
int okColor; // @0xA8 this[0x2A]
int aliveColor; // @0xAC this[0x2B]
int deadColor; // @0xB0 this[0x2C]
PlayerStatusMappingGroup
*mappingGroup; // @0xB4 this[0x2D] (owned; the binary LEAKED it)
NumericDisplay
*scoreDisplay; // @0xB8 this[0x2E]
int dirty; // @0xBC this[0x2F] redraw flag
int previousStatus; // @0xC0 this[0x30] last alive/dead state
int previousMappingState; // @0xC4 this[0x31]
};
//#######################################################################
// MessageBoard (config keyword "messageBoard") -- the secondary-MFD comm/
// status message ticker. @004cb678 Make / @004cb704 ctor / @004cb788 dtor /
// @004cb7fc BecameActive / @004cb818 SetSource / @004cb82c Execute.
// vtable 0051bddc, binary sizeof 0xA4 (the Make alloc). Blits one cell of
// the strip bitmap btsmsgs.pcx (message id -> cell (id&3)<<7, (id>>2)<<5)
// plus the sender's name bitmap. Was PROSE-ONLY -> "messageBoard" was
// parse-skipped.
//
// DEFERRED / EMPTY (authentic for bring-up): the source mech is never
// bound (SetSource @004cb818 has no recovered caller) AND the per-player
// status-message feed (Player::statusMessagePointer's producer pool) is
// not reconstructed, so there are no messages -> Execute early-returns on
// the NULL source (a safe no-op == the empty board).
//
// Field-order FIXes on record: trackedMech@0x90 (was decoded "int
// enabled"); previousNameId@0x9C=-1 / previousMessageId@0xA0=-2 (were
// swapped in the first decode).
//#######################################################################
class MessageBoard :
public GraphicGauge
{
public:
static MethodDescription
methodDescription; // "messageBoard"
static Logical
Make( // @004cb678
int display_port_index,
Vector2DOf<int> position,
Entity *entity,
GaugeRenderer *gauge_renderer
);
MessageBoard( // @004cb704
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
int x, int y,
const char *strip_image,
int color,
const char *identification_string
);
~MessageBoard(); // @004cb788
Logical
TestInstance() const;
void
BecameActive(); // @004cb7fc
void
SetSource(Entity *mech); // @004cb818 (binds trackedMech; no caller -> deferred)
void
Execute(); // @004cb82c
protected:
Entity *trackedMech; // @0x90 this[0x24] source mech (SetSource; ctor=0)
char *stripImage; // @0x94 this[0x25] interned btsmsgs.pcx (held ref)
int color; // @0x98 this[0x26] param (CFG 4th arg = 0)
int previousNameId; // @0x9C this[0x27] BecameActive=-1
int previousMessageId; // @0xA0 this[0x28] BecameActive=-2
};
// NOTE: CreateMutantPixelmap8 (@004cafac) + ReadStreamString (@004caf50)
// are file-PRIVATE in the binary -- declared static at the top of
// BTL4GAU3.CPP, not here.
#endif
File diff suppressed because it is too large Load Diff
+601
View File
@@ -0,0 +1,601 @@
//===========================================================================//
// File: btl4gaug.hpp //
// Project: BattleTech Brick: Gauge Renderer Manager //
// Contents: The cockpit instrument gauge library -- the family of small //
// "widget" gauges that the BattleTech HUD is assembled from: //
// * ColorMapper* -- palette-animating tint gauges driven by //
// subsystem state (heat / armour / crit) //
// * Horiz/VertTwoPartBar, VertNormalSlider //
// -- two-colour fill bars (throttle / damage) //
// * OneOfSeveral* -- multi-frame bitmap selectors (state lamp) //
// * HeadingPointer -- rotating numeric heading readout //
// * SegmentArc270/Ratio-- arc / dial style gauges //
// * BitMap wipe gauges -- bitmap "fuel / leak" wipe indicators //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/22/96 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
//
// STAGED RECONSTRUCTION. No BTL4GAUG.HPP survived (the BT_L4 source tree
// retains only BTL4RDR.HPP and BTL4GALM.HPP). This declaration is recovered
// from the shipped binary (BTL4OPT.EXE) and re-hosted onto the authentic 1995
// engine headers (MUNGA GAUGE/GAUGREND + MUNGA_L4 L4GAUGE) for the BC++4.52
// DOS build. The module is the .obj that links immediately after btl4rdr.obj
// and before btl4gau2.obj (BTL4.MAK), so it owns the contiguous code run
// [ @004c2f94 .. @004c6771 ] (btl4gau2.cpp begins at @004c6798).
//
// The sole address with a surviving embedded assert path -- the anchor --
// is ColorMapperHeat's constructor:
// @004c3f6c "d:\tesla\bt\bt_l4\BTL4GAUG.CPP", line 0x68a
//
// Class names are recovered verbatim from the CODE name-string pool
// (section_dump.txt @0x518480..0x51859e):
// ColorMapper ColorMapperArmor ColorMapperMultiArmor ColorMapperCritical
// ColorMapperHeat HorizTwoPartBar VertTwoPartBar VertNormalSlider
// OneOfSeveral OneOfSeveralInt OneOfSeveralPixInt OneOfSeveralStates
// HeadingPointer BitMapInverseWipe BitMapInverseWipeScalar
// SegmentArc270 SegmentArcRatio
//
// Field offsets in comments are the byte offsets observed in the decompiled
// object (e.g. "@0x90" == this[0x24]). The two base gauges are the MUNGA
// gauge primitives (GAUGE.HPP):
// Gauge ctor FUN_00444308 dtor FUN_00444360 -- non-graphic;
// used by the ColorMapper family (they tint a palette, they
// do not own a GraphicsView).
// GraphicGauge ctor FUN_00444818 dtor FUN_00444870 -- owns the embedded
// GraphicsView localView at +0x48 (this[0x12]); used by every
// drawing gauge. (Same base as MapDisplay in btl4rdr.cpp.)
//
// The file-private GaugeConnection feeds (HeatConnection, ArmorZoneConnection,
// MultiArmorConnection, CriticalConnection, StateConnection) live in
// BTL4GAUG.CPP only.
//
// Names flagged "(name unconfirmed)" are best-effort: the class exists in the
// binary but its identification string could not be tied to it unambiguously.
//
#if !defined(BTL4GAUG_HPP)
# define BTL4GAUG_HPP
# if !defined(SLOT_HPP)
# include <slot.hpp>
# endif
# if !defined(L4GREND_HPP)
# include <l4grend.hpp>
# endif
# if !defined(L4GAUGE_HPP)
# include <l4gauge.hpp>
# endif
//##################### Forward Class Declarations #######################
class Entity;
class Subsystem;
//#######################################################################
//#######################################################################
// ColorMapper family
//
// A ColorMapper is NOT a drawing gauge: every frame it reads a single
// subsystem-derived value (0..255), looks the corresponding R/G/B
// triple out of a named palette resource, and -- if it has changed --
// writes it straight into one hardware palette slot (colorIndex). The
// cockpit art that uses that slot therefore changes colour live. With
// two palette names it alternates between them every frame to flash.
//
// The driving value arrives through a small file-private GaugeConnection
// (see btl4gaug.cpp) wired to currentColorIndex. ColorMapperHeat's
// connection reads the heat subsystem's live temperature.
//#######################################################################
//#######################################################################
class ColorMapper :
public Gauge
{
public:
ColorMapper( // @004c37dc vtable PTR_FUN_00518e10
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
int graphics_port_number,
int color_index,
const char *palette_name_a,
const char *palette_name_b,
const char *identification_string
);
~ColorMapper(); // @004c38dc
void BecameActive(); // @004c395c
void Execute(); // @004c3980 -- palette push
protected:
char *paletteName[2]; // @0x48,@0x4C this[0x12],[0x13]
Logical twoColorMode; // @0x50 this[0x14] (names differ)
int currentColorIndex; // @0x54 this[0x15] (connection dst)
int previousColorIndex; // @0x58 this[0x16]
int colorSlot; // @0x5C this[0x17] hw palette slot
int paletteToggle; // @0x60 this[0x18] 0/1 flash phase
unsigned char
previousRed, // @0x64 this[0x19].b0
previousGreen, // @0x65
previousBlue; // @0x66
GraphicsPort
*graphicsPort; // @0x68 this[0x1A] (renderer port)
};
//
// ColorMapperArmor -- tints by the damage ratio of one named damage zone.
// Connection: @004c33a4 (reads the entity's damageZones[index]).
//
class ColorMapperArmor :
public ColorMapper
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as "cmArmor".
static MethodDescription methodDescription;
static Logical Make( // @004c3aa4
int display_port_index, Vector2DOf<int> position,
Entity *entity, GaugeRenderer *gauge_renderer);
ColorMapperArmor( // @004c3b98
GaugeRate rate, ModeMask mode_mask, L4GaugeRenderer *renderer,
int graphics_port_number, int color_index,
Entity *entity, const char *palette_a, const char *palette_b,
int damage_zone_index, const char *identification_string);
~ColorMapperArmor();
// @004c3c38 -- store the group state into @0x6C (used by btl4gau3's
// PlayerStatusMappingGroup to push the mech's disabled/enabled state
// onto all 28 zone tints).
void SetColor(int state) { unused = state; }
protected:
int unused; // @0x6C this[0x1B] (state slot; SetColor writes it)
};
//
// ColorMapperMultiArmor -- worst-of-N damage zones.
// Connection: @004c346c (copies 8 zone indices, takes the max ratio).
//
class ColorMapperMultiArmor :
public ColorMapper
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as
// "colorMapperMultiArmor".
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c3c48
ColorMapperMultiArmor( // @004c3d60
GaugeRate, ModeMask, L4GaugeRenderer *, int, int,
Entity *, const char *, const char *,
const int *zone_indices /*[8]*/, const char *);
~ColorMapperMultiArmor();
};
//
// ColorMapperCritical -- tints by a subsystem's operational state.
// Connection: @004c3598 (subsystem destroyed -> 100, else zone damage).
//
class ColorMapperCritical :
public ColorMapper
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as "cmCrit".
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c3ddc
ColorMapperCritical( // @004c3e40
GaugeRate, ModeMask, L4GaugeRenderer *, int, int,
Entity *, const char *, const char *,
const char *subsystem_name, const char *);
~ColorMapperCritical();
};
//
// ColorMapperHeat -- the cockpit heat tint. ANCHOR @004c3f6c.
// Connection: @004c3664 (reads the heat subsystem's currentTemperature
// as a 0..100 percentage). The named subsystem must derive from a heat
// class (IsDerivedFrom HeatableSubsystem 0x50e3ec or HeatWatcher 0x50e604)
// or the ctor asserts (line 0x68a).
//
class ColorMapperHeat :
public ColorMapper
{
public:
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c3f08
ColorMapperHeat( // @004c3f6c
GaugeRate, ModeMask, L4GaugeRenderer *, int, int,
Entity *, const char *, const char *,
const char *heat_subsystem_name, const char *);
~ColorMapperHeat();
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) so the config
// interpreter builds this gauge from the CFG "cmHeat" primitive.
static MethodDescription methodDescription;
};
//#######################################################################
//#######################################################################
// Two-part fill bars (: GraphicGauge)
//
// A bar is split into a "filled" colour and a "background" colour at a
// pixel computed from a Scalar input. HorizTwoPartBar grows
// left->right, VertTwoPartBar grows bottom->top. Both blit a tile
// bitmap behind the fill (DrawTiledBitmap @004c2ff8, file-private).
//#######################################################################
//#######################################################################
//
// HorizTwoPartBar has NO config keyword: it is built directly by the
// btl4gau2 SubsystemCluster family. (A Make body exists in the binary at
// @004c407c but no methodDescription for it appears in the registered
// BTL4MethodDescription table; its parameter list is unrecovered, so the
// factory is intentionally NOT declared here -- clusters call the ctor.)
//
class HorizTwoPartBar :
public GraphicGauge
{
public:
HorizTwoPartBar( // @004c4170 vtable PTR_FUN_00518cbc
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int left, int bottom, int right, int top,
const char *tile_image,
int fill_color, int background_color,
Scalar *value_pointer, Scalar *low_pointer, Scalar *high_pointer,
const char *identification_string);
~HorizTwoPartBar();
Logical TestInstance() const;
void BecameActive(); // @004c4324
void Execute(); // @004c4340
protected:
Scalar value; // @0x90 this[0x24] (connection)
Scalar low; // @0x94 this[0x25]
Scalar high; // @0x98 this[0x26]
char *tileImage; // @0x9C this[0x27]
int fillColor; // @0xA0 this[0x28]
int backgroundColor; // @0xA4 this[0x29]
int width; // @0xA8 this[0x2A] right-left
int height; // @0xAC this[0x2B] (top-bottom)-1
int previousFill; // @0xB0 this[0x2C]
int previousFull; // @0xB4 this[0x2D]
};
class VertTwoPartBar :
public GraphicGauge
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as "vertBar".
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c462c
VertTwoPartBar( // @004c4724 (ctor arg order = binary param_12..17)
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int left, int bottom, int right, int top,
const char *tile_image,
int background_color, int fill_color, int extra_color,
Scalar *value_pointer, Scalar *low_pointer, Scalar *high_pointer,
const char *identification_string);
~VertTwoPartBar(); // @004c486c
Logical TestInstance() const;
void BecameActive(); // @004c48e0
void Execute(); // @004c48fc
protected:
char *tileImage; // @0x90 this[0x24]
int backgroundColor; // @0x94 this[0x25]
int fillColor; // @0x98 this[0x26]
int extraColor; // @0x9C this[0x27]
int width; // @0xA0 this[0x28] (right-left)-1
int height; // @0xA4 this[0x29] top-bottom
int previousFill; // @0xA8 this[0x2A]
int previousFull; // @0xAC this[0x2B]
Scalar value; // @0xB0 this[0x2C] (connection)
Scalar low; // @0xB4 this[0x2D]
Scalar high; // @0xB8 this[0x2E]
};
//
// VertNormalSlider -- a single-colour rectangle whose height tracks a
// normalised [0,1] value (clamped at @004c4cc0). (name unconfirmed but
// matches the "VertNormalSlider" pool entry and the vtable ordering.)
//
class VertNormalSlider :
public GraphicGauge
{
public:
// The "vertNormalSlider" config factory (the condenser VALVE slider
// @2 in GenericHeatGauges1/2). Registered in BTL4MethodDescription[]
// (btl4grnd.cpp).
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c4b08
VertNormalSlider( // @004c4b84 vtable PTR_FUN_00518c34
GaugeRate, ModeMask, L4GaugeRenderer *, int,
int left, int bottom, int right, int top,
int fill_color, int background_color, int baseline,
Scalar *value_pointer, const char *identification_string);
~VertNormalSlider(); // @004c4c68
Logical TestInstance() const; // @004c4c94 -> GraphicGauge::TestInstance
void BecameActive(); // @004c4cac
void Execute(); // @004c4cc0 -> Draw @004c4d48
private:
void Draw(); // @004c4d48 (XOR indicator blit; non-virtual)
protected:
// Byte-exact layout (from the ctor's this[N] stores @004c4b84).
// 8 words, 0x90..0xAF, sizeof == 0xB0.
int previousFill; // @0x90 this[0x24] XOR indicator row; -1 = none
int width; // @0x94 this[0x25] (right-left)-1
int height; // @0x98 this[0x26] top-bottom (track height)
int baseline; // @0x9C this[0x27] indicator thickness
int span; // @0xA0 this[0x28] height-baseline (travel)
int fillColor; // @0xA4 this[0x29] indicator colour
int backgroundColor; // @0xA8 this[0x2A] stored, unused by Draw
Scalar value; // @0xAC this[0x2B] connection dst [0,1]
};
//#######################################################################
//#######################################################################
// OneOfSeveral family -- multi-frame bitmap selectors
//
// A strip bitmap holds N frames; the gauge blits whichever frame the
// driving value selects. The base (OneOfSeveral) stores the strip and
// the per-frame size; subclasses add the value source.
//#######################################################################
//#######################################################################
class OneOfSeveral :
public GraphicGauge
{
public:
OneOfSeveral( // @004c4d88 vtable PTR_FUN_00518bf0
GaugeRate, ModeMask, L4GaugeRenderer *, int,
int x, int y, Logical from_image_strip,
const char *image_name,
int background_color, int foreground_color,
int columns, int rows,
const char *identification_string);
~OneOfSeveral(); // @004c4e7c
Logical TestInstance() const;
void BecameActive(); // @004c4f14
void Execute(); // @004c4f28
protected:
Logical fromImageStrip; // @0x90 this[0x24]
char *imageName; // @0x94 this[0x25]
int backgroundColor; // @0x98 this[0x26]
int foregroundColor; // @0x9C this[0x27] (DrawBitMapOpaque bg arg)
int columns; // @0xA0 this[0x28]
int frameWidth; // @0xA4 this[0x29]
int frameHeight; // @0xA8 this[0x2A]
int selected; // @0xAC this[0x2B] (connection)
int previousSelected; // @0xB0 this[0x2C]
};
//
// OneOfSeveralInt -- frame = a direct int input. ctor @004c5148, dtor
// @004c51d8, vtable PTR_FUN_00518bac. No config keyword: built directly
// by the btl4gau2 clusters (a binary Make exists @004c5068 but no
// registered methodDescription; its parameter list is unrecovered, so no
// factory is declared -- clusters call the ctor).
//
class OneOfSeveralInt :
public OneOfSeveral
{
public:
OneOfSeveralInt(GaugeRate, ModeMask, L4GaugeRenderer *, int,
int x, int y, const char *image, int columns, int rows,
int *value_pointer, const char *);
~OneOfSeveralInt(); // @004c51d8
};
//
// OneOfSeveralPixInt -- frame from a packed-pixel int strip.
// @004c52d8 Make @004c5204 vtable PTR_FUN_00518b68
//
class OneOfSeveralPixInt :
public OneOfSeveral
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as
// "oneOfSeveralPixInt".
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c5204
OneOfSeveralPixInt( // @004c52d8
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int x, int y, const char *image, int columns, int rows,
int *value_pointer, const char *identification_string);
~OneOfSeveralPixInt(); // @004c5364
};
//
// OneOfSeveralStates -- frame from a subsystem state value (clamped >=0).
// ctor @004c5470, dtor @004c5500, vtable PTR_FUN_00518b24.
// Connection: @004c3324 (reads the Subsystem simulation state -- the
// binary's raw "state word @0x14" is Simulation::GetSimulationState()).
// No config keyword (cluster-built; binary Make @004c5390 unregistered,
// not declared -- see OneOfSeveralInt).
//
// RE-HOST NOTE: the source argument is typed Subsystem* here (the donor
// reconstruction typed it Entity* and read a raw +0x14); btl4gau2 call
// sites pass the subsystem.
//
class OneOfSeveralStates :
public OneOfSeveral
{
public:
OneOfSeveralStates(GaugeRate, ModeMask, L4GaugeRenderer *, int,
int x, int y, const char *image, int columns, int rows,
Subsystem *subsystem_source, const char *);
~OneOfSeveralStates(); // @004c5500
void BecameActive(); // @004c552c
};
//#######################################################################
// HeadingPointer -- a rotating numeric compass-heading readout.
// @004c562c Make @004c554c Execute @004c5914 (rotate by mech yaw,
// degrees = radian * 57.29578). Owns a NumericDisplay (@0xBC,
// FUN_004700bc) and a GraphicsViewRecord (@0xA4) for erase tracking.
//#######################################################################
class HeadingPointer :
public GraphicGauge
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as
// "headingPointer".
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c554c
//
// The binary ctor (@004c562c) takes 14 args. Fields @0x98/@0x9C are
// the needle's inner/outer RADIUS (Execute multiplies them by sin/cos
// of the heading).
//
HeadingPointer( // @004c562c vtable PTR_FUN_00518ae0
GaugeRate, ModeMask, L4GaugeRenderer *,
unsigned int owner_ID,
int graphics_port_number,
int x, int y,
int needle_color, // -> @0x90 the drawn needle colour
int numeric_color, // -> NumericDisplay foreground (readout)
int erase_color, // -> @0x94 erase + NumericDisplay background
int inner_radius, // -> @0x98 needle near-end radius
int outer_radius, // -> @0x9C needle tip radius (the change key)
const char *font_name,
const char *identification_string = "HeadingPointer");
~HeadingPointer(); // @004c573c
Logical TestInstance() const;
void ShowInstance(char *indent); // @004c57d0
void BecameActive(); // @004c58e8
void Execute(); // @004c5914
protected:
int needleColor; // @0x90 needle (fg) colour
int eraseColor; // @0x94 erase (bg) colour
int innerRadius; // @0x98 needle near-end radius
int outerRadius; // @0x9C needle tip radius (change key)
char *imageName; // @0xA0 interned font name
GraphicsViewRecord
previousDrawing; // @0xA4 erase-tracking record
int previousX; // @0xB4
int previousY; // @0xB8
NumericDisplay
*numericDisplay; // @0xBC
};
//#######################################################################
// BitMap "wipe" gauges -- a fuel/leak style bar that reveals a bitmap up
// to a level. (names "BitMapInverseWipe" / "BitMapInverseWipeScalar" are
// best-effort from the pool; the Scalar variant adds a GaugeConnection.)
// BitMapInverseWipe @004c5b7c (the coolant LeakGauge; also used
// as a base by btl4gau2)
// <wipe base> @004c5e84 NOT RECONSTRUCTED (notes only)
// <wipe base>Scalar @004c61c8 NOT RECONSTRUCTED (notes only;
// needed by btl4gau2 BallisticWeaponCluster's
// ejectWipe -- still an open bring-up NULL)
//#######################################################################
class BitMapInverseWipe : // (name unconfirmed)
public GraphicGauge
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as
// "LeakGauge" -- the coolant-leak inverse-wipe factory.
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *);
BitMapInverseWipe( // @004c5b7c vtable PTR_FUN_00518a9c
GaugeRate, ModeMask, L4GaugeRenderer *, int,
int x, int y, const char *image,
int color_a, int color_b, int third, int frames,
Scalar *value_pointer, const char *);
~BitMapInverseWipe(); // @004c5c80
Logical TestInstance() const;
void BecameActive(); // @004c5cf4
void Execute(); // @004c5d08
protected:
char *imageName; // @0x90 this[0x24]
int colorA; // @0x94 this[0x25]
int colorB; // @0x98 this[0x26]
int fullWidth; // @0x9C this[0x27] frames*2
int frames; // @0xA0 this[0x28]
int frameHeight; // @0xA4 this[0x29]
int frameWidth; // @0xA8 this[0x2A] width/3
int previousLevel; // @0xAC this[0x2B]
int third; // @0xB0 this[0x2C]
Scalar value; // @0xB4 this[0x2D] (connection)
};
//#######################################################################
// SegmentArc gauges -- needle / dial over a 270-degree arc. Derived
// from the MUNGA L4 arc primitive (engine SegmentArc, L4GAUGE.HPP:1086;
// ctor FUN_00473f44, Execute @00474300).
// SegmentArc270 @004c6244 (the WeaponCluster recharge dial;
// cluster-built, no config keyword)
// SegmentArcRatio @004c62fc Make / @004c6394 ctor (the speed arc)
//#######################################################################
class SegmentArc270 :
public SegmentArc // MUNGA L4 base (engine class SegmentArc)
{
public:
SegmentArc270( // @004c6244 vtable PTR_FUN_005189d0
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
// No Execute override: inherits the engine SegmentArc::Execute
// (@00474300), which draws the lit segments up to currentValue.
protected:
Scalar segmentSpan; // @0xC0 this[0x30]
};
class SegmentArcRatio :
public SegmentArc // MUNGA L4 base (engine SegmentArc)
{
public:
// Registered in BTL4MethodDescription[] (btl4grnd.cpp) as
// "segmentArcRatio".
static MethodDescription methodDescription;
static Logical Make(int, Vector2DOf<int>, Entity *, GaugeRenderer *); // @004c62fc
SegmentArcRatio( // @004c6394 vtable PTR_FUN_0051898c
GaugeRate, ModeMask, L4GaugeRenderer *, int graphics_port_number,
int center_x, int center_y,
Scalar inner, Scalar outer, Scalar deg0, Scalar deg1,
int number_of_segs, int background_color, int foreground_color,
Scalar *numerator_pointer, Scalar *denominator_pointer,
const char *identification_string);
~SegmentArcRatio(); // dtor thunk @004c668d
void Execute(); // @004c6488 (ratio -> currentValue -> SegmentArc::Execute)
protected:
Scalar numerator; // @0xC0 this[0x30] (connection)
Scalar denominator; // @0xC4 this[0x31] (connection)
Scalar segmentSpan; // @0xC8 this[0x32] (read by Execute)
};
#endif
+189 -8
View File
@@ -1,12 +1,18 @@
//===========================================================================//
// File: btl4grnd.cpp //
// Project: BattleTech //
// Contents: Implementation details for the BT gauge renderer //
// Project: BattleTech Brick: Gauge Renderer Manager //
// Contents: BTL4GaugeRenderer -- the BT cockpit gauge renderer //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
//
// RECONSTRUCTED against the authentic surviving BTL4GRND.HPP (5 members, no
// data -- all state inherited). Binary anchors: ctor @004cbea0 (vtable
// 0051cebc), dtor @004cbf40, TestInstance @004cbf90, NotifyOfNew @004cbfa0,
// NotifyOfBecoming @004cc028; the BT registration table @0051c910.
//
#include <btl4.hpp>
#pragma hdrstop
@@ -15,20 +21,195 @@
# include <btl4grnd.hpp>
#endif
BTL4GaugeRenderer::BTL4GaugeRenderer()
#if !defined(BTL4GAUG_HPP)
# include <btl4gaug.hpp>
#endif
#if !defined(BTL4GAU2_HPP)
# include <btl4gau2.hpp>
#endif
#if !defined(BTL4GAU3_HPP)
# include <btl4gau3.hpp>
#endif
#if !defined(BTL4RDR_HPP)
# include <btl4rdr.hpp>
#endif
#if !defined(L4WRHOUS_HPP)
# include <l4wrhous.hpp>
#endif
#if !defined(L4LAMP_HPP)
# include <l4lamp.hpp>
#endif
#if !defined(APP_HPP)
# include <app.hpp>
#endif
#if !defined(MOVER_HPP)
# include <mover.hpp>
#endif
#if !defined(TERRAIN_HPP)
# include <terrain.hpp>
#endif
#if !defined(RESOURCE_HPP)
# include <resource.hpp>
#endif
//
//#############################################################################
// The BT gauge primitive registry (.data @0051c910): every L4GAUGE.CFG
// keyword the BT cockpit adds, chained onto the engine L4MethodDescription
// table so unmatched keywords (bgPixelMap / numeric / rankAndScore / ...)
// fall through to the base widgets. The CHAIN entry MUST stay LAST, and
// every listed methodDescription's Make must be real code -- the
// interpreter assigns opcodes by flattened table index and calls Make at
// Interpret time.
//#############################################################################
//
extern MethodDescription *L4MethodDescription[];
static MethodDescription
BTL4ChainToPrevious = METHOD_DESCRIPTION_CHAIN(L4MethodDescription);
MethodDescription
*BTL4MethodDescription[] =
{
&ColorMapperHeat::methodDescription, // "cmHeat"
&HeadingPointer::methodDescription, // "headingPointer"
&ColorMapperArmor::methodDescription, // "cmArmor"
&ColorMapperMultiArmor::methodDescription, // "colorMapperMultiArmor"
&ColorMapperCritical::methodDescription, // "cmCrit"
&VertTwoPartBar::methodDescription, // "vertBar"
&SegmentArcRatio::methodDescription, // "segmentArcRatio"
&OneOfSeveralPixInt::methodDescription, // "oneOfSeveralPixInt"
&MapDisplay::methodDescription, // "map"
&PlayerStatus::methodDescription, // "PlayerStatus"
&VehicleSubSystems::methodDescription, // "vehicleSubSystems"
&BitMapInverseWipe::methodDescription, // "LeakGauge"
&VertNormalSlider::methodDescription, // "vertNormalSlider"
&PilotList::methodDescription, // "pilotList"
&GeneratorCluster::methodDescription, // "GeneratorCluster"
&SectorDisplay::methodDescription, // "sectorDisplay"
&PrepEngrScreen::methodDescription, // "prepEngr"
&MessageBoard::methodDescription, // "messageBoard"
&BTL4ChainToPrevious
};
//
//#############################################################################
// Construction (binary @004cbea0): the lamp manager, the warehouse, then
// the configuration build -- BuildConfigurationFile parses the ENTIRE
// gauge\l4gauge.cfg to bytecode against the registry and immediately runs
// the cfg's `Initialization` procedure (ports / global gauges, entity ==
// NULL). The per-mech gauges instantiate later via ConfigureForModel
// ("<GameModel>Init") from MakeViewpointEntity.
//#############################################################################
//
BTL4GaugeRenderer::BTL4GaugeRenderer():
L4GaugeRenderer()
{
Check(this);
lampManager = new L4LampManager(
(LBE4ControlsManager *)application->GetControlsManager());
Register_Object(lampManager);
warehousePointer = new L4Warehouse();
Register_Object(warehousePointer);
BuildConfigurationFile("gauge\\l4gauge.cfg", BTL4MethodDescription);
Check_Fpu();
}
//
//#############################################################################
// Destruction (binary @004cbf40): remove every gauge BEFORE the warehouse
// dies (gauge dtors release warehouse resources).
//#############################################################################
//
BTL4GaugeRenderer::~BTL4GaugeRenderer()
{
Check(this);
Remove(0);
if (warehousePointer != NULL)
{
Unregister_Object(warehousePointer);
delete warehousePointer;
warehousePointer = NULL;
}
}
Logical
BTL4GaugeRenderer::TestInstance() const
{
return True;
}
//
//#############################################################################
// The radar feed (binary @004cbfa0 / @004cc028): an interesting entity with
// a gauge-image (pip) resource joins the moving (Mover) or static (Terrain)
// list; everything ALWAYS chains to the base (the engine forwards the
// notification to every live gauge -- "all descendents MUST chain back").
//#############################################################################
//
void
BTL4GaugeRenderer::NotifyOfNewInterestingEntity(Entity *entity)
{
Check(this);
Check(entity);
ResourceDescription *pip =
application->GetResourceFile()->SearchList(
entity->GetResourceID(),
ResourceDescription::GaugeImageStreamResourceType
);
if (pip != NULL)
{
if (entity->IsDerivedFrom(Mover::ClassDerivations))
{
movingEntities.Add(entity);
}
else if (entity->IsDerivedFrom(Terrain::ClassDerivations))
{
staticEntities.Add(entity);
}
}
L4GaugeRenderer::NotifyOfNewInterestingEntity(entity);
}
void
BTL4GaugeRenderer::NotifyOfNewInterestingEntity(Entity *)
BTL4GaugeRenderer::NotifyOfBecomingUninterestingEntity(Entity *entity)
{
}
Check(this);
Check(entity);
void
BTL4GaugeRenderer::NotifyOfBecomingUninterestingEntity(Entity *)
{
ResourceDescription *pip =
application->GetResourceFile()->SearchList(
entity->GetResourceID(),
ResourceDescription::GaugeImageStreamResourceType
);
if (pip != NULL)
{
if (entity->IsDerivedFrom(Mover::ClassDerivations))
{
movingEntities.Remove(entity);
}
else if (entity->IsDerivedFrom(Terrain::ClassDerivations))
{
staticEntities.Remove(entity);
}
}
L4GaugeRenderer::NotifyOfBecomingUninterestingEntity(entity);
}
File diff suppressed because it is too large Load Diff
@@ -401,3 +401,41 @@ btl4grnd.cpp:136-154: '&ColorMapperHeat::methodDescription, // "cmHeat" ... &BTL
- The second BitMapInverseWipe base @004c5e84 and its Scalar variant @004c61c8 are notes-only (not reconstructed); if btl4gau2's LeakGauge subclassing needs them they are missing code.
- HeadingPointer uses YawPitchRoll where the binary used EulerAngles (FUN_0040954c) — a deliberate anti-glitch deviation; decide whether byte-fidelity or the fix wins for the 4.10 literal reconstruction.
- ColorMapperMultiArmor::Make keeps the binary's `index != 0` presence-test quirk (a valid zone 0 and a -1 'unused' both count as present) — faithful, but flag if zone 0 semantics ever matter.
=============================================================================
# 5.3.26 LANDING REPORT (the first rendered milestone -- gauges LIVE)
All six TUs re-hosted (4-agent workflow + integration) and the block BOOTS:
L4GAUGE=640x480x16 + HEAPSIZE=15000000 (gauge.conf / gaugefight.conf).
Verified: the interpreter parses the FULL cfg through the 19-entry BT
registry (only warn = the absent 'Initialization' label -- the BT cfg has
none, graceful skip); Bhk1Init RUNS (case-insensitive label match on
"bhk1"+"Init"); ColorMapperArmor Makes resolve zone NAMES against the live
mech (8 cross-chassis warnings = the authentic -1 inert path); the full
mutual missile fight runs 110s with the cockpit stack live (16/16 rounds,
138 zone hits, zero faults); gauges-off regressions untouched.
ENGINE DEVIATION (bring-up, load-bearing): ParameterDescription::
ParseAttribute normalizes unpublished attributes to a shared 64-byte zero
cell (gaugeUnboundCell) instead of NULL -- GaugeConnectionDirectOf's 1995
ctor hard-derefs its source (the first boot crashed exactly there,
@GaugeConnectionDirectOf<float>::ctor). Widgets on unpublished names draw
static zeros and LIGHT UP automatically when the attribute waves publish
(the agents baked the 1995 CFG spellings into every binding: HeatLoad /
CoolantAvailable / CurrentTemperature / Degradation~ / Failure~ /
CoolantMassLeakRate / CurrentSeekVoltageIndex / Min~ / Max~ / SeekVoltage /
RadarRange / RadarLinearPosition / RadarAngularPosition / RadarPercent).
WHAT'S INERT UNTIL ITS FEED WAVE (full lists in the agent reports above):
seek-response curves (vtbl-slot-15 sampler), cooling-loop lamp frames,
aux-screen numbers/labels (resource freed post-ctor -- roster-order
stand-in), ballistic ammo numerics (ammoBinLink protected), heat-family
named attribute rows, radar family, MessageBoard feed (StatusMessagePool),
name bitmaps, TeamStatusDisplay (prose-only donor, deferred).
NEXT gauge steps: publish the heat/seek/radar attribute rows (small HPP
tables -- lights half the panels), add BTPlayer::GetKillCount() and the
ammoBinLink accessor, then the VISUAL pass on the rig (emulator VPXLOG=1 +
VDB head windows / pod-launch --layout explode) diffing against the shipped
exe on the same GAUGE content.
+14 -3
View File
@@ -2137,6 +2137,15 @@ void
Check_Fpu();
}
//
// BRING-UP zero cell: an unpublished attribute binds HERE instead of NULL
// (GaugeConnectionDirectOf's 1995 ctor hard-derefs its source). 64 zeroed,
// writable bytes cover any consumer shape (Scalar/int/Point3D*/Quaternion*)
// -- the widget draws a static zero until the attribute wave publishes the
// real member, then lights up with no gauge-code change.
//
static char gaugeUnboundCell[64];
void *
ParameterDescription::ParseAttribute(
const char *string_pointer,
@@ -2178,7 +2187,7 @@ void *
{
Tell("parseAttribute - subsystem '" << source << "' not found\n");
Check_Fpu();
return NULL;
return (void *)gaugeUnboundCell;
}
else
{
@@ -2202,7 +2211,8 @@ void *
DEBUG_STREAM << "[attr] " << string_pointer
<< (attribute_pointer ? " OK\n" : " NULL\n") << flush;
Check_Fpu();
return attribute_pointer;
return (attribute_pointer != NULL)
? attribute_pointer : (void *)gaugeUnboundCell;
}
}
}
@@ -2223,7 +2233,8 @@ void *
DEBUG_STREAM << "[attr] " << source
<< (attribute_pointer ? " OK (entity)\n" : " NULL (entity)\n") << flush;
Check_Fpu();
return attribute_pointer;
return (attribute_pointer != NULL)
? attribute_pointer : (void *)gaugeUnboundCell;
}
Logical