Files
TeslaRel410/restoration/source410/BT_L4/BTL4MPPR.CPP
T
CydandClaude Fable 5 1f2f8ac42a Phase 5.1: MechControlsMapper publishes its 20 control-input attributes
Reconstructed the MechControlsMapper attribute table (StickPosition..PilotArray,
IDs 3-0x16 chained from Subsystem::NextAttributeID==2) + the real members
(stickPosition ControlsJoystick, throttle/pedals/speed/turn Scalars, the look/
torso ControlsButtons, control/display/pilotArray ints) + AttributePointers[] +
AttributeIndex (chains Subsystem::AttributeIndex). Fixed the mapper hierarchy
statics in BTL4MPPR.CPP: L4/RIO/Thrustmaster ClassDerivations now chain correctly
(L4 defined first for static-init order) and all use MechControlsMapper::
AttributeIndex so the mapper instance publishes the control attributes the
streamed mappings bind to.

Mech still constructs (33 subsystems). The post-construction crash is UNCHANGED
(GetAttributePointer, attribute=0x13) -> so it's NOT the mapper; a streamed
AttributeWatcher (numeric ID 19) resolves on another object via GetSimulation.
Next diagnostic: which object/subsystemID the watcher targets. BT: 42 ok.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 11:10:44 -05:00

126 lines
3.0 KiB
C++

//===========================================================================//
// Project: BattleTech //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(BTL4MPPR_HPP)
# include <btl4mppr.hpp>
#endif
//
// NOTE: define L4MechControlsMapper's statics FIRST -- the RIO/Thrustmaster
// derivations chain it, so it must construct before them. All three mappers'
// DefaultData use MechControlsMapper::AttributeIndex so the mapper instance
// publishes the control-input attributes the streamed mappings bind to.
//
Derivation
L4MechControlsMapper::ClassDerivations(
MechControlsMapper::ClassDerivations,
"L4MechControlsMapper"
);
L4MechControlsMapper::SharedData
L4MechControlsMapper::DefaultData(
L4MechControlsMapper::ClassDerivations,
Subsystem::MessageHandlers,
MechControlsMapper::AttributeIndex,
1
);
Derivation
MechThrustmasterMapper::ClassDerivations(
L4MechControlsMapper::ClassDerivations,
"MechThrustmasterMapper"
);
MechThrustmasterMapper::SharedData
MechThrustmasterMapper::DefaultData(
MechThrustmasterMapper::ClassDerivations,
Subsystem::MessageHandlers,
MechControlsMapper::AttributeIndex,
1
);
Derivation
MechRIOMapper::ClassDerivations(
L4MechControlsMapper::ClassDerivations,
"MechRIOMapper"
);
MechRIOMapper::SharedData
MechRIOMapper::DefaultData(
MechRIOMapper::ClassDerivations,
Subsystem::MessageHandlers,
MechControlsMapper::AttributeIndex,
1
);
L4MechControlsMapper::L4MechControlsMapper(
Mech *owner,
int subsystem_ID,
CString subsystem_name,
RegisteredClass::ClassID class_ID,
SharedData &shared_data
):
MechControlsMapper(owner, subsystem_ID, subsystem_name, class_ID, shared_data)
{
}
L4MechControlsMapper::~L4MechControlsMapper()
{
}
Logical
L4MechControlsMapper::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
MechThrustmasterMapper::MechThrustmasterMapper(
Mech *owner,
int subsystem_ID,
CString subsystem_name,
RegisteredClass::ClassID class_ID,
SharedData &shared_data
):
L4MechControlsMapper(owner, subsystem_ID, subsystem_name, class_ID, shared_data)
{
}
MechThrustmasterMapper::~MechThrustmasterMapper()
{
}
Logical
MechThrustmasterMapper::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
MechRIOMapper::MechRIOMapper(
Mech *owner,
int subsystem_ID,
CString subsystem_name,
RegisteredClass::ClassID class_ID,
SharedData &shared_data
):
L4MechControlsMapper(owner, subsystem_ID, subsystem_name, class_ID, shared_data)
{
}
MechRIOMapper::~MechRIOMapper()
{
}
Logical
MechRIOMapper::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}