Head-up display / targeting reticle subsystem, full named member set (reticle/ compass/lock/flicker/torso-readout state). Ctor chains PowerWatcher + inits per the binary (visible/blinkState True, vectors zeroed, resource flicker/horizontal copied); statusAlarm.Initialize(2). Added AlarmIndicator::Initialize(levels). statics/dtor/test real; HudSimulation staged. BT: 29 ok. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
111 lines
2.6 KiB
C++
111 lines
2.6 KiB
C++
//===========================================================================//
|
|
// File: hud.cpp //
|
|
// Project: BattleTech Brick: Mech subsystems //
|
|
// Contents: HUD -- head-up display / targeting reticle //
|
|
//---------------------------------------------------------------------------//
|
|
// 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(HUD_HPP)
|
|
# include <hud.hpp>
|
|
#endif
|
|
|
|
#if !defined(MECH_HPP)
|
|
# include <mech.hpp>
|
|
#endif
|
|
|
|
static const Point3D HudZeroVector(0.0f, 0.0f, 0.0f);
|
|
|
|
Derivation
|
|
HUD::ClassDerivations(
|
|
PowerWatcher::ClassDerivations,
|
|
"HUD"
|
|
);
|
|
|
|
HUD::SharedData
|
|
HUD::DefaultData(
|
|
HUD::ClassDerivations,
|
|
Subsystem::MessageHandlers,
|
|
Subsystem::AttributeIndex,
|
|
Subsystem::StateCount
|
|
);
|
|
|
|
HUD::HUD(
|
|
Mech *owner,
|
|
int subsystem_ID,
|
|
SubsystemResource *subsystem_resource,
|
|
SharedData &shared_data
|
|
):
|
|
PowerWatcher(owner, subsystem_ID, subsystem_resource, shared_data)
|
|
{
|
|
Check(owner);
|
|
Check_Pointer(subsystem_resource);
|
|
|
|
flickerRate = 0.0f;
|
|
rotationOfTorsoHorizontal = 0.0f;
|
|
torsoLimitRight = 0.0f;
|
|
torsoLimitLeft = 0.0f;
|
|
torsoSpeed = 0.0f;
|
|
rangeToTarget = 0.0f;
|
|
scratch1F0 = 0;
|
|
visible = True;
|
|
lockFlag = False;
|
|
hotBoxVector = HudZeroVector;
|
|
threatVector = HudZeroVector;
|
|
compassHeading = 0.0f;
|
|
blinkTimer = 0.0f;
|
|
flickerTimer = 0.0f;
|
|
blinkState = True;
|
|
transitionFlag = False;
|
|
previousHorizontal = 0.0f;
|
|
|
|
statusAlarm.Initialize(2);
|
|
|
|
freeAimSlew = 0.0f;
|
|
scratch290 = 0.0f;
|
|
horizontalTorsoOffset = 0.0f;
|
|
|
|
flickerRate = subsystem_resource->flickerRate;
|
|
horizontalMovementPerSecond = subsystem_resource->horizontalMovementPerSecond;
|
|
horizontalLimit = subsystem_resource->horizontalLimit;
|
|
|
|
//
|
|
// The torso-orientation source is a Mech link not yet live at
|
|
// construction time; HudSimulation refreshes these per-frame.
|
|
//
|
|
linkedEntity = 0;
|
|
flickerActive = 0;
|
|
|
|
Check_Fpu();
|
|
}
|
|
|
|
HUD::~HUD()
|
|
{
|
|
}
|
|
|
|
Logical
|
|
HUD::TestClass(Mech &)
|
|
{
|
|
return True;
|
|
}
|
|
|
|
Logical
|
|
HUD::TestInstance() const
|
|
{
|
|
return IsDerivedFrom(ClassDerivations);
|
|
}
|
|
|
|
//
|
|
// Per-frame reticle / compass / lock-ring update. Not yet reconstructed.
|
|
//
|
|
void
|
|
HUD::HudSimulation(Scalar)
|
|
{
|
|
Fail("HUD::HudSimulation -- hud.cpp not yet reconstructed");
|
|
}
|