mirror of https://github.com/AxioDL/metaforce.git
Lots of CSamusHud imps
This commit is contained in:
parent
dfcd66ab26
commit
a2b9bfb1a2
|
@ -19,20 +19,25 @@ struct ITweakGui : ITweak
|
||||||
|
|
||||||
enum class EHelmetVisMode : atUint32
|
enum class EHelmetVisMode : atUint32
|
||||||
{
|
{
|
||||||
Zero,
|
ReducedUpdate,
|
||||||
One,
|
NotVisible,
|
||||||
Two,
|
Deco,
|
||||||
Three,
|
HelmetDeco,
|
||||||
Four
|
GlowHelmetDeco,
|
||||||
|
HelmetOnly
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual float GetMapAlphaInterpolant() const=0;
|
virtual float GetMapAlphaInterpolant() const=0;
|
||||||
|
virtual atUint32 GetHudCamFovTweak() const=0;
|
||||||
|
virtual atUint32 GetHudCamYTweak() const=0;
|
||||||
|
virtual atUint32 GetHudCamZTweak() const=0;
|
||||||
virtual EHudVisMode GetHudVisMode() const=0;
|
virtual EHudVisMode GetHudVisMode() const=0;
|
||||||
virtual EHelmetVisMode GetHelmetVisMode() const=0;
|
virtual EHelmetVisMode GetHelmetVisMode() const=0;
|
||||||
virtual atUint32 GetEnableAutoMapper() const=0;
|
virtual atUint32 GetEnableAutoMapper() const=0;
|
||||||
virtual atUint32 GetEnableTargetingManager() const=0;
|
virtual atUint32 GetEnableTargetingManager() const=0;
|
||||||
virtual atUint32 GetEnablePlayerVisor() const=0;
|
virtual atUint32 GetEnablePlayerVisor() const=0;
|
||||||
virtual float GetScanAppearanceOffset() const=0;
|
virtual float GetScanAppearanceOffset() const=0;
|
||||||
|
virtual float GetBallViewportYReduction() const=0;
|
||||||
virtual float GetScanSpeed(int idx) const=0;
|
virtual float GetScanSpeed(int idx) const=0;
|
||||||
virtual float GetXrayBlurScaleLinear() const=0;
|
virtual float GetXrayBlurScaleLinear() const=0;
|
||||||
virtual float GetXrayBlurScaleQuadratic() const=0;
|
virtual float GetXrayBlurScaleQuadratic() const=0;
|
||||||
|
|
|
@ -11,8 +11,12 @@ struct ITweakGuiColors : BigYAML
|
||||||
virtual zeus::CColor GetHudMessageOutline() const=0;
|
virtual zeus::CColor GetHudMessageOutline() const=0;
|
||||||
virtual zeus::CColor GetHudFrameColor() const=0;
|
virtual zeus::CColor GetHudFrameColor() const=0;
|
||||||
virtual zeus::CColor GetTickDecoColor() const=0;
|
virtual zeus::CColor GetTickDecoColor() const=0;
|
||||||
|
virtual zeus::CColor GetXRayEnergyDecoColor() const=0;
|
||||||
virtual zeus::CColor GetHudCounterFill() const=0;
|
virtual zeus::CColor GetHudCounterFill() const=0;
|
||||||
virtual zeus::CColor GetHudCounterOutline() const=0;
|
virtual zeus::CColor GetHudCounterOutline() const=0;
|
||||||
|
virtual zeus::CColor GetThermalDecoColor() const=0;
|
||||||
|
virtual zeus::CColor GetThermalOutlinesColor() const=0;
|
||||||
|
virtual zeus::CColor GetThermalLockColor() const=0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ struct ITweakPlayer : ITweak
|
||||||
virtual float GetX58() const=0;
|
virtual float GetX58() const=0;
|
||||||
virtual float GetX5C() const=0;
|
virtual float GetX5C() const=0;
|
||||||
virtual float GetScanningRange() const=0; // x218
|
virtual float GetScanningRange() const=0; // x218
|
||||||
|
virtual bool GetScanFreezesGame() const=0; // x21c_25
|
||||||
virtual float GetPlayerHeight() const=0; // x26c
|
virtual float GetPlayerHeight() const=0; // x26c
|
||||||
virtual float GetPlayerXYHalfExtent() const=0; // x270
|
virtual float GetPlayerXYHalfExtent() const=0; // x270
|
||||||
virtual bool GetX228_24() const=0; // x228_24
|
virtual bool GetX228_24() const=0; // x228_24
|
||||||
|
|
|
@ -47,9 +47,9 @@ struct CTweakGui : ITweakGui
|
||||||
Value<float> x9c_;
|
Value<float> x9c_;
|
||||||
Value<float> xa0_;
|
Value<float> xa0_;
|
||||||
Value<float> xa4_;
|
Value<float> xa4_;
|
||||||
Value<atUint32> xa8_;
|
Value<atUint32> xa8_hudCamFovTweak;
|
||||||
Value<atUint32> xac_;
|
Value<atUint32> xac_hudCamYTweak;
|
||||||
Value<atUint32> xb0_;
|
Value<atUint32> xb0_hudCamZTweak;
|
||||||
Value<float> xb4_;
|
Value<float> xb4_;
|
||||||
Value<float> xb8_;
|
Value<float> xb8_;
|
||||||
Value<float> xbc_;
|
Value<float> xbc_;
|
||||||
|
@ -140,7 +140,7 @@ struct CTweakGui : ITweakGui
|
||||||
Value<float> x248_;
|
Value<float> x248_;
|
||||||
Value<float> x24c_;
|
Value<float> x24c_;
|
||||||
Value<float> x250_;
|
Value<float> x250_;
|
||||||
Value<float> x254_;
|
Value<float> x254_ballViewportYReduction;
|
||||||
Value<float> x258_;
|
Value<float> x258_;
|
||||||
Value<float> x25c_;
|
Value<float> x25c_;
|
||||||
Value<float> x260_;
|
Value<float> x260_;
|
||||||
|
@ -196,12 +196,16 @@ struct CTweakGui : ITweakGui
|
||||||
CTweakGui(athena::io::IStreamReader& r) { this->read(r); }
|
CTweakGui(athena::io::IStreamReader& r) { this->read(r); }
|
||||||
|
|
||||||
float GetMapAlphaInterpolant() const { return x8_mapAlphaInterp; }
|
float GetMapAlphaInterpolant() const { return x8_mapAlphaInterp; }
|
||||||
|
atUint32 GetHudCamFovTweak() const { return xa8_hudCamFovTweak; }
|
||||||
|
atUint32 GetHudCamYTweak() const { return xac_hudCamYTweak; }
|
||||||
|
atUint32 GetHudCamZTweak() const { return xb0_hudCamZTweak; }
|
||||||
EHudVisMode GetHudVisMode() const { return xf8_hudVisMode; }
|
EHudVisMode GetHudVisMode() const { return xf8_hudVisMode; }
|
||||||
EHelmetVisMode GetHelmetVisMode() const { return xfc_helmetVisMode; }
|
EHelmetVisMode GetHelmetVisMode() const { return xfc_helmetVisMode; }
|
||||||
atUint32 GetEnableAutoMapper() const { return x100_enableAutoMapper; }
|
atUint32 GetEnableAutoMapper() const { return x100_enableAutoMapper; }
|
||||||
atUint32 GetEnableTargetingManager() const { return x108_enableTargetingManager; }
|
atUint32 GetEnableTargetingManager() const { return x108_enableTargetingManager; }
|
||||||
atUint32 GetEnablePlayerVisor() const { return x10c_enablePlayerVisor; }
|
atUint32 GetEnablePlayerVisor() const { return x10c_enablePlayerVisor; }
|
||||||
float GetScanAppearanceOffset() const { return x244_scanAppearanceOffset; }
|
float GetScanAppearanceOffset() const { return x244_scanAppearanceOffset; }
|
||||||
|
float GetBallViewportYReduction() const { return x254_ballViewportYReduction; }
|
||||||
float GetXrayBlurScaleLinear() const { return x204_xrayBlurScaleLinear; }
|
float GetXrayBlurScaleLinear() const { return x204_xrayBlurScaleLinear; }
|
||||||
float GetXrayBlurScaleQuadratic() const { return x208_xrayBlurScaleQuadratic; }
|
float GetXrayBlurScaleQuadratic() const { return x208_xrayBlurScaleQuadratic; }
|
||||||
float GetScanSidesAngle() const { return x210_scanSidesAngle; }
|
float GetScanSidesAngle() const { return x210_scanSidesAngle; }
|
||||||
|
|
|
@ -73,7 +73,7 @@ struct CTweakGuiColors : public ITweakGuiColors
|
||||||
DNAColor xf4_;
|
DNAColor xf4_;
|
||||||
DNAColor xf8_;
|
DNAColor xf8_;
|
||||||
DNAColor xfc_;
|
DNAColor xfc_;
|
||||||
DNAColor x100_;
|
DNAColor x100_xrayEnergyDecoColor;
|
||||||
DNAColor x104_;
|
DNAColor x104_;
|
||||||
DNAColor x108_;
|
DNAColor x108_;
|
||||||
DNAColor x10c_;
|
DNAColor x10c_;
|
||||||
|
@ -116,10 +116,10 @@ struct CTweakGuiColors : public ITweakGuiColors
|
||||||
DNAColor x1a0_;
|
DNAColor x1a0_;
|
||||||
DNAColor x1a4_;
|
DNAColor x1a4_;
|
||||||
DNAColor x1a8_;
|
DNAColor x1a8_;
|
||||||
DNAColor x1ac_;
|
DNAColor x1ac_thermalDecoColor;
|
||||||
DNAColor x1b0_;
|
DNAColor x1b0_thermalOutlinesColor;
|
||||||
DNAColor x1b4_;
|
DNAColor x1b4_;
|
||||||
DNAColor x1b8_;
|
DNAColor x1b8_thermalLockColor;
|
||||||
DNAColor x1bc_;
|
DNAColor x1bc_;
|
||||||
DNAColor x1c0_;
|
DNAColor x1c0_;
|
||||||
struct UnkColors : BigYAML
|
struct UnkColors : BigYAML
|
||||||
|
@ -143,8 +143,12 @@ struct CTweakGuiColors : public ITweakGuiColors
|
||||||
zeus::CColor GetHudMessageOutline() const { return x18_hudMessageOutline; }
|
zeus::CColor GetHudMessageOutline() const { return x18_hudMessageOutline; }
|
||||||
zeus::CColor GetHudFrameColor() const { return x1c_hudFrameColor; }
|
zeus::CColor GetHudFrameColor() const { return x1c_hudFrameColor; }
|
||||||
zeus::CColor GetTickDecoColor() const { return x88_tickDecoColor; }
|
zeus::CColor GetTickDecoColor() const { return x88_tickDecoColor; }
|
||||||
|
zeus::CColor GetXRayEnergyDecoColor() const { return x100_xrayEnergyDecoColor; }
|
||||||
zeus::CColor GetHudCounterFill() const { return x180_hudCounterFill; }
|
zeus::CColor GetHudCounterFill() const { return x180_hudCounterFill; }
|
||||||
zeus::CColor GetHudCounterOutline() const { return x184_hudCounterOutline; }
|
zeus::CColor GetHudCounterOutline() const { return x184_hudCounterOutline; }
|
||||||
|
zeus::CColor GetThermalDecoColor() const { return x1ac_thermalDecoColor; }
|
||||||
|
zeus::CColor GetThermalOutlinesColor() const { return x1b0_thermalOutlinesColor; }
|
||||||
|
zeus::CColor GetThermalLockColor() const { return x1b8_thermalLockColor; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -354,7 +354,7 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader)
|
||||||
/* x21c_24_ */
|
/* x21c_24_ */
|
||||||
x21c_24_ = __dna_reader.readBool();
|
x21c_24_ = __dna_reader.readBool();
|
||||||
/* x21c_25_ */
|
/* x21c_25_ */
|
||||||
x21c_25_ = __dna_reader.readBool();
|
x21c_25_scanFreezesGame = __dna_reader.readBool();
|
||||||
/* x21c_26_ */
|
/* x21c_26_ */
|
||||||
x21c_26_ = __dna_reader.readBool();
|
x21c_26_ = __dna_reader.readBool();
|
||||||
/* x220_ */
|
/* x220_ */
|
||||||
|
@ -794,7 +794,7 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const
|
||||||
/* x21c_24_ */
|
/* x21c_24_ */
|
||||||
__dna_writer.writeBool(x21c_24_);
|
__dna_writer.writeBool(x21c_24_);
|
||||||
/* x21c_25_ */
|
/* x21c_25_ */
|
||||||
__dna_writer.writeBool(x21c_25_);
|
__dna_writer.writeBool(x21c_25_scanFreezesGame);
|
||||||
/* x21c_26_ */
|
/* x21c_26_ */
|
||||||
__dna_writer.writeBool(x21c_26_);
|
__dna_writer.writeBool(x21c_26_);
|
||||||
/* x220_ */
|
/* x220_ */
|
||||||
|
@ -1309,7 +1309,7 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
||||||
/* x21c_24_ */
|
/* x21c_24_ */
|
||||||
x21c_24_ = __dna_docin.readBool("x21c_24_");
|
x21c_24_ = __dna_docin.readBool("x21c_24_");
|
||||||
/* x21c_25_ */
|
/* x21c_25_ */
|
||||||
x21c_25_ = __dna_docin.readBool("x21c_25_");
|
x21c_25_scanFreezesGame = __dna_docin.readBool("x21c_25_");
|
||||||
/* x21c_26_ */
|
/* x21c_26_ */
|
||||||
x21c_26_ = __dna_docin.readBool("x21c_26_");
|
x21c_26_ = __dna_docin.readBool("x21c_26_");
|
||||||
/* x220_ */
|
/* x220_ */
|
||||||
|
@ -1809,7 +1809,7 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
||||||
/* x21c_24_ */
|
/* x21c_24_ */
|
||||||
__dna_docout.writeBool("x21c_24_", x21c_24_);
|
__dna_docout.writeBool("x21c_24_", x21c_24_);
|
||||||
/* x21c_25_ */
|
/* x21c_25_ */
|
||||||
__dna_docout.writeBool("x21c_25_", x21c_25_);
|
__dna_docout.writeBool("x21c_25_", x21c_25_scanFreezesGame);
|
||||||
/* x21c_26_ */
|
/* x21c_26_ */
|
||||||
__dna_docout.writeBool("x21c_26_", x21c_26_);
|
__dna_docout.writeBool("x21c_26_", x21c_26_);
|
||||||
/* x220_ */
|
/* x220_ */
|
||||||
|
|
|
@ -93,7 +93,7 @@ struct CTweakPlayer : ITweakPlayer
|
||||||
Value<float> x214_;
|
Value<float> x214_;
|
||||||
Value<float> x218_scanningRange;
|
Value<float> x218_scanningRange;
|
||||||
Value<bool> x21c_24_ : 1;
|
Value<bool> x21c_24_ : 1;
|
||||||
Value<bool> x21c_25_ : 1;
|
Value<bool> x21c_25_scanFreezesGame : 1;
|
||||||
Value<bool> x21c_26_ : 1;
|
Value<bool> x21c_26_ : 1;
|
||||||
Value<float> x220_;
|
Value<float> x220_;
|
||||||
Value<float> x224_;
|
Value<float> x224_;
|
||||||
|
@ -180,6 +180,7 @@ struct CTweakPlayer : ITweakPlayer
|
||||||
float GetX58() const { return x44_[5]; }
|
float GetX58() const { return x44_[5]; }
|
||||||
float GetX5C() const { return x44_[6]; }
|
float GetX5C() const { return x44_[6]; }
|
||||||
float GetScanningRange() const { return x218_scanningRange; }
|
float GetScanningRange() const { return x218_scanningRange; }
|
||||||
|
bool GetScanFreezesGame() const { return x21c_25_scanFreezesGame; }
|
||||||
float GetPlayerHeight() const { return x26c_playerHeight; }
|
float GetPlayerHeight() const { return x26c_playerHeight; }
|
||||||
float GetPlayerXYHalfExtent() const { return x270_playerXYHalfExtent; }
|
float GetPlayerXYHalfExtent() const { return x270_playerXYHalfExtent; }
|
||||||
float GetX274() const { return x274_; }
|
float GetX274() const { return x274_; }
|
||||||
|
|
|
@ -346,7 +346,7 @@ TAreaId CStateManager::GetVisAreaId() const
|
||||||
camAABB.accumulateBounds(x84c_player->GetTranslation());
|
camAABB.accumulateBounds(x84c_player->GetTranslation());
|
||||||
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
||||||
BuildNearList(nearList, camAABB, CMaterialFilter(EMaterialTypes::AIBlock, CMaterialList(),
|
BuildNearList(nearList, camAABB, CMaterialFilter(EMaterialTypes::AIBlock, CMaterialList(),
|
||||||
CMaterialFilter::EFilterType::One), nullptr);
|
CMaterialFilter::EFilterType::Include), nullptr);
|
||||||
for (TUniqueId id : nearList)
|
for (TUniqueId id : nearList)
|
||||||
if (TCastToConstPtr<CScriptDock> dock = GetObjectById(id))
|
if (TCastToConstPtr<CScriptDock> dock = GetObjectById(id))
|
||||||
if (dock->GetDestinationAreaId() == curArea && dock->HasPointCrossedDock(*this, camTranslation))
|
if (dock->GetDestinationAreaId() == curArea && dock->HasPointCrossedDock(*this, camTranslation))
|
||||||
|
@ -396,8 +396,6 @@ void CStateManager::UpdateEscapeSequenceTimer(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float CStateManager::GetEscapeSequenceTimer() const { return xf0c_escapeTimer; }
|
|
||||||
|
|
||||||
void CStateManager::ResetEscapeSequenceTimer(float time)
|
void CStateManager::ResetEscapeSequenceTimer(float time)
|
||||||
{
|
{
|
||||||
xf0c_escapeTimer = time;
|
xf0c_escapeTimer = time;
|
||||||
|
@ -1322,7 +1320,7 @@ void CStateManager::KnockBackPlayer(CPlayer& player, const zeus::CVector3f& pos,
|
||||||
{
|
{
|
||||||
usePower = power * 1000.f;
|
usePower = power * 1000.f;
|
||||||
u32 something = player.x2b0_ == 2 ? player.x2ac_ : 4;
|
u32 something = player.x2b0_ == 2 ? player.x2ac_ : 4;
|
||||||
if (something != 0 && player.x304_ == 0)
|
if (something != 0 && player.GetOrbitState() == CPlayer::EPlayerOrbitState::Zero)
|
||||||
usePower /= 7.f;
|
usePower /= 7.f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1796,6 +1794,30 @@ void CStateManager::ProcessPlayerInput()
|
||||||
x84c_player->ProcessInput(xb54_finalInput, *this);
|
x84c_player->ProcessInput(xb54_finalInput, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CStateManager::SetGameState(EGameState state)
|
||||||
|
{
|
||||||
|
if (x904_gameState == state)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (state == EGameState::SoftPaused)
|
||||||
|
x850_world->SetPauseState(false);
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case EGameState::Running:
|
||||||
|
if (x88c_rumbleManager->IsDisabled())
|
||||||
|
x88c_rumbleManager->SetDisabled(false);
|
||||||
|
break;
|
||||||
|
case EGameState::SoftPaused:
|
||||||
|
if (!x88c_rumbleManager->IsDisabled())
|
||||||
|
x88c_rumbleManager->SetDisabled(true);
|
||||||
|
x850_world->SetPauseState(true);
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
x904_gameState = state;
|
||||||
|
}
|
||||||
|
|
||||||
static const CFinalInput s_DisabledFinalInput = {};
|
static const CFinalInput s_DisabledFinalInput = {};
|
||||||
|
|
||||||
void CStateManager::ProcessInput(const CFinalInput& input)
|
void CStateManager::ProcessInput(const CFinalInput& input)
|
||||||
|
@ -1838,7 +1860,7 @@ void CStateManager::Update(float dt)
|
||||||
|
|
||||||
bool dying = x84c_player->x9f4_deathTime > 0.f;
|
bool dying = x84c_player->x9f4_deathTime > 0.f;
|
||||||
|
|
||||||
if (x904_ == 0)
|
if (x904_gameState == EGameState::Running)
|
||||||
{
|
{
|
||||||
if (!TCastToPtr<CCinematicCamera>(x870_cameraManager->GetCurrentCamera(*this)))
|
if (!TCastToPtr<CCinematicCamera>(x870_cameraManager->GetCurrentCamera(*this)))
|
||||||
{
|
{
|
||||||
|
@ -1853,13 +1875,13 @@ void CStateManager::Update(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x904_ != 2)
|
if (x904_gameState != EGameState::Paused)
|
||||||
{
|
{
|
||||||
PreThinkEffects(dt);
|
PreThinkEffects(dt);
|
||||||
x87c_fluidPlaneManager->Update(dt);
|
x87c_fluidPlaneManager->Update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x904_ == 0)
|
if (x904_gameState == EGameState::Running)
|
||||||
{
|
{
|
||||||
if (!dying)
|
if (!dying)
|
||||||
CDecalManager::Update(dt, *this);
|
CDecalManager::Update(dt, *this);
|
||||||
|
@ -1870,7 +1892,7 @@ void CStateManager::Update(float dt)
|
||||||
MoveDoors(dt);
|
MoveDoors(dt);
|
||||||
}
|
}
|
||||||
ProcessPlayerInput();
|
ProcessPlayerInput();
|
||||||
if (x904_ != 1)
|
if (x904_gameState != EGameState::SoftPaused)
|
||||||
CGameCollision::Move(*this, *x84c_player, dt, nullptr);
|
CGameCollision::Move(*this, *x84c_player, dt, nullptr);
|
||||||
UpdateSortedLists();
|
UpdateSortedLists();
|
||||||
if (!dying)
|
if (!dying)
|
||||||
|
@ -1881,13 +1903,13 @@ void CStateManager::Update(float dt)
|
||||||
ProcessPlayerInput();
|
ProcessPlayerInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dying && x904_ == 0)
|
if (!dying && x904_gameState == EGameState::Running)
|
||||||
x884_actorModelParticles->Update(dt, *this);
|
x884_actorModelParticles->Update(dt, *this);
|
||||||
|
|
||||||
if (x904_ == 0 || x904_ == 1)
|
if (x904_gameState == EGameState::Running || x904_gameState == EGameState::SoftPaused)
|
||||||
ThinkEffectsAndActors(dt);
|
ThinkEffectsAndActors(dt);
|
||||||
|
|
||||||
if (x904_ != 1)
|
if (x904_gameState != EGameState::SoftPaused)
|
||||||
x870_cameraManager->Update(dt, *this);
|
x870_cameraManager->Update(dt, *this);
|
||||||
|
|
||||||
while (xf76_lastRelay != kInvalidUniqueId)
|
while (xf76_lastRelay != kInvalidUniqueId)
|
||||||
|
@ -1903,7 +1925,7 @@ void CStateManager::Update(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x904_ != 2)
|
if (x904_gameState != EGameState::Paused)
|
||||||
UpdatePlayer(dt);
|
UpdatePlayer(dt);
|
||||||
|
|
||||||
if (xf84_ == xf80_hudMessageFrameCount)
|
if (xf84_ == xf80_hudMessageFrameCount)
|
||||||
|
@ -1913,7 +1935,7 @@ void CStateManager::Update(float dt)
|
||||||
xf88_ = -1;
|
xf88_ = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dying && x904_ == 0 && !x870_cameraManager->IsInCinematicCamera())
|
if (!dying && x904_gameState == EGameState::Running && !x870_cameraManager->IsInCinematicCamera())
|
||||||
UpdateEscapeSequenceTimer(dt);
|
UpdateEscapeSequenceTimer(dt);
|
||||||
|
|
||||||
x850_world->Update(dt);
|
x850_world->Update(dt);
|
||||||
|
@ -1995,7 +2017,7 @@ void CStateManager::PreThinkEffects(float dt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x904_ == 1)
|
if (x904_gameState == EGameState::SoftPaused)
|
||||||
for (CEntity* ent : GetAllObjectList())
|
for (CEntity* ent : GetAllObjectList())
|
||||||
if (TCastToPtr<CScriptEffect> effect = ent)
|
if (TCastToPtr<CScriptEffect> effect = ent)
|
||||||
effect->PreThink(dt, *this);
|
effect->PreThink(dt, *this);
|
||||||
|
@ -2104,7 +2126,7 @@ void CStateManager::ThinkEffectsAndActors(float dt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x904_ == 1)
|
if (x904_gameState == EGameState::SoftPaused)
|
||||||
{
|
{
|
||||||
for (CEntity* ent : GetAllObjectList())
|
for (CEntity* ent : GetAllObjectList())
|
||||||
if (TCastToPtr<CScriptEffect> effect = ent)
|
if (TCastToPtr<CScriptEffect> effect = ent)
|
||||||
|
|
|
@ -79,7 +79,15 @@ enum class EStateManagerTransition
|
||||||
class CStateManager
|
class CStateManager
|
||||||
{
|
{
|
||||||
friend class MP1::CMFGameLoader;
|
friend class MP1::CMFGameLoader;
|
||||||
|
public:
|
||||||
|
enum class EGameState
|
||||||
|
{
|
||||||
|
Running,
|
||||||
|
SoftPaused,
|
||||||
|
Paused
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
s16 x0_nextFreeIndex = 0;
|
s16 x0_nextFreeIndex = 0;
|
||||||
TUniqueId x8_idArr[1024] = {};
|
TUniqueId x8_idArr[1024] = {};
|
||||||
|
|
||||||
|
@ -152,7 +160,7 @@ class CStateManager
|
||||||
TLockedToken<CTexture> x8f0_shadowTex; /* DefaultShadow in MiscData */
|
TLockedToken<CTexture> x8f0_shadowTex; /* DefaultShadow in MiscData */
|
||||||
CRandom16 x8fc_random;
|
CRandom16 x8fc_random;
|
||||||
CRandom16* x900_activeRandom = nullptr;
|
CRandom16* x900_activeRandom = nullptr;
|
||||||
u32 x904_ = 0;
|
EGameState x904_gameState = EGameState::Running;
|
||||||
u32 x908_ = 0;
|
u32 x908_ = 0;
|
||||||
FScriptLoader x90c_loaderFuncs[int(EScriptObjectType::ScriptObjectTypeMAX)] = {};
|
FScriptLoader x90c_loaderFuncs[int(EScriptObjectType::ScriptObjectTypeMAX)] = {};
|
||||||
|
|
||||||
|
@ -247,8 +255,6 @@ class CStateManager
|
||||||
static void RendererDrawCallback(const void*, const void*, int);
|
static void RendererDrawCallback(const void*, const void*, int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* TODO: Public for CFirstPersonCamera */
|
|
||||||
u32 Get904() const { return x904_; }
|
|
||||||
CStateManager(const std::weak_ptr<CRelayTracker>&,
|
CStateManager(const std::weak_ptr<CRelayTracker>&,
|
||||||
const std::weak_ptr<CMapWorldInfo>&,
|
const std::weak_ptr<CMapWorldInfo>&,
|
||||||
const std::weak_ptr<CPlayerState>&,
|
const std::weak_ptr<CPlayerState>&,
|
||||||
|
@ -264,7 +270,7 @@ public:
|
||||||
void RemoveWeaponId(TUniqueId, EWeaponType);
|
void RemoveWeaponId(TUniqueId, EWeaponType);
|
||||||
void AddWeaponId(TUniqueId, EWeaponType);
|
void AddWeaponId(TUniqueId, EWeaponType);
|
||||||
void UpdateEscapeSequenceTimer(float);
|
void UpdateEscapeSequenceTimer(float);
|
||||||
float GetEscapeSequenceTimer() const;
|
float GetEscapeSequenceTimer() const { return xf0c_escapeTimer; }
|
||||||
void ResetEscapeSequenceTimer(float);
|
void ResetEscapeSequenceTimer(float);
|
||||||
void SetupParticleHook(const CActor& actor) const;
|
void SetupParticleHook(const CActor& actor) const;
|
||||||
void MurderScriptInstanceNames();
|
void MurderScriptInstanceNames();
|
||||||
|
@ -342,6 +348,8 @@ public:
|
||||||
void UpdateAreaSounds();
|
void UpdateAreaSounds();
|
||||||
void FrameEnd();
|
void FrameEnd();
|
||||||
void ProcessPlayerInput();
|
void ProcessPlayerInput();
|
||||||
|
void SetGameState(EGameState state);
|
||||||
|
EGameState GetGameState() const { return x904_gameState; }
|
||||||
void ProcessInput(const CFinalInput& input);
|
void ProcessInput(const CFinalInput& input);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
void UpdateGameState();
|
void UpdateGameState();
|
||||||
|
|
|
@ -109,9 +109,10 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
||||||
player->GetCameraBob()->SetCameraBobTransform(zeus::CTransform::Identity());
|
player->GetCameraBob()->SetCameraBobTransform(zeus::CTransform::Identity());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->x304_ == 4 || player->x304_ == 1)
|
if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Four ||
|
||||||
|
player->GetOrbitState() == CPlayer::EPlayerOrbitState::One)
|
||||||
{
|
{
|
||||||
const CActor* act = TCastToConstPtr<CActor>(mgr.GetObjectById(player->x310_hudPoiId));
|
const CActor* act = TCastToConstPtr<CActor>(mgr.GetObjectById(player->x310_lockonObjectId));
|
||||||
if (act && act->GetMaterialList().Intersection(CMaterialList(EMaterialTypes::Lava)) != 0)
|
if (act && act->GetMaterialList().Intersection(CMaterialList(EMaterialTypes::Lava)) != 0)
|
||||||
{
|
{
|
||||||
zeus::CVector3f v = player->x318_ - eyePos;
|
zeus::CVector3f v = player->x318_ - eyePos;
|
||||||
|
@ -121,7 +122,8 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
||||||
rVec = v;
|
rVec = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (player->x304_ == 0 && player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed &&
|
else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Zero &&
|
||||||
|
player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed &&
|
||||||
player->x3dc_ && x1c4_pitchId == kInvalidUniqueId)
|
player->x3dc_ && x1c4_pitchId == kInvalidUniqueId)
|
||||||
{
|
{
|
||||||
if (player->x294_ > 0.f)
|
if (player->x294_ > 0.f)
|
||||||
|
@ -155,7 +157,8 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
||||||
|
|
||||||
if (player->x3dc_)
|
if (player->x3dc_)
|
||||||
{
|
{
|
||||||
if (player->x304_ == 4 || player->x304_ == 1)
|
if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Four ||
|
||||||
|
player->GetOrbitState() == CPlayer::EPlayerOrbitState::One)
|
||||||
{
|
{
|
||||||
zeus::CVector3f gunFrontVec = gunXf.frontVector();
|
zeus::CVector3f gunFrontVec = gunXf.frontVector();
|
||||||
|
|
||||||
|
@ -173,7 +176,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
||||||
qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, scaledDt * clampedAngle);
|
qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, scaledDt * clampedAngle);
|
||||||
|
|
||||||
const CScriptGrapplePoint* gPoint =
|
const CScriptGrapplePoint* gPoint =
|
||||||
TCastToConstPtr<CScriptGrapplePoint>(mgr.GetObjectById(player->x310_hudPoiId));
|
TCastToConstPtr<CScriptGrapplePoint>(mgr.GetObjectById(player->x310_lockonObjectId));
|
||||||
if (gPoint && player->x29c_ > 0.f)
|
if (gPoint && player->x29c_ > 0.f)
|
||||||
{
|
{
|
||||||
gunFrontVec = x190_gunFollowXf.frontVector();
|
gunFrontVec = x190_gunFollowXf.frontVector();
|
||||||
|
@ -203,12 +206,13 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
||||||
qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, zeus::CRelAngle::FromDegrees(360.f));
|
qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, zeus::CRelAngle::FromDegrees(360.f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (player->x304_ == 2 || player->x304_ == 3)
|
else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Two ||
|
||||||
|
player->GetOrbitState() == CPlayer::EPlayerOrbitState::Three)
|
||||||
{
|
{
|
||||||
dt *= g_tweakPlayer->GetX184();
|
dt *= g_tweakPlayer->GetX184();
|
||||||
CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec);
|
CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec);
|
||||||
}
|
}
|
||||||
else if (player->x304_ == 5)
|
else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Five)
|
||||||
{
|
{
|
||||||
dt *= g_tweakPlayer->GetX2B0();
|
dt *= g_tweakPlayer->GetX2B0();
|
||||||
CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec);
|
CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec);
|
||||||
|
@ -244,8 +248,10 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
||||||
}
|
}
|
||||||
zeus::CTransform bobXf = player->GetCameraBob()->GetCameraBobTransformation();
|
zeus::CTransform bobXf = player->GetCameraBob()->GetCameraBobTransformation();
|
||||||
|
|
||||||
if (player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed || player->x304_ == 5 ||
|
if (player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed ||
|
||||||
player->x3b8_ == 0 || mgr.Get904() == 1 || mgr.GetCameraManager()->IsInCinematicCamera())
|
player->GetOrbitState() == CPlayer::EPlayerOrbitState::Five ||
|
||||||
|
player->x3b8_ == 0 || mgr.GetGameState() == CStateManager::EGameState::SoftPaused ||
|
||||||
|
mgr.GetCameraManager()->IsInCinematicCamera())
|
||||||
{
|
{
|
||||||
bobXf = zeus::CTransform::Identity();
|
bobXf = zeus::CTransform::Identity();
|
||||||
player->GetCameraBob()->SetCameraBobTransform(bobXf);
|
player->GetCameraBob()->SetCameraBobTransform(bobXf);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
const CMaterialFilter CMaterialFilter::skPassEverything({0x00000000FFFFFFFF}, {0}, CMaterialFilter::EFilterType::Include);
|
const CMaterialFilter CMaterialFilter::skPassEverything({0x00000000FFFFFFFF}, {0}, CMaterialFilter::EFilterType::Always);
|
||||||
|
|
||||||
CMaterialFilter::CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, CMaterialFilter::EFilterType type)
|
CMaterialFilter::CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, CMaterialFilter::EFilterType type)
|
||||||
: x0_include(include),
|
: x0_include(include),
|
||||||
|
@ -26,4 +26,23 @@ CMaterialFilter CMaterialFilter::MakeIncludeExclude(const CMaterialList& include
|
||||||
return CMaterialFilter(include, exclude, EFilterType::IncludeExclude);
|
return CMaterialFilter(include, exclude, EFilterType::IncludeExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CMaterialFilter::Passes(const CMaterialList& list) const
|
||||||
|
{
|
||||||
|
switch (x10_type)
|
||||||
|
{
|
||||||
|
case EFilterType::Always:
|
||||||
|
return true;
|
||||||
|
case EFilterType::Include:
|
||||||
|
return (list.x0_list & x0_include.x0_list) != 0;
|
||||||
|
case EFilterType::Exclude:
|
||||||
|
return (list.x0_list & x8_exclude.x0_list) == 0;
|
||||||
|
case EFilterType::IncludeExclude:
|
||||||
|
if ((list.x0_list & x0_include.x0_list) == 0)
|
||||||
|
return false;
|
||||||
|
return (list.x0_list & x8_exclude.x0_list) == 0;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@ class CMaterialFilter
|
||||||
public:
|
public:
|
||||||
enum class EFilterType
|
enum class EFilterType
|
||||||
{
|
{
|
||||||
|
Always,
|
||||||
Include,
|
Include,
|
||||||
One,
|
|
||||||
Exclude,
|
Exclude,
|
||||||
IncludeExclude
|
IncludeExclude
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,7 @@ public:
|
||||||
|
|
||||||
const CMaterialList& GetIncludeList() const { return x0_include; }
|
const CMaterialList& GetIncludeList() const { return x0_include; }
|
||||||
const CMaterialList& GetExcludeList() const { return x8_exclude; }
|
const CMaterialList& GetExcludeList() const { return x8_exclude; }
|
||||||
bool Passes(const CMaterialList&) const { return false; }
|
bool Passes(const CMaterialList&) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // __CMATERIALFILTER_HPP__
|
#endif // __CMATERIALFILTER_HPP__
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "CHudBallInterface.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
void CHudBallInterface::SetBallModeFactor(float t)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,7 +6,8 @@ namespace urde
|
||||||
|
|
||||||
class CHudBallInterface
|
class CHudBallInterface
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
void SetBallModeFactor(float t);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "CHudBossEnergyInterface.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
void CHudBossEnergyInterface::Update(float dt)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,7 +6,10 @@ namespace urde
|
||||||
|
|
||||||
class CHudBossEnergyInterface
|
class CHudBossEnergyInterface
|
||||||
{
|
{
|
||||||
|
float x0_alpha;
|
||||||
|
public:
|
||||||
|
void SetAlpha(float a) { x0_alpha = a; }
|
||||||
|
void Update(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ void CHudDecoInterfaceCombat::Update(float dt, const CStateManager& stateMgr)
|
||||||
x4_rotation, x14_pivotPosition + x20_offset, x2c_camPos));
|
x4_rotation, x14_pivotPosition + x20_offset, x2c_camPos));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceCombat::SetCameraParms(float fov, float y, float z)
|
void CHudDecoInterfaceCombat::UpdateCameraDebugSettings(float fov, float y, float z)
|
||||||
{
|
{
|
||||||
x6c_camera->SetFov(fov);
|
x6c_camera->SetFov(fov);
|
||||||
x2c_camPos.y = y;
|
x2c_camPos.y = y;
|
||||||
|
@ -223,7 +223,7 @@ void CHudDecoInterfaceScan::InitializeFlatFrame()
|
||||||
|
|
||||||
const CScannableObjectInfo* CHudDecoInterfaceScan::GetCurrScanInfo(const CStateManager& stateMgr) const
|
const CScannableObjectInfo* CHudDecoInterfaceScan::GetCurrScanInfo(const CStateManager& stateMgr) const
|
||||||
{
|
{
|
||||||
if (x1d4_latestScanState == CPlayer::EPlayerScanState::Zero)
|
if (x1d4_latestScanState == CPlayer::EPlayerScanState::NotScanning)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if (TCastToConstPtr<CActor> act = stateMgr.GetObjectById(x1d2_latestScanningObject))
|
if (TCastToConstPtr<CActor> act = stateMgr.GetObjectById(x1d2_latestScanningObject))
|
||||||
|
@ -240,9 +240,9 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
|
||||||
{
|
{
|
||||||
if (player.IsNewScanScanning())
|
if (player.IsNewScanScanning())
|
||||||
{
|
{
|
||||||
if (scanState == CPlayer::EPlayerScanState::Two)
|
if (scanState == CPlayer::EPlayerScanState::ScanComplete)
|
||||||
{
|
{
|
||||||
if (x1d4_latestScanState == CPlayer::EPlayerScanState::One)
|
if (x1d4_latestScanState == CPlayer::EPlayerScanState::Scanning)
|
||||||
{
|
{
|
||||||
// Scan complete
|
// Scan complete
|
||||||
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(15));
|
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(15));
|
||||||
|
@ -250,7 +250,7 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
|
||||||
x238_scanningTextAlpha = 2.f;
|
x238_scanningTextAlpha = 2.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scanState == CPlayer::EPlayerScanState::One)
|
else if (scanState == CPlayer::EPlayerScanState::Scanning)
|
||||||
{
|
{
|
||||||
// Scanning
|
// Scanning
|
||||||
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(14));
|
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(14));
|
||||||
|
@ -264,9 +264,9 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
|
||||||
if (player.GetScanningObjectId() != x1d2_latestScanningObject)
|
if (player.GetScanningObjectId() != x1d2_latestScanningObject)
|
||||||
x1d2_latestScanningObject = player.GetScanningObjectId();
|
x1d2_latestScanningObject = player.GetScanningObjectId();
|
||||||
|
|
||||||
if (player.GetHudPOIId() != x1d0_latestHudPoi)
|
if (player.GetLockonObjectId() != x1d0_latestHudPoi)
|
||||||
{
|
{
|
||||||
x1d0_latestHudPoi = player.GetHudPOIId();
|
x1d0_latestHudPoi = player.GetLockonObjectId();
|
||||||
if (x1d0_latestHudPoi != kInvalidUniqueId)
|
if (x1d0_latestHudPoi != kInvalidUniqueId)
|
||||||
{
|
{
|
||||||
if (!player.ObjectInScanningRange(x1d0_latestHudPoi, stateMgr))
|
if (!player.ObjectInScanningRange(x1d0_latestHudPoi, stateMgr))
|
||||||
|
@ -300,7 +300,7 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
|
||||||
x25c_flat_energybart01_scanbar->SetCurrEnergy(x1d8_scanningTime / actScan->GetTotalDownloadTime(),
|
x25c_flat_energybart01_scanbar->SetCurrEnergy(x1d8_scanningTime / actScan->GetTotalDownloadTime(),
|
||||||
CAuiEnergyBarT01::ESetMode::Normal);
|
CAuiEnergyBarT01::ESetMode::Normal);
|
||||||
|
|
||||||
if (x1d4_latestScanState != CPlayer::EPlayerScanState::One)
|
if (x1d4_latestScanState != CPlayer::EPlayerScanState::Scanning)
|
||||||
if (x1d0_latestHudPoi == kInvalidUniqueId || player.ObjectInScanningRange(x1d0_latestHudPoi, stateMgr))
|
if (x1d0_latestHudPoi == kInvalidUniqueId || player.ObjectInScanningRange(x1d0_latestHudPoi, stateMgr))
|
||||||
x238_scanningTextAlpha = std::max(0.f, x238_scanningTextAlpha - dt);
|
x238_scanningTextAlpha = std::max(0.f, x238_scanningTextAlpha - dt);
|
||||||
|
|
||||||
|
@ -338,10 +338,10 @@ void CHudDecoInterfaceScan::Update(float dt, const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
CPlayer& player = stateMgr.GetPlayer();
|
CPlayer& player = stateMgr.GetPlayer();
|
||||||
CPlayer::EPlayerScanState scanState = player.GetScanningState();
|
CPlayer::EPlayerScanState scanState = player.GetScanningState();
|
||||||
if (scanState != CPlayer::EPlayerScanState::Zero)
|
if (scanState != CPlayer::EPlayerScanState::NotScanning)
|
||||||
x1d8_scanningTime = player.GetScanningTime();
|
x1d8_scanningTime = player.GetScanningTime();
|
||||||
|
|
||||||
if (scanState == CPlayer::EPlayerScanState::One || scanState == CPlayer::EPlayerScanState::Two)
|
if (scanState == CPlayer::EPlayerScanState::Scanning || scanState == CPlayer::EPlayerScanState::ScanComplete)
|
||||||
x230_sidesTimer = std::min(x230_sidesTimer + dt, g_tweakGui->GetScanSidesEndTime());
|
x230_sidesTimer = std::min(x230_sidesTimer + dt, g_tweakGui->GetScanSidesEndTime());
|
||||||
else
|
else
|
||||||
x230_sidesTimer = std::max(0.f, x230_sidesTimer - dt);
|
x230_sidesTimer = std::max(0.f, x230_sidesTimer - dt);
|
||||||
|
@ -386,7 +386,7 @@ void CHudDecoInterfaceScan::ProcessInput(const CFinalInput& input)
|
||||||
x18_scanDisplay.ProcessInput(input);
|
x18_scanDisplay.ProcessInput(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceScan::SetCameraParms(float fov, float y, float z)
|
void CHudDecoInterfaceScan::UpdateCameraDebugSettings(float fov, float y, float z)
|
||||||
{
|
{
|
||||||
x244_camera->SetFov(fov);
|
x244_camera->SetFov(fov);
|
||||||
x20c_camPos.y = y;
|
x20c_camPos.y = y;
|
||||||
|
@ -400,131 +400,245 @@ void CHudDecoInterfaceScan::UpdateHudAlpha()
|
||||||
x248_basewidget_pivot->SetColor(color);
|
x248_basewidget_pivot->SetColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
float CHudDecoInterfaceScan::GetMessageTextAlpha() const
|
float CHudDecoInterfaceScan::GetHudTextAlpha() const
|
||||||
{
|
{
|
||||||
return 1.f - std::max(std::min(x238_scanningTextAlpha, 1.f), x18_scanDisplay.x1a8_);
|
return 1.f - std::max(std::min(x238_scanningTextAlpha, 1.f), x18_scanDisplay.x1a8_);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHudDecoInterfaceXRay::CHudDecoInterfaceXRay(CGuiFrame& selHud)
|
CHudDecoInterfaceXRay::CHudDecoInterfaceXRay(CGuiFrame& selHud)
|
||||||
{
|
{
|
||||||
|
xa0_camera = selHud.GetFrameCamera();
|
||||||
|
x30_camPos = xa0_camera->GetLocalPosition();
|
||||||
|
|
||||||
|
x9c_24_visDebug = true;
|
||||||
|
x9c_25_visGame = true;
|
||||||
|
|
||||||
|
xa4_basewidget_pivot = selHud.FindWidget("basewidget_pivot");
|
||||||
|
xa8_basewidget_seeker = selHud.FindWidget("basewidget_seeker");
|
||||||
|
xac_basewidget_rotate = selHud.FindWidget("basewidget_rotate");
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_energydeco"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetXRayEnergyDecoColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_frame"))
|
||||||
|
w->SetDepthWrite(true);
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_frame1"))
|
||||||
|
w->SetDepthWrite(true);
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_frame2"))
|
||||||
|
w->SetDepthWrite(true);
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_frame3"))
|
||||||
|
w->SetDepthWrite(true);
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_misslieslider"))
|
||||||
|
w->SetDepthWrite(true);
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_threatslider"))
|
||||||
|
w->SetDepthWrite(true);
|
||||||
|
|
||||||
|
UpdateHudAlpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::UpdateVisibility()
|
void CHudDecoInterfaceXRay::UpdateVisibility()
|
||||||
{
|
{
|
||||||
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetIsVisibleDebug(bool v)
|
void CHudDecoInterfaceXRay::SetIsVisibleDebug(bool v)
|
||||||
{
|
{
|
||||||
|
x9c_24_visDebug = v;
|
||||||
|
UpdateVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetIsVisibleGame(bool v)
|
void CHudDecoInterfaceXRay::SetIsVisibleGame(bool v)
|
||||||
{
|
{
|
||||||
|
x9c_25_visGame = v;
|
||||||
|
UpdateVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetHudRotation(const zeus::CQuaternion& rot)
|
void CHudDecoInterfaceXRay::SetHudRotation(const zeus::CQuaternion& rot)
|
||||||
{
|
{
|
||||||
|
x8_rotation = rot;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetHudOffset(const zeus::CVector3f& off)
|
void CHudDecoInterfaceXRay::SetHudOffset(const zeus::CVector3f& off)
|
||||||
{
|
{
|
||||||
|
x24_offset = off;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetReticuleTransform(const zeus::CMatrix3f& xf)
|
void CHudDecoInterfaceXRay::SetReticuleTransform(const zeus::CMatrix3f& xf)
|
||||||
{
|
{
|
||||||
|
x3c_reticuleXf = xf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::UpdateTransforms()
|
void CHudDecoInterfaceXRay::SetDecoRotation(float angle)
|
||||||
{
|
{
|
||||||
|
xac_basewidget_rotate->SetLocalTransform(zeus::CTransform(zeus::CMatrix3f::RotateY(angle),
|
||||||
|
xac_basewidget_rotate->GetLocalPosition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetDamageTransform(const zeus::CMatrix3f& rotation,
|
void CHudDecoInterfaceXRay::SetDamageTransform(const zeus::CMatrix3f& rotation,
|
||||||
const zeus::CVector3f& position)
|
const zeus::CVector3f& position)
|
||||||
{
|
{
|
||||||
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetFrameColorValue(float v)
|
void CHudDecoInterfaceXRay::SetFrameColorValue(float v)
|
||||||
{
|
{
|
||||||
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::Update(float dt, const CStateManager& stateMgr)
|
void CHudDecoInterfaceXRay::Update(float dt, const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
|
if (stateMgr.GetPlayer().GetOrbitState() == CPlayer::EPlayerOrbitState::One)
|
||||||
|
x4_seekerScale = std::max(x4_seekerScale - 3.f * dt, 0.35f);
|
||||||
|
else
|
||||||
|
x4_seekerScale = std::min(3.f * dt + x4_seekerScale, 1.f);
|
||||||
|
|
||||||
|
xa0_camera->SetO2WTransform(
|
||||||
|
MP1::CSamusHud::BuildFinalCameraTransform(x8_rotation, x18_pivotPosition + x24_offset, x30_camPos));
|
||||||
|
|
||||||
|
xa8_basewidget_seeker->SetLocalTransform(
|
||||||
|
zeus::CTransform(zeus::CMatrix3f(x4_seekerScale) * x3c_reticuleXf, x60_seekerPosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::SetCameraParms(float fov, float y, float z)
|
void CHudDecoInterfaceXRay::UpdateCameraDebugSettings(float fov, float y, float z)
|
||||||
{
|
{
|
||||||
|
xa0_camera->SetFov(fov);
|
||||||
|
x30_camPos.y = y;
|
||||||
|
x30_camPos.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceXRay::UpdateHudAlpha()
|
void CHudDecoInterfaceXRay::UpdateHudAlpha()
|
||||||
{
|
{
|
||||||
|
zeus::CColor color = zeus::CColor::skWhite;
|
||||||
|
color.a = g_GameState->GameOptions().GetHUDAlpha() / 255.f;
|
||||||
|
xa4_basewidget_pivot->SetColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHudDecoInterfaceThermal::CHudDecoInterfaceThermal(CGuiFrame& selHud)
|
CHudDecoInterfaceThermal::CHudDecoInterfaceThermal(CGuiFrame& selHud)
|
||||||
{
|
{
|
||||||
|
x70_24_visDebug = true;
|
||||||
|
x70_25_visGame = true;
|
||||||
|
|
||||||
|
x74_camera = selHud.GetFrameCamera();
|
||||||
|
x2c_camPos = x74_camera->GetLocalPosition();
|
||||||
|
|
||||||
|
x78_basewidget_pivot = selHud.FindWidget("basewidget_pivot");
|
||||||
|
x7c_basewidget_reticle = selHud.FindWidget("basewidget_reticle");
|
||||||
|
x80_model_retflash = static_cast<CGuiModel*>(selHud.FindWidget("model_retflash"));
|
||||||
|
|
||||||
|
x14_pivotPosition = x78_basewidget_pivot->GetIdlePosition();
|
||||||
|
x5c_reticulePosition = x7c_basewidget_reticle->GetIdlePosition();
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_deco"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalDecoColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_oultlinesa"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalOutlinesColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_lock"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalLockColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_reticle"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalOutlinesColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_lockon"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalOutlinesColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_threaticon"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalOutlinesColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("model_missileicon"))
|
||||||
|
w->SetColor(g_tweakGuiColors->GetThermalOutlinesColor());
|
||||||
|
|
||||||
|
if (CGuiWidget* w = selHud.FindWidget("basewidget_lock"))
|
||||||
|
{
|
||||||
|
for (CGuiWidget* c = static_cast<CGuiWidget*>(w->GetChildObject()); c;
|
||||||
|
c = static_cast<CGuiWidget*>(c->GetNextSibling()))
|
||||||
|
{
|
||||||
|
x84_lockonWidgets.push_back({c, c->GetLocalTransform()});
|
||||||
|
c->SetLocalTransform(c->GetLocalTransform() * zeus::CTransform::Scale(x68_lockonScale));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
x14_pivotPosition = x78_basewidget_pivot->GetIdlePosition();
|
||||||
|
UpdateHudAlpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::UpdateVisibility()
|
void CHudDecoInterfaceThermal::UpdateVisibility()
|
||||||
{
|
{
|
||||||
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetIsVisibleDebug(bool v)
|
void CHudDecoInterfaceThermal::SetIsVisibleDebug(bool v)
|
||||||
{
|
{
|
||||||
|
x70_24_visDebug = v;
|
||||||
|
UpdateVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetIsVisibleGame(bool v)
|
void CHudDecoInterfaceThermal::SetIsVisibleGame(bool v)
|
||||||
{
|
{
|
||||||
|
x70_25_visGame = v;
|
||||||
|
UpdateVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetHudRotation(const zeus::CQuaternion& rot)
|
void CHudDecoInterfaceThermal::SetHudRotation(const zeus::CQuaternion& rot)
|
||||||
{
|
{
|
||||||
|
x4_rotation = rot;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetHudOffset(const zeus::CVector3f& off)
|
void CHudDecoInterfaceThermal::SetHudOffset(const zeus::CVector3f& off)
|
||||||
{
|
{
|
||||||
|
x20_offset = off;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetReticuleTransform(const zeus::CMatrix3f& xf)
|
void CHudDecoInterfaceThermal::SetReticuleTransform(const zeus::CMatrix3f& xf)
|
||||||
{
|
{
|
||||||
|
x38_reticuleXf = xf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetDamageTransform(const zeus::CMatrix3f& rotation,
|
void CHudDecoInterfaceThermal::SetDamageTransform(const zeus::CMatrix3f& rotation,
|
||||||
const zeus::CVector3f& position)
|
const zeus::CVector3f& position)
|
||||||
{
|
{
|
||||||
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::Update(float dt, const CStateManager& stateMgr)
|
void CHudDecoInterfaceThermal::Update(float dt, const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
|
float oldLockonScale = x68_lockonScale;
|
||||||
|
if (stateMgr.GetPlayer().GetLockonObjectId() != kInvalidUniqueId)
|
||||||
|
x68_lockonScale = std::max(x68_lockonScale - 15.f * dt, 1.f);
|
||||||
|
else
|
||||||
|
x68_lockonScale = std::min(x68_lockonScale + 15.f * dt, 5.f);
|
||||||
|
|
||||||
|
if (oldLockonScale != x68_lockonScale)
|
||||||
|
for (auto& lockWidget : x84_lockonWidgets)
|
||||||
|
lockWidget.first->SetLocalTransform(lockWidget.second * zeus::CTransform::Scale(x68_lockonScale));
|
||||||
|
|
||||||
|
x6c_retflashTimer += dt;
|
||||||
|
if (x6c_retflashTimer > 1.f)
|
||||||
|
x6c_retflashTimer -= 2.f;
|
||||||
|
|
||||||
|
zeus::CColor flashColor = zeus::CColor::skWhite;
|
||||||
|
flashColor.a = std::fabs(x6c_retflashTimer) * 0.5f + 0.5f;
|
||||||
|
x80_model_retflash->SetColor(flashColor);
|
||||||
|
|
||||||
|
x74_camera->SetO2WTransform(
|
||||||
|
MP1::CSamusHud::BuildFinalCameraTransform(x4_rotation, x14_pivotPosition + x20_offset, x2c_camPos));
|
||||||
|
|
||||||
|
x7c_basewidget_reticle->SetLocalTransform(zeus::CTransform(x38_reticuleXf, x5c_reticulePosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::SetCameraParms(float fov, float y, float z)
|
void CHudDecoInterfaceThermal::UpdateCameraDebugSettings(float fov, float y, float z)
|
||||||
{
|
{
|
||||||
|
x74_camera->SetFov(fov);
|
||||||
|
x2c_camPos.y = y;
|
||||||
|
x2c_camPos.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudDecoInterfaceThermal::UpdateHudAlpha()
|
void CHudDecoInterfaceThermal::UpdateHudAlpha()
|
||||||
{
|
{
|
||||||
|
zeus::CColor color = zeus::CColor::skWhite;
|
||||||
|
color.a = g_GameState->GameOptions().GetHUDAlpha() / 255.f;
|
||||||
|
x78_basewidget_pivot->SetColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,15 +26,15 @@ public:
|
||||||
virtual void SetHudRotation(const zeus::CQuaternion& rot)=0;
|
virtual void SetHudRotation(const zeus::CQuaternion& rot)=0;
|
||||||
virtual void SetHudOffset(const zeus::CVector3f& off)=0;
|
virtual void SetHudOffset(const zeus::CVector3f& off)=0;
|
||||||
virtual void SetReticuleTransform(const zeus::CMatrix3f& xf) {}
|
virtual void SetReticuleTransform(const zeus::CMatrix3f& xf) {}
|
||||||
virtual void UpdateTransforms() {}
|
virtual void SetDecoRotation(float angle) {}
|
||||||
virtual void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position)=0;
|
virtual void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position)=0;
|
||||||
virtual void SetFrameColorValue(float v);
|
virtual void SetFrameColorValue(float v);
|
||||||
virtual void Update(float dt, const CStateManager& stateMgr)=0;
|
virtual void Update(float dt, const CStateManager& stateMgr)=0;
|
||||||
virtual void Draw() const {}
|
virtual void Draw() const {}
|
||||||
virtual void ProcessInput(const CFinalInput& input) {}
|
virtual void ProcessInput(const CFinalInput& input) {}
|
||||||
virtual void SetCameraParms(float fov, float y, float z)=0;
|
virtual void UpdateCameraDebugSettings(float fov, float y, float z)=0;
|
||||||
virtual void UpdateHudAlpha()=0;
|
virtual void UpdateHudAlpha()=0;
|
||||||
virtual float GetMessageTextAlpha() const { return 1.f; }
|
virtual float GetHudTextAlpha() const { return 1.f; }
|
||||||
virtual ~IHudDecoInterface() = default;
|
virtual ~IHudDecoInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position);
|
void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position);
|
||||||
void SetFrameColorValue(float v);
|
void SetFrameColorValue(float v);
|
||||||
void Update(float dt, const CStateManager& stateMgr);
|
void Update(float dt, const CStateManager& stateMgr);
|
||||||
void SetCameraParms(float fov, float y, float z);
|
void UpdateCameraDebugSettings(float fov, float y, float z);
|
||||||
void UpdateHudAlpha();
|
void UpdateHudAlpha();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class CHudDecoInterfaceScan : public IHudDecoInterface
|
||||||
CScanDisplay x18_scanDisplay;
|
CScanDisplay x18_scanDisplay;
|
||||||
TUniqueId x1d0_latestHudPoi = kInvalidUniqueId;
|
TUniqueId x1d0_latestHudPoi = kInvalidUniqueId;
|
||||||
TUniqueId x1d2_latestScanningObject = kInvalidUniqueId;
|
TUniqueId x1d2_latestScanningObject = kInvalidUniqueId;
|
||||||
CPlayer::EPlayerScanState x1d4_latestScanState = CPlayer::EPlayerScanState::Zero;
|
CPlayer::EPlayerScanState x1d4_latestScanState = CPlayer::EPlayerScanState::NotScanning;
|
||||||
float x1d8_scanningTime = 0.f;
|
float x1d8_scanningTime = 0.f;
|
||||||
float x1dc_ = 0.f;
|
float x1dc_ = 0.f;
|
||||||
float x1e0_ = 1.f;
|
float x1e0_ = 1.f;
|
||||||
|
@ -120,13 +120,28 @@ public:
|
||||||
void Update(float dt, const CStateManager& stateMgr);
|
void Update(float dt, const CStateManager& stateMgr);
|
||||||
void Draw() const;
|
void Draw() const;
|
||||||
void ProcessInput(const CFinalInput& input);
|
void ProcessInput(const CFinalInput& input);
|
||||||
void SetCameraParms(float fov, float y, float z);
|
void UpdateCameraDebugSettings(float fov, float y, float z);
|
||||||
void UpdateHudAlpha();
|
void UpdateHudAlpha();
|
||||||
float GetMessageTextAlpha() const;
|
float GetHudTextAlpha() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHudDecoInterfaceXRay : public IHudDecoInterface
|
class CHudDecoInterfaceXRay : public IHudDecoInterface
|
||||||
{
|
{
|
||||||
|
float x4_seekerScale = 1.f;
|
||||||
|
zeus::CQuaternion x8_rotation;
|
||||||
|
zeus::CVector3f x18_pivotPosition;
|
||||||
|
zeus::CVector3f x24_offset;
|
||||||
|
zeus::CVector3f x30_camPos;
|
||||||
|
zeus::CMatrix3f x3c_reticuleXf;
|
||||||
|
zeus::CVector3f x60_seekerPosition;
|
||||||
|
zeus::CVector3f x6c_;
|
||||||
|
zeus::CMatrix3f x78_;
|
||||||
|
bool x9c_24_visDebug : 1;
|
||||||
|
bool x9c_25_visGame : 1;
|
||||||
|
CGuiCamera* xa0_camera;
|
||||||
|
CGuiWidget* xa4_basewidget_pivot;
|
||||||
|
CGuiWidget* xa8_basewidget_seeker;
|
||||||
|
CGuiWidget* xac_basewidget_rotate;
|
||||||
void UpdateVisibility();
|
void UpdateVisibility();
|
||||||
public:
|
public:
|
||||||
CHudDecoInterfaceXRay(CGuiFrame& selHud);
|
CHudDecoInterfaceXRay(CGuiFrame& selHud);
|
||||||
|
@ -135,16 +150,31 @@ public:
|
||||||
void SetHudRotation(const zeus::CQuaternion& rot);
|
void SetHudRotation(const zeus::CQuaternion& rot);
|
||||||
void SetHudOffset(const zeus::CVector3f& off);
|
void SetHudOffset(const zeus::CVector3f& off);
|
||||||
void SetReticuleTransform(const zeus::CMatrix3f& xf);
|
void SetReticuleTransform(const zeus::CMatrix3f& xf);
|
||||||
void UpdateTransforms();
|
void SetDecoRotation(float angle);
|
||||||
void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position);
|
void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position);
|
||||||
void SetFrameColorValue(float v);
|
void SetFrameColorValue(float v);
|
||||||
void Update(float dt, const CStateManager& stateMgr);
|
void Update(float dt, const CStateManager& stateMgr);
|
||||||
void SetCameraParms(float fov, float y, float z);
|
void UpdateCameraDebugSettings(float fov, float y, float z);
|
||||||
void UpdateHudAlpha();
|
void UpdateHudAlpha();
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHudDecoInterfaceThermal : public IHudDecoInterface
|
class CHudDecoInterfaceThermal : public IHudDecoInterface
|
||||||
{
|
{
|
||||||
|
zeus::CQuaternion x4_rotation;
|
||||||
|
zeus::CVector3f x14_pivotPosition;
|
||||||
|
zeus::CVector3f x20_offset;
|
||||||
|
zeus::CVector3f x2c_camPos;
|
||||||
|
zeus::CMatrix3f x38_reticuleXf;
|
||||||
|
zeus::CVector3f x5c_reticulePosition;
|
||||||
|
float x68_lockonScale = 5.f;
|
||||||
|
float x6c_retflashTimer = 0.f;
|
||||||
|
bool x70_24_visDebug : 1;
|
||||||
|
bool x70_25_visGame : 1;
|
||||||
|
CGuiCamera* x74_camera;
|
||||||
|
CGuiWidget* x78_basewidget_pivot;
|
||||||
|
CGuiWidget* x7c_basewidget_reticle;
|
||||||
|
CGuiModel* x80_model_retflash;
|
||||||
|
std::vector<std::pair<CGuiWidget*, zeus::CTransform>> x84_lockonWidgets;
|
||||||
void UpdateVisibility();
|
void UpdateVisibility();
|
||||||
public:
|
public:
|
||||||
CHudDecoInterfaceThermal(CGuiFrame& selHud);
|
CHudDecoInterfaceThermal(CGuiFrame& selHud);
|
||||||
|
@ -155,7 +185,7 @@ public:
|
||||||
void SetReticuleTransform(const zeus::CMatrix3f& xf);
|
void SetReticuleTransform(const zeus::CMatrix3f& xf);
|
||||||
void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position);
|
void SetDamageTransform(const zeus::CMatrix3f& rotation, const zeus::CVector3f& position);
|
||||||
void Update(float dt, const CStateManager& stateMgr);
|
void Update(float dt, const CStateManager& stateMgr);
|
||||||
void SetCameraParms(float fov, float y, float z);
|
void UpdateCameraDebugSettings(float fov, float y, float z);
|
||||||
void UpdateHudAlpha();
|
void UpdateHudAlpha();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "CHudEnergyInterface.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
void CHudEnergyInterfaceBall::Update(float dt, float energyLowPulse)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,7 +6,8 @@ namespace urde
|
||||||
|
|
||||||
class CHudEnergyInterfaceBall
|
class CHudEnergyInterfaceBall
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
void Update(float dt, float energyLowPulse);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,20 @@ CHudFreeLookInterfaceCombat::CHudFreeLookInterfaceCombat(CGuiFrame& selHud, bool
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHudFreeLookInterfaceCombat::Update(float dt)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
CHudFreeLookInterfaceXRay::CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool,
|
CHudFreeLookInterfaceXRay::CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool,
|
||||||
bool, bool grapplePoint)
|
bool, bool grapplePoint)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHudFreeLookInterfaceXRay::Update(float dt)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,18 +9,21 @@ class IFreeLookInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~IFreeLookInterface() = default;
|
virtual ~IFreeLookInterface() = default;
|
||||||
|
virtual void Update(float dt)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHudFreeLookInterfaceCombat : public IFreeLookInterface
|
class CHudFreeLookInterfaceCombat : public IFreeLookInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHudFreeLookInterfaceCombat(CGuiFrame& selHud, bool, bool, bool, bool grapplePoint);
|
CHudFreeLookInterfaceCombat(CGuiFrame& selHud, bool, bool, bool, bool grapplePoint);
|
||||||
|
void Update(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHudFreeLookInterfaceXRay : public IFreeLookInterface
|
class CHudFreeLookInterfaceXRay : public IFreeLookInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool, bool, bool grapplePoint);
|
CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool, bool, bool grapplePoint);
|
||||||
|
void Update(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,21 @@ CHudHelmetInterface::CHudHelmetInterface(CGuiFrame& helmetFrame)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHudHelmetInterface::Update(float dt)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CHudHelmetInterface::SetIsVisibleDebug(bool helmet, bool glow)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CHudHelmetInterface::UpdateCameraDebugSettings(float fov, float y, float z)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CHudHelmetInterface::UpdateHelmetAlpha()
|
void CHudHelmetInterface::UpdateHelmetAlpha()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ class CHudHelmetInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHudHelmetInterface(CGuiFrame& helmetFrame);
|
CHudHelmetInterface(CGuiFrame& helmetFrame);
|
||||||
|
void Update(float dt);
|
||||||
|
void SetIsVisibleDebug(bool helmet, bool glow);
|
||||||
|
void UpdateCameraDebugSettings(float fov, float y, float z);
|
||||||
void UpdateHelmetAlpha();
|
void UpdateHelmetAlpha();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "CHudMissileInterface.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
void CHudMissileInterfaceCombat::Update(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -3,10 +3,12 @@
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
class CStateManager;
|
||||||
|
|
||||||
class CHudMissileInterfaceCombat
|
class CHudMissileInterfaceCombat
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
void Update(float dt, const CStateManager& mgr);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,9 @@ CHudRadarInterface::CHudRadarInterface(CGuiFrame& selHud, CStateManager& stateMg
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHudRadarInterface::Update(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ class CHudRadarInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHudRadarInterface(CGuiFrame& selHud, CStateManager& stateMgr);
|
CHudRadarInterface(CGuiFrame& selHud, CStateManager& stateMgr);
|
||||||
|
void Update(float dt, const CStateManager& mgr);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "CHudThreatInterface.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
void CHudThreatInterfaceCombat::Update(float dt)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -9,12 +9,14 @@ class IHudThreatInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~IHudThreatInterface() = default;
|
virtual ~IHudThreatInterface() = default;
|
||||||
|
virtual void Update(float dt)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHudThreatInterfaceCombat : public IHudThreatInterface
|
class CHudThreatInterfaceCombat : public IHudThreatInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHudThreatInterfaceCombat(CGuiFrame& selHud, float);
|
CHudThreatInterfaceCombat(CGuiFrame& selHud, float);
|
||||||
|
void Update(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,4 +9,14 @@ CHudVisorBeamMenu::CHudVisorBeamMenu(CGuiFrame* baseHud, EHudVisorBeamMenu type,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHudVisorBeamMenu::Update(float dt, bool init)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CHudVisorBeamMenu::UpdateHudAlpha(float alpha)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ public:
|
||||||
private:
|
private:
|
||||||
public:
|
public:
|
||||||
CHudVisorBeamMenu(CGuiFrame* baseHud, EHudVisorBeamMenu type, rstl::prereserved_vector<bool, 4> enables);
|
CHudVisorBeamMenu(CGuiFrame* baseHud, EHudVisorBeamMenu type, rstl::prereserved_vector<bool, 4> enables);
|
||||||
|
void Update(float dt, bool init);
|
||||||
|
void UpdateHudAlpha(float alpha);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ set(GUISYS_SOURCES
|
||||||
CCompoundTargetReticle.hpp CCompoundTargetReticle.cpp
|
CCompoundTargetReticle.hpp CCompoundTargetReticle.cpp
|
||||||
COrbitPointMarker.hpp COrbitPointMarker.cpp
|
COrbitPointMarker.hpp COrbitPointMarker.cpp
|
||||||
CHudEnergyInterface.hpp CHudEnergyInterface.cpp
|
CHudEnergyInterface.hpp CHudEnergyInterface.cpp
|
||||||
|
CHudBossEnergyInterface.hpp CHudBossEnergyInterface.cpp
|
||||||
CHudThreatInterface.hpp CHudThreatInterface.cpp
|
CHudThreatInterface.hpp CHudThreatInterface.cpp
|
||||||
CHudMissileInterface.hpp CHudMissileInterface.cpp
|
CHudMissileInterface.hpp CHudMissileInterface.cpp
|
||||||
CHudFreeLookInterface.hpp CHudFreeLookInterface.cpp
|
CHudFreeLookInterface.hpp CHudFreeLookInterface.cpp
|
||||||
|
|
|
@ -8,4 +8,14 @@ CTargetingManager::CTargetingManager(const CStateManager&)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CTargetingManager::CheckLoadComplete()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CTargetingManager::Update(float dt, const CStateManager& stateMgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,13 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
|
void CRumbleManager::SetDisabled(bool disabled)
|
||||||
|
{
|
||||||
|
if (disabled)
|
||||||
|
x0_rumbleGenerator.HardStopAll();
|
||||||
|
xf0_24_disabled = disabled;
|
||||||
|
}
|
||||||
|
|
||||||
void CRumbleManager::Update(float dt) { x0_rumbleGenerator.Update(dt); }
|
void CRumbleManager::Update(float dt) { x0_rumbleGenerator.Update(dt); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,11 @@ class CStateManager;
|
||||||
class CRumbleManager
|
class CRumbleManager
|
||||||
{
|
{
|
||||||
CRumbleGenerator x0_rumbleGenerator;
|
CRumbleGenerator x0_rumbleGenerator;
|
||||||
|
bool xf0_24_disabled : 1;
|
||||||
public:
|
public:
|
||||||
CRumbleManager() = default;
|
CRumbleManager() { xf0_24_disabled = false; }
|
||||||
|
bool IsDisabled() const { return xf0_24_disabled; }
|
||||||
|
void SetDisabled(bool disabled);
|
||||||
void Update(float);
|
void Update(float);
|
||||||
void StopRumble(u16) {}
|
void StopRumble(u16) {}
|
||||||
void Rumble(CStateManager&, ERumbleFxId, ERumblePriority priority) {}
|
void Rumble(CStateManager&, ERumbleFxId, ERumblePriority priority) {}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "GuiSys/CGuiLight.hpp"
|
#include "GuiSys/CGuiLight.hpp"
|
||||||
#include "GuiSys/CGuiModel.hpp"
|
#include "GuiSys/CGuiModel.hpp"
|
||||||
#include "GuiSys/CGuiCamera.hpp"
|
#include "GuiSys/CGuiCamera.hpp"
|
||||||
|
#include "Camera/CFirstPersonCamera.hpp"
|
||||||
|
#include "TCastTo.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
@ -20,22 +22,24 @@ CSamusHud::CSamusHud(CStateManager& stateMgr)
|
||||||
x258_frmeHelmet(g_SimplePool->GetObj("FRME_Helmet")),
|
x258_frmeHelmet(g_SimplePool->GetObj("FRME_Helmet")),
|
||||||
x268_frmeBaseHud(g_SimplePool->GetObj("FRME_BaseHud"))
|
x268_frmeBaseHud(g_SimplePool->GetObj("FRME_BaseHud"))
|
||||||
{
|
{
|
||||||
x2e0_26_ = true;
|
x2e0_26_latestFirstPerson = true;
|
||||||
x2e0_27_energyLow = stateMgr.GetPlayer().IsEnergyLow(stateMgr);
|
x2e0_27_energyLow = stateMgr.GetPlayer().IsEnergyLow(stateMgr);
|
||||||
x33c_lights = std::make_unique<CActorLights>(8, zeus::CVector3f::skZero, 4, 1, true, 0, 0, 0.1f);
|
x33c_lights = std::make_unique<CActorLights>(8, zeus::CVector3f::skZero, 4, 1, true, 0, 0, 0.1f);
|
||||||
x340_hudLights.resize(3, SCachedHudLight(zeus::CVector3f::skZero, zeus::CColor::skWhite,
|
x340_hudLights.resize(3, SCachedHudLight(zeus::CVector3f::skZero, zeus::CColor::skWhite,
|
||||||
0.f, 0.f, 0.f, 0.f));
|
0.f, 0.f, 0.f, 0.f));
|
||||||
x46c_.resize(3);
|
x46c_.resize(3);
|
||||||
|
x568_fpCamDir = stateMgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform().basis[1];
|
||||||
x5a4_videoBands.resize(4);
|
x5a4_videoBands.resize(4);
|
||||||
x5d8_guiLights.resize(4);
|
x5d8_guiLights.resize(4);
|
||||||
|
x7ac_.resize(15);
|
||||||
UpdateStateTransition(1.f, stateMgr);
|
UpdateStateTransition(1.f, stateMgr);
|
||||||
|
|
||||||
for (int i=0 ; i<16 ; ++i)
|
for (int i=0 ; i<16 ; ++i)
|
||||||
x5ec_[i] = 5.f * i + 40.f;
|
x5ec_camFovTweaks[i] = 5.f * i + 40.f;
|
||||||
for (int i=0 ; i<64 ; ++i)
|
for (int i=0 ; i<64 ; ++i)
|
||||||
x62c_[i] = -0.5f * i;
|
x62c_camYTweaks[i] = -0.5f * i;
|
||||||
for (int i=0 ; i<32 ; ++i)
|
for (int i=0 ; i<32 ; ++i)
|
||||||
x72c_[i] = 0.5f * i - 8.f;
|
x72c_camZTweaks[i] = 0.5f * i - 8.f;
|
||||||
|
|
||||||
x264_loadedFrmeHelmet = x258_frmeHelmet.GetObj();
|
x264_loadedFrmeHelmet = x258_frmeHelmet.GetObj();
|
||||||
x274_loadedFrmeBaseHud = x268_frmeBaseHud.GetObj();
|
x274_loadedFrmeBaseHud = x268_frmeBaseHud.GetObj();
|
||||||
|
@ -119,21 +123,112 @@ void CSamusHud::InitializeFrameGlueMutable(const CStateManager& mgr)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UninitializeFrameGlueMutable()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CSamusHud::UpdateEnergy(float dt, const CStateManager& mgr, bool init)
|
void CSamusHud::UpdateEnergy(float dt, const CStateManager& mgr, bool init)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateFreeLook(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CSamusHud::UpdateMissile(float dt, const CStateManager& mgr, bool init)
|
void CSamusHud::UpdateMissile(float dt, const CStateManager& mgr, bool init)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateVideoBands(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CSamusHud::UpdateBallMode(const CStateManager& mgr, bool init)
|
void CSamusHud::UpdateBallMode(const CStateManager& mgr, bool init)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateThreatAssessment(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateVisorAndBeamMenus(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateCameraDebugSettings()
|
||||||
|
{
|
||||||
|
float fov = x5ec_camFovTweaks[g_tweakGui->GetHudCamFovTweak()];
|
||||||
|
float y = x62c_camYTweaks[g_tweakGui->GetHudCamYTweak()];
|
||||||
|
float z = x72c_camZTweaks[g_tweakGui->GetHudCamZTweak()];
|
||||||
|
if (x2a0_helmetIntf)
|
||||||
|
x2a0_helmetIntf->UpdateCameraDebugSettings(fov, y, z);
|
||||||
|
if (x29c_decoIntf)
|
||||||
|
x29c_decoIntf->UpdateCameraDebugSettings(fov, y, z);
|
||||||
|
x274_loadedFrmeBaseHud->GetFrameCamera()->SetFov(fov);
|
||||||
|
x310_cameraPos.y = y;
|
||||||
|
x310_cameraPos.z = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateEnergyLow(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
bool cineCam = TCastToConstPtr<CCinematicCamera>(mgr.GetCameraManager()->GetCurrentCamera(mgr));
|
||||||
|
float oldTimer = x57c_energyLowTimer;
|
||||||
|
|
||||||
|
x57c_energyLowTimer = std::fmod(x57c_energyLowTimer + dt, 0.5f);
|
||||||
|
if (x57c_energyLowTimer < 0.25f)
|
||||||
|
x580_energyLowPulse = x57c_energyLowTimer / 0.25f;
|
||||||
|
else
|
||||||
|
x580_energyLowPulse = (0.5f - x57c_energyLowTimer) / 0.25f;
|
||||||
|
|
||||||
|
if (!cineCam && x2e0_27_energyLow && x57c_energyLowTimer < oldTimer)
|
||||||
|
CSfxManager::SfxStart(1405, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateHudLag(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateHudDamage(float dt, const CStateManager& mgr,
|
||||||
|
DataSpec::ITweakGui::EHelmetVisMode helmetVis)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateStaticInterference(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::ShowDamage(const zeus::CVector3f& position, float dam, float prevDam,
|
||||||
|
const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::EnterFirstPerson(const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::LeaveFirstPerson(const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
EHudState CSamusHud::GetDesiredHudState(const CStateManager& mgr)
|
EHudState CSamusHud::GetDesiredHudState(const CStateManager& mgr)
|
||||||
{
|
{
|
||||||
if (mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed ||
|
if (mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed ||
|
||||||
|
@ -155,19 +250,405 @@ EHudState CSamusHud::GetDesiredHudState(const CStateManager& mgr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSamusHud::UpdateStateTransition(float time, const CStateManager& mgr)
|
void CSamusHud::Update(float dt, const CStateManager& mgr,
|
||||||
|
DataSpec::ITweakGui::EHelmetVisMode helmetVis,
|
||||||
|
bool hudVis, bool targetingManager)
|
||||||
{
|
{
|
||||||
|
CPlayer& player = mgr.GetPlayer();
|
||||||
|
UpdateStateTransition(dt, mgr);
|
||||||
|
bool firstPerson = player.GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed &&
|
||||||
|
!mgr.GetCameraManager()->IsInCinematicCamera();
|
||||||
|
if (firstPerson != x2e0_26_latestFirstPerson)
|
||||||
|
{
|
||||||
|
if (firstPerson)
|
||||||
|
EnterFirstPerson(mgr);
|
||||||
|
else
|
||||||
|
LeaveFirstPerson(mgr);
|
||||||
|
x2e0_26_latestFirstPerson = firstPerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
float morphT = 0.f;
|
||||||
|
switch (player.GetMorphballTransitionState())
|
||||||
|
{
|
||||||
|
case CPlayer::EPlayerMorphBallState::Morphed:
|
||||||
|
morphT = 1.f;
|
||||||
|
break;
|
||||||
|
case CPlayer::EPlayerMorphBallState::Morphing:
|
||||||
|
if (player.GetMorphDuration() == 0.f)
|
||||||
|
morphT = 0.f;
|
||||||
|
else
|
||||||
|
morphT = zeus::clamp(0.f, player.GetMorphTime() / player.GetMorphDuration(), 1.f);
|
||||||
|
break;
|
||||||
|
case CPlayer::EPlayerMorphBallState::Unmorphing:
|
||||||
|
if (player.GetMorphDuration() != 0.f)
|
||||||
|
morphT = zeus::clamp(0.f, player.GetMorphTime() / player.GetMorphDuration(), 1.f);
|
||||||
|
morphT = 1.f - morphT;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
x500_viewportScale.y = 1.f - morphT * g_tweakGui->GetBallViewportYReduction();
|
||||||
|
if (x2b0_ballIntf)
|
||||||
|
x2b0_ballIntf->SetBallModeFactor(morphT);
|
||||||
|
|
||||||
|
bool helmetVisible = false;
|
||||||
|
bool glowVisible = false;
|
||||||
|
bool decoVisible = false;
|
||||||
|
if (player.GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed)
|
||||||
|
{
|
||||||
|
switch (helmetVis)
|
||||||
|
{
|
||||||
|
case DataSpec::ITweakGui::EHelmetVisMode::HelmetOnly:
|
||||||
|
helmetVisible = true;
|
||||||
|
break;
|
||||||
|
case DataSpec::ITweakGui::EHelmetVisMode::GlowHelmetDeco:
|
||||||
|
glowVisible = true;
|
||||||
|
case DataSpec::ITweakGui::EHelmetVisMode::HelmetDeco:
|
||||||
|
helmetVisible = true;
|
||||||
|
case DataSpec::ITweakGui::EHelmetVisMode::Deco:
|
||||||
|
decoVisible = true;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x29c_decoIntf)
|
||||||
|
x29c_decoIntf->SetIsVisibleDebug(decoVisible);
|
||||||
|
if (x2a0_helmetIntf)
|
||||||
|
x2a0_helmetIntf->SetIsVisibleDebug(helmetVisible, glowVisible);
|
||||||
|
|
||||||
|
x590_base_Model_AutoMapper->SetIsVisible(false);
|
||||||
|
|
||||||
|
UpdateEnergyLow(dt, mgr);
|
||||||
|
|
||||||
|
for (int i=0 ; i<15 ; ++i)
|
||||||
|
{
|
||||||
|
x7ac_[i].x0_ = 0;
|
||||||
|
x7ac_[i].x4_ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x2ac_radarIntf)
|
||||||
|
x2ac_radarIntf->Update(dt, mgr);
|
||||||
|
|
||||||
|
UpdateHudLag(dt, mgr);
|
||||||
|
|
||||||
|
UpdateHudDynamicLights(dt, mgr);
|
||||||
|
|
||||||
|
if (targetingManager)
|
||||||
|
x8_targetingMgr.Update(dt, mgr);
|
||||||
|
|
||||||
|
UpdateHudDamage(dt, mgr, helmetVis);
|
||||||
|
|
||||||
|
UpdateStaticInterference(dt, mgr);
|
||||||
|
|
||||||
|
if (helmetVis != DataSpec::ITweakGui::EHelmetVisMode::ReducedUpdate)
|
||||||
|
{
|
||||||
|
if (x2bc_nextState != EHudState::None)
|
||||||
|
{
|
||||||
|
UpdateEnergy(dt, mgr, false);
|
||||||
|
UpdateFreeLook(dt, mgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x2bc_nextState == EHudState::Ball)
|
||||||
|
{
|
||||||
|
UpdateBallMode(mgr, false);
|
||||||
|
}
|
||||||
|
else if (x2bc_nextState >= EHudState::Combat && x2bc_nextState <= EHudState::Scan)
|
||||||
|
{
|
||||||
|
UpdateThreatAssessment(dt, mgr);
|
||||||
|
UpdateMissile(dt, mgr, false);
|
||||||
|
UpdateVideoBands(dt, mgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateVisorAndBeamMenus(dt, mgr);
|
||||||
|
|
||||||
|
if (player.WasDamaged() && mgr.GetGameState() == CStateManager::EGameState::Running)
|
||||||
|
ShowDamage(player.GetDamageLocationWR(), player.GetDamageAmount(), player.GetPrevDamageAmount(), mgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
float oldAPulse = x584_abuttonPulse;
|
||||||
|
if (!x554_hudMemoIdx)
|
||||||
|
{
|
||||||
|
x584_abuttonPulse += 2.f * dt;
|
||||||
|
if (x584_abuttonPulse > 1.f)
|
||||||
|
x584_abuttonPulse -= 2.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
zeus::CColor abuttonColor = zeus::CColor::skWhite;
|
||||||
|
abuttonColor.a = std::fabs(x584_abuttonPulse);
|
||||||
|
x5a0_base_model_abutton->SetColor(abuttonColor);
|
||||||
|
|
||||||
|
if (!mgr.GetCameraManager()->IsInCinematicCamera() && oldAPulse < 0.f && x584_abuttonPulse >= 0.f &&
|
||||||
|
x598_base_basewidget_message->GetIsVisible() && (x558_messageTextAlpha == 0.f || x558_messageTextAlpha >= 1.f))
|
||||||
|
{
|
||||||
|
CSfxManager::SfxStart(1442, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
float allTextAlpha;
|
||||||
|
if (x29c_decoIntf)
|
||||||
|
allTextAlpha = x29c_decoIntf->GetHudTextAlpha();
|
||||||
|
else
|
||||||
|
allTextAlpha = 1.f;
|
||||||
|
|
||||||
|
float messageTextAlpha = 1.f;
|
||||||
|
if (x558_messageTextAlpha > 0.f)
|
||||||
|
messageTextAlpha = std::min(x558_messageTextAlpha, 1.f);
|
||||||
|
else if (!x59c_base_textpane_message->GetIsVisible() && !x598_base_basewidget_message->GetIsVisible())
|
||||||
|
messageTextAlpha = 0.f;
|
||||||
|
|
||||||
|
if (x2b4_bossEnergyIntf)
|
||||||
|
x2b4_bossEnergyIntf->SetAlpha(1.f - messageTextAlpha);
|
||||||
|
|
||||||
|
if (x550_hudMemoString && x550_hudMemoString.IsLoaded())
|
||||||
|
{
|
||||||
|
SetMessage(x550_hudMemoString->GetString(x554_hudMemoIdx), x548_hudMemoParms);
|
||||||
|
x550_hudMemoString = TLockedToken<CStringTable>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x558_messageTextAlpha > 0.f)
|
||||||
|
{
|
||||||
|
x558_messageTextAlpha = std::max(0.f, x558_messageTextAlpha - dt);
|
||||||
|
if (x558_messageTextAlpha == 0.f)
|
||||||
|
{
|
||||||
|
x59c_base_textpane_message->TextSupport()->SetTypeWriteEffectOptions(false, 0.f, 1.f);
|
||||||
|
x598_base_basewidget_message->SetVisibility(false, ETraversalMode::Children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CGuiWidget* messageWidget;
|
||||||
|
if (x598_base_basewidget_message->GetIsVisible())
|
||||||
|
messageWidget = x598_base_basewidget_message;
|
||||||
|
else
|
||||||
|
messageWidget = x59c_base_textpane_message;
|
||||||
|
|
||||||
|
zeus::CColor messageColor = zeus::CColor::skWhite;
|
||||||
|
float textScale = 1.f;
|
||||||
|
messageColor.a = std::min(allTextAlpha, messageTextAlpha);
|
||||||
|
messageWidget->SetColor(messageColor);
|
||||||
|
|
||||||
|
if (messageWidget == x598_base_basewidget_message)
|
||||||
|
{
|
||||||
|
if (x558_messageTextAlpha > 0.f)
|
||||||
|
x560_messageTextScale = std::min(x558_messageTextAlpha, 1.f);
|
||||||
|
else
|
||||||
|
x560_messageTextScale = std::min(x560_messageTextScale + dt, 1.f);
|
||||||
|
|
||||||
|
float textScaleT = std::max(0.f, (x560_messageTextScale - 0.75f) / 0.25f);
|
||||||
|
if (textScaleT != 1.f)
|
||||||
|
{
|
||||||
|
if (textScaleT < 0.7f)
|
||||||
|
textScale = textScaleT / 0.7f;
|
||||||
|
else if (textScaleT < 0.85f)
|
||||||
|
textScale = 0.1f * (1.f - (textScaleT - 0.7f) / 0.15f) + 0.9f;
|
||||||
|
else
|
||||||
|
textScale = 0.1f * ((textScaleT - 0.7f) - 0.15f) / 0.3f + 0.9f;
|
||||||
|
}
|
||||||
|
|
||||||
|
x598_base_basewidget_message->SetLocalTransform(x598_base_basewidget_message->GetTransform() *
|
||||||
|
zeus::CTransform::Scale(textScale, 1.f, 1.f));
|
||||||
|
}
|
||||||
|
|
||||||
|
float nextSfxChars = x55c_lastSfxChars + g_tweakGui->GetWorldTransManagerCharsPerSfx();
|
||||||
|
if (x59c_base_textpane_message->TextSupport()->GetNumCharsPrinted() >= nextSfxChars)
|
||||||
|
{
|
||||||
|
x55c_lastSfxChars = nextSfxChars;
|
||||||
|
if (!x598_base_basewidget_message->GetIsVisible() || textScale == 1.f)
|
||||||
|
CSfxManager::SfxStart(1418, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mgr.GetEscapeSequenceTimer() > 0.f)
|
||||||
|
{
|
||||||
|
int minutes = mgr.GetEscapeSequenceTimer() / 60.f;
|
||||||
|
int seconds = std::fmod(mgr.GetEscapeSequenceTimer(), 60.f);
|
||||||
|
int hundredths = std::fmod(mgr.GetEscapeSequenceTimer() * 100.f, 100.f);
|
||||||
|
std::u16string timeStr = hecl::UTF8ToChar16(hecl::Format("%02d:%02d:%02d",
|
||||||
|
int(minutes), int(seconds), int(hundredths)));
|
||||||
|
x594_base_textpane_counter->TextSupport()->SetText(timeStr);
|
||||||
|
x594_base_textpane_counter->SetIsVisible(true);
|
||||||
|
|
||||||
|
zeus::CColor counterColor = zeus::CColor::skWhite;
|
||||||
|
counterColor.a = zeus::clamp(0.f, std::min(1.f - std::min(x558_messageTextAlpha, 1.f), allTextAlpha), 1.f);
|
||||||
|
x594_base_textpane_counter->SetColor(counterColor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x594_base_textpane_counter->SetIsVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
x274_loadedFrmeBaseHud->Update(dt);
|
||||||
|
if (x288_loadedSelectedHud)
|
||||||
|
x288_loadedSelectedHud->Update(dt);
|
||||||
|
if (x2b4_bossEnergyIntf)
|
||||||
|
x2b4_bossEnergyIntf->Update(dt);
|
||||||
|
if (x28c_ballEnergyIntf)
|
||||||
|
x28c_ballEnergyIntf->Update(dt, x580_energyLowPulse);
|
||||||
|
if (x290_threatIntf)
|
||||||
|
x290_threatIntf->Update(dt);
|
||||||
|
if (x294_missileIntf)
|
||||||
|
x294_missileIntf->Update(dt, mgr);
|
||||||
|
if (x298_freeLookIntf)
|
||||||
|
x298_freeLookIntf->Update(dt);
|
||||||
|
if (x2a0_helmetIntf)
|
||||||
|
x2a0_helmetIntf->Update(dt);
|
||||||
|
|
||||||
|
if (player.GetScanningState() == CPlayer::EPlayerScanState::NotScanning)
|
||||||
|
x2f0_visorBeamMenuAlpha = std::min(x2f0_visorBeamMenuAlpha + 2.f * dt, 1.f);
|
||||||
|
else
|
||||||
|
x2f0_visorBeamMenuAlpha = std::max(0.f, x2f0_visorBeamMenuAlpha - 2.f * dt);
|
||||||
|
|
||||||
|
CPlayerState::EPlayerVisor curVisor = mgr.GetPlayerState()->GetCurrentVisor();
|
||||||
|
CPlayerState::EPlayerVisor transVisor = mgr.GetPlayerState()->GetTransitioningVisor();
|
||||||
|
float transFactor = 0.f;
|
||||||
|
if (curVisor != CPlayerState::EPlayerVisor::Scan)
|
||||||
|
{
|
||||||
|
if (transVisor == CPlayerState::EPlayerVisor::Scan)
|
||||||
|
transFactor = mgr.GetPlayerState()->GetVisorTransitionFactor();
|
||||||
|
else
|
||||||
|
transFactor = 1.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x2a4_visorMenu)
|
||||||
|
{
|
||||||
|
float hudAlpha;
|
||||||
|
if (g_GameState->GameOptions().GetSwapBeamControls())
|
||||||
|
hudAlpha = transFactor;
|
||||||
|
else
|
||||||
|
hudAlpha = x2f0_visorBeamMenuAlpha;
|
||||||
|
x2a4_visorMenu->UpdateHudAlpha(hudAlpha);
|
||||||
|
x2a4_visorMenu->Update(dt, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x2a8_beamMenu)
|
||||||
|
{
|
||||||
|
float hudAlpha;
|
||||||
|
if (g_GameState->GameOptions().GetSwapBeamControls())
|
||||||
|
hudAlpha = x2f0_visorBeamMenuAlpha;
|
||||||
|
else
|
||||||
|
hudAlpha = transFactor;
|
||||||
|
x2a8_beamMenu->UpdateHudAlpha(hudAlpha);
|
||||||
|
x2a8_beamMenu->Update(dt, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateCameraDebugSettings();
|
||||||
|
|
||||||
|
if (x29c_decoIntf)
|
||||||
|
x29c_decoIntf->Update(dt, mgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSamusHud::UpdateStateTransition(float dt, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
if (x2cc_preLoadCountdown == 0)
|
||||||
|
{
|
||||||
|
EHudState desiredState = GetDesiredHudState(mgr);
|
||||||
|
if (desiredState != x2c0_setState)
|
||||||
|
{
|
||||||
|
x2c0_setState = desiredState;
|
||||||
|
if (desiredState == EHudState::Ball || x2bc_nextState == EHudState::Ball)
|
||||||
|
x2c8_transT = FLT_EPSILON;
|
||||||
|
x2c4_activeTransState = ETransitionState::Countdown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (x2c4_activeTransState)
|
||||||
|
{
|
||||||
|
case ETransitionState::Countdown:
|
||||||
|
if (x2cc_preLoadCountdown == 0)
|
||||||
|
{
|
||||||
|
x2c8_transT = std::max(x2c8_transT - 5.f * dt, 0.f);
|
||||||
|
if (x2c8_transT == 0.f)
|
||||||
|
{
|
||||||
|
x2cc_preLoadCountdown = 2;
|
||||||
|
x288_loadedSelectedHud = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x2cc_preLoadCountdown -= 1;
|
||||||
|
if (x2cc_preLoadCountdown == 0)
|
||||||
|
{
|
||||||
|
UninitializeFrameGlueMutable();
|
||||||
|
x278_selectedHud = TLockedToken<CGuiFrame>();
|
||||||
|
switch (x2c0_setState)
|
||||||
|
{
|
||||||
|
case EHudState::Thermal:
|
||||||
|
x278_selectedHud = g_SimplePool->GetObj("FRME_ThermalHud");
|
||||||
|
break;
|
||||||
|
case EHudState::Combat:
|
||||||
|
x278_selectedHud = g_SimplePool->GetObj("FRME_CombatHud");
|
||||||
|
break;
|
||||||
|
case EHudState::Scan:
|
||||||
|
x278_selectedHud = g_SimplePool->GetObj("FRME_ScanHud");
|
||||||
|
break;
|
||||||
|
case EHudState::XRay:
|
||||||
|
x278_selectedHud = g_SimplePool->GetObj("FRME_XRayHudNew");
|
||||||
|
break;
|
||||||
|
case EHudState::Ball:
|
||||||
|
x278_selectedHud = g_SimplePool->GetObj("FRME_BallHud");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
x2c4_activeTransState = ETransitionState::Loading;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (x2c4_activeTransState != ETransitionState::Loading)
|
||||||
|
return;
|
||||||
|
case ETransitionState::Loading:
|
||||||
|
if (x278_selectedHud)
|
||||||
|
{
|
||||||
|
if (!x278_selectedHud.IsLoaded() || !x278_selectedHud->GetIsFinishedLoading())
|
||||||
|
return;
|
||||||
|
x288_loadedSelectedHud = x278_selectedHud.GetObj();
|
||||||
|
x2b8_curState = x2bc_nextState;
|
||||||
|
x2bc_nextState = x2c0_setState;
|
||||||
|
InitializeFrameGlueMutable(mgr);
|
||||||
|
x2c4_activeTransState = ETransitionState::Transitioning;
|
||||||
|
UpdateCameraDebugSettings();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x2b8_curState = x2bc_nextState;
|
||||||
|
x2bc_nextState = x2c0_setState;
|
||||||
|
x2c4_activeTransState = ETransitionState::NotTransitioning;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ETransitionState::Transitioning:
|
||||||
|
x2c8_transT = std::min(1.f, 5.f * dt + x2c8_transT);
|
||||||
|
if (x2c8_transT == 1.f)
|
||||||
|
x2c4_activeTransState = ETransitionState::NotTransitioning;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSamusHud::CheckLoadComplete(CStateManager& stateMgr)
|
bool CSamusHud::CheckLoadComplete(CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
|
switch (x4_loadPhase)
|
||||||
|
{
|
||||||
|
case ELoadPhase::Zero:
|
||||||
|
if (!x8_targetingMgr.CheckLoadComplete())
|
||||||
|
return false;
|
||||||
|
x4_loadPhase = ELoadPhase::One;
|
||||||
|
case ELoadPhase::One:
|
||||||
|
UpdateStateTransition(1.f, stateMgr);
|
||||||
|
if (x2bc_nextState != x2c0_setState)
|
||||||
|
return false;
|
||||||
|
x4_loadPhase = ELoadPhase::Two;
|
||||||
|
case ELoadPhase::Two:
|
||||||
|
if (!x264_loadedFrmeHelmet->GetIsFinishedLoading())
|
||||||
|
return false;
|
||||||
|
if (!x274_loadedFrmeBaseHud->GetIsFinishedLoading())
|
||||||
|
return false;
|
||||||
|
x4_loadPhase = ELoadPhase::Three;
|
||||||
|
case ELoadPhase::Three:
|
||||||
|
return true;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSamusHud::OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr)
|
void CSamusHud::OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSamusHud::RefreshHudOptions()
|
void CSamusHud::RefreshHudOptions()
|
||||||
|
@ -180,7 +661,12 @@ void CSamusHud::RefreshHudOptions()
|
||||||
|
|
||||||
void CSamusHud::Touch()
|
void CSamusHud::Touch()
|
||||||
{
|
{
|
||||||
|
if (x264_loadedFrmeHelmet)
|
||||||
|
x264_loadedFrmeHelmet->Touch();
|
||||||
|
if (x274_loadedFrmeBaseHud)
|
||||||
|
x274_loadedFrmeBaseHud->Touch();
|
||||||
|
if (x288_loadedSelectedHud)
|
||||||
|
x288_loadedSelectedHud->Touch();
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CTransform CSamusHud::BuildFinalCameraTransform(const zeus::CQuaternion& rot,
|
zeus::CTransform CSamusHud::BuildFinalCameraTransform(const zeus::CQuaternion& rot,
|
||||||
|
@ -191,12 +677,12 @@ zeus::CTransform CSamusHud::BuildFinalCameraTransform(const zeus::CQuaternion& r
|
||||||
return zeus::CTransform(invRot, invRot.transform(camPos - pos) + pos);
|
return zeus::CTransform(invRot, invRot.transform(camPos - pos) + pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSamusHud::DisplayHudMemo(const std::u16string& text, const CHUDMemoParms& info)
|
void CSamusHud::SetMessage(const std::u16string& text, const CHUDMemoParms& info)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSamusHud::_DeferHintMemo(ResId strg, u32 timePeriods, const CHUDMemoParms& info)
|
void CSamusHud::InternalDeferHintMemo(ResId strg, u32 timePeriods, const CHUDMemoParms& info)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,18 @@ class CGuiLight;
|
||||||
|
|
||||||
struct CHUDMemoParms
|
struct CHUDMemoParms
|
||||||
{
|
{
|
||||||
float x0_;
|
float x0_ = 0.f;
|
||||||
bool x4_;
|
bool x4_ = false;
|
||||||
bool x5_;
|
bool x5_ = false;
|
||||||
bool x6_;
|
bool x6_ = false;
|
||||||
|
CHUDMemoParms() = default;
|
||||||
|
CHUDMemoParms(float f1, bool b1, bool b2, bool b3)
|
||||||
|
: x0_(f1), x4_(b1), x5_(b2), x6_(b3) {}
|
||||||
|
CHUDMemoParms(CInputStream& in)
|
||||||
|
{
|
||||||
|
x0_ = in.readFloatBig();
|
||||||
|
x4_ = in.readBool();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class EHudState
|
enum class EHudState
|
||||||
|
@ -44,14 +52,19 @@ namespace MP1
|
||||||
class CSamusHud
|
class CSamusHud
|
||||||
{
|
{
|
||||||
enum class ELoadPhase
|
enum class ELoadPhase
|
||||||
{
|
|
||||||
Zero
|
|
||||||
};
|
|
||||||
enum class ETransitionState
|
|
||||||
{
|
{
|
||||||
Zero,
|
Zero,
|
||||||
One,
|
One,
|
||||||
Two
|
Two,
|
||||||
|
Three
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class ETransitionState
|
||||||
|
{
|
||||||
|
NotTransitioning,
|
||||||
|
Countdown,
|
||||||
|
Loading,
|
||||||
|
Transitioning
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SCachedHudLight
|
struct SCachedHudLight
|
||||||
|
@ -104,10 +117,10 @@ class CSamusHud
|
||||||
std::unique_ptr<CHudBossEnergyInterface> x2b4_bossEnergyIntf;
|
std::unique_ptr<CHudBossEnergyInterface> x2b4_bossEnergyIntf;
|
||||||
EHudState x2b8_curState = EHudState::None;
|
EHudState x2b8_curState = EHudState::None;
|
||||||
EHudState x2bc_nextState = EHudState::None;
|
EHudState x2bc_nextState = EHudState::None;
|
||||||
EHudState x2c0_otherState = EHudState::None;
|
EHudState x2c0_setState = EHudState::None;
|
||||||
ETransitionState x2c4_activeTransState = ETransitionState::Zero;
|
ETransitionState x2c4_activeTransState = ETransitionState::NotTransitioning;
|
||||||
float x2c8_ = 1.f;
|
float x2c8_transT = 1.f;
|
||||||
ETransitionState x2cc_curTransState = ETransitionState::Zero;
|
u32 x2cc_preLoadCountdown = 0;
|
||||||
float x2d0_ = 0.f;
|
float x2d0_ = 0.f;
|
||||||
u32 x2d4_totalEnergyTanks = 0;
|
u32 x2d4_totalEnergyTanks = 0;
|
||||||
u32 x2d8_missileAmount = 0;
|
u32 x2d8_missileAmount = 0;
|
||||||
|
@ -120,7 +133,7 @@ class CSamusHud
|
||||||
{
|
{
|
||||||
bool x2e0_24_ : 1;
|
bool x2e0_24_ : 1;
|
||||||
bool x2e0_25_ : 1;
|
bool x2e0_25_ : 1;
|
||||||
bool x2e0_26_ : 1;
|
bool x2e0_26_latestFirstPerson : 1;
|
||||||
bool x2e0_27_energyLow : 1;
|
bool x2e0_27_energyLow : 1;
|
||||||
};
|
};
|
||||||
u16 _dummy = 0;
|
u16 _dummy = 0;
|
||||||
|
@ -129,7 +142,7 @@ class CSamusHud
|
||||||
u32 x2e4_ = 0;
|
u32 x2e4_ = 0;
|
||||||
u32 x2e8_ = 0;
|
u32 x2e8_ = 0;
|
||||||
u32 x2ec_missilesActive = 0;
|
u32 x2ec_missilesActive = 0;
|
||||||
float x2f0_ = 1.f;
|
float x2f0_visorBeamMenuAlpha = 1.f;
|
||||||
zeus::CVector3f x2f8_fpCamDir;
|
zeus::CVector3f x2f8_fpCamDir;
|
||||||
zeus::CVector3f x304_basewidgetIdlePos;
|
zeus::CVector3f x304_basewidgetIdlePos;
|
||||||
zeus::CVector3f x310_cameraPos;
|
zeus::CVector3f x310_cameraPos;
|
||||||
|
@ -159,14 +172,26 @@ class CSamusHud
|
||||||
float x460_ = 0.f;
|
float x460_ = 0.f;
|
||||||
float x464_ = 0.f;
|
float x464_ = 0.f;
|
||||||
rstl::reserved_vector<zeus::CTransform, 3> x46c_;
|
rstl::reserved_vector<zeus::CTransform, 3> x46c_;
|
||||||
float x500_ = 1.f;
|
zeus::CVector2f x500_viewportScale = {1.f, 1.f};
|
||||||
float x504_ = 1.f;
|
|
||||||
u32 x508_ = 0;
|
u32 x508_ = 0;
|
||||||
u32 x50c_ = 0;
|
u32 x50c_ = 0;
|
||||||
float x510_ = 0.f;
|
float x510_ = 0.f;
|
||||||
float x514_ = 0.f;
|
float x514_ = 0.f;
|
||||||
float x518_ = 0.f;
|
float x518_ = 0.f;
|
||||||
CCameraFilterPass x51c_camFilter2;
|
CCameraFilterPass x51c_camFilter2;
|
||||||
|
CHUDMemoParms x548_hudMemoParms;
|
||||||
|
TLockedToken<CStringTable> x550_hudMemoString;
|
||||||
|
u32 x554_hudMemoIdx = 0;
|
||||||
|
float x558_messageTextAlpha = 0.f;
|
||||||
|
float x55c_lastSfxChars = 0.f;
|
||||||
|
float x560_messageTextScale = 0.f;
|
||||||
|
u32 x564_ = 0;
|
||||||
|
zeus::CVector3f x568_fpCamDir;
|
||||||
|
float x574_ = 1.f;
|
||||||
|
float x578_ = 0.f;
|
||||||
|
float x57c_energyLowTimer = 0.f;
|
||||||
|
float x580_energyLowPulse = 0.f;
|
||||||
|
float x584_abuttonPulse = 0.f;
|
||||||
CGuiWidget* x588_base_basewidget_pivot;
|
CGuiWidget* x588_base_basewidget_pivot;
|
||||||
CGuiWidget* x58c_helmet_BaseWidget_Pivot;
|
CGuiWidget* x58c_helmet_BaseWidget_Pivot;
|
||||||
CGuiModel* x590_base_Model_AutoMapper;
|
CGuiModel* x590_base_Model_AutoMapper;
|
||||||
|
@ -176,9 +201,9 @@ class CSamusHud
|
||||||
CGuiModel* x5a0_base_model_abutton;
|
CGuiModel* x5a0_base_model_abutton;
|
||||||
rstl::reserved_vector<SVideoBand, 4> x5a4_videoBands;
|
rstl::reserved_vector<SVideoBand, 4> x5a4_videoBands;
|
||||||
rstl::reserved_vector<CGuiLight*, 4> x5d8_guiLights;
|
rstl::reserved_vector<CGuiLight*, 4> x5d8_guiLights;
|
||||||
float x5ec_[16];
|
float x5ec_camFovTweaks[16];
|
||||||
float x62c_[64];
|
float x62c_camYTweaks[64];
|
||||||
float x72c_[32];
|
float x72c_camZTweaks[32];
|
||||||
rstl::reserved_vector<SProfileInfo, 15> x7ac_;
|
rstl::reserved_vector<SProfileInfo, 15> x7ac_;
|
||||||
|
|
||||||
static CSamusHud* g_SamusHud;
|
static CSamusHud* g_SamusHud;
|
||||||
|
@ -186,13 +211,31 @@ class CSamusHud
|
||||||
static rstl::prereserved_vector<bool, 4> BuildPlayerHasBeams(const CStateManager& mgr);
|
static rstl::prereserved_vector<bool, 4> BuildPlayerHasBeams(const CStateManager& mgr);
|
||||||
void InitializeFrameGluePermanent(const CStateManager& mgr);
|
void InitializeFrameGluePermanent(const CStateManager& mgr);
|
||||||
void InitializeFrameGlueMutable(const CStateManager& mgr);
|
void InitializeFrameGlueMutable(const CStateManager& mgr);
|
||||||
|
void UninitializeFrameGlueMutable();
|
||||||
void UpdateEnergy(float dt, const CStateManager& mgr, bool init);
|
void UpdateEnergy(float dt, const CStateManager& mgr, bool init);
|
||||||
|
void UpdateFreeLook(float dt, const CStateManager& mgr);
|
||||||
void UpdateMissile(float dt, const CStateManager& mgr, bool init);
|
void UpdateMissile(float dt, const CStateManager& mgr, bool init);
|
||||||
|
void UpdateVideoBands(float dt, const CStateManager& mgr);
|
||||||
void UpdateBallMode(const CStateManager& mgr, bool init);
|
void UpdateBallMode(const CStateManager& mgr, bool init);
|
||||||
|
void UpdateThreatAssessment(float dt, const CStateManager& mgr);
|
||||||
|
void UpdateVisorAndBeamMenus(float dt, const CStateManager& mgr);
|
||||||
|
void UpdateCameraDebugSettings();
|
||||||
|
void UpdateEnergyLow(float dt, const CStateManager& mgr);
|
||||||
|
void UpdateHudLag(float dt, const CStateManager& mgr);
|
||||||
|
void UpdateHudDynamicLights(float dt, const CStateManager& mgr);
|
||||||
|
void UpdateHudDamage(float dt, const CStateManager& mgr,
|
||||||
|
DataSpec::ITweakGui::EHelmetVisMode helmetVis);
|
||||||
|
void UpdateStaticInterference(float dt, const CStateManager& mgr);
|
||||||
|
void ShowDamage(const zeus::CVector3f& position, float dam, float prevDam, const CStateManager& mgr);
|
||||||
|
void EnterFirstPerson(const CStateManager& mgr);
|
||||||
|
void LeaveFirstPerson(const CStateManager& mgr);
|
||||||
static EHudState GetDesiredHudState(const CStateManager& mgr);
|
static EHudState GetDesiredHudState(const CStateManager& mgr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CSamusHud(CStateManager& stateMgr);
|
CSamusHud(CStateManager& stateMgr);
|
||||||
|
void Update(float dt, const CStateManager& mgr,
|
||||||
|
DataSpec::ITweakGui::EHelmetVisMode helmetVis,
|
||||||
|
bool hudVis, bool targetingManager);
|
||||||
void UpdateStateTransition(float time, const CStateManager& mgr);
|
void UpdateStateTransition(float time, const CStateManager& mgr);
|
||||||
bool CheckLoadComplete(CStateManager& stateMgr);
|
bool CheckLoadComplete(CStateManager& stateMgr);
|
||||||
void OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr);
|
void OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr);
|
||||||
|
@ -201,13 +244,22 @@ public:
|
||||||
static zeus::CTransform BuildFinalCameraTransform(const zeus::CQuaternion& rot,
|
static zeus::CTransform BuildFinalCameraTransform(const zeus::CQuaternion& rot,
|
||||||
const zeus::CVector3f& pos,
|
const zeus::CVector3f& pos,
|
||||||
const zeus::CVector3f& camPos);
|
const zeus::CVector3f& camPos);
|
||||||
static void DisplayHudMemo(const std::u16string& text, const CHUDMemoParms& info);
|
static void DisplayHudMemo(const std::u16string& text, const CHUDMemoParms& info)
|
||||||
|
{
|
||||||
|
if (g_SamusHud)
|
||||||
|
g_SamusHud->InternalDisplayHudMemo(text, info);
|
||||||
|
}
|
||||||
|
void InternalDisplayHudMemo(const std::u16string& text, const CHUDMemoParms& info)
|
||||||
|
{
|
||||||
|
SetMessage(text, info);
|
||||||
|
}
|
||||||
|
void SetMessage(const std::u16string& text, const CHUDMemoParms& info);
|
||||||
static void DeferHintMemo(ResId strg, u32 timePeriods, const CHUDMemoParms& info)
|
static void DeferHintMemo(ResId strg, u32 timePeriods, const CHUDMemoParms& info)
|
||||||
{
|
{
|
||||||
if (g_SamusHud)
|
if (g_SamusHud)
|
||||||
g_SamusHud->_DeferHintMemo(strg, timePeriods, info);
|
g_SamusHud->InternalDeferHintMemo(strg, timePeriods, info);
|
||||||
}
|
}
|
||||||
void _DeferHintMemo(ResId strg, u32 timePeriods, const CHUDMemoParms& info);
|
void InternalDeferHintMemo(ResId strg, u32 timePeriods, const CHUDMemoParms& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,15 +31,21 @@ class CPlayer : public CPhysicsActor
|
||||||
public:
|
public:
|
||||||
enum class EPlayerScanState
|
enum class EPlayerScanState
|
||||||
{
|
{
|
||||||
Zero,
|
NotScanning,
|
||||||
One,
|
Scanning,
|
||||||
Two
|
ScanComplete
|
||||||
};
|
};
|
||||||
enum class EPlayerOrbitType
|
enum class EPlayerOrbitType
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
enum class EPlayerOrbitState
|
enum class EPlayerOrbitState
|
||||||
{
|
{
|
||||||
|
Zero,
|
||||||
|
One,
|
||||||
|
Two,
|
||||||
|
Three,
|
||||||
|
Four,
|
||||||
|
Five
|
||||||
};
|
};
|
||||||
enum class EPlayerZoneInfo
|
enum class EPlayerZoneInfo
|
||||||
{
|
{
|
||||||
|
@ -116,10 +122,10 @@ private:
|
||||||
EPlayerMorphBallState x2f8_morphTransState = EPlayerMorphBallState::Unmorphed;
|
EPlayerMorphBallState x2f8_morphTransState = EPlayerMorphBallState::Unmorphed;
|
||||||
u32 x2fc_ = 0;
|
u32 x2fc_ = 0;
|
||||||
float x300_ = 0.f;
|
float x300_ = 0.f;
|
||||||
u32 x304_ = 0;
|
EPlayerOrbitState x304_orbitState = EPlayerOrbitState::Zero;
|
||||||
u32 x308_ = 0;
|
u32 x308_ = 0;
|
||||||
u32 x30c_ = 0;
|
u32 x30c_ = 0;
|
||||||
TUniqueId x310_hudPoiId = kInvalidUniqueId;
|
TUniqueId x310_lockonObjectId = kInvalidUniqueId;
|
||||||
float x314_ = 0.f;
|
float x314_ = 0.f;
|
||||||
float x318_ = 0.f;
|
float x318_ = 0.f;
|
||||||
float x31c_ = 0.f;
|
float x31c_ = 0.f;
|
||||||
|
@ -148,7 +154,7 @@ private:
|
||||||
u8 x39c_ = 0;
|
u8 x39c_ = 0;
|
||||||
float x3a0_ = 0.5f;
|
float x3a0_ = 0.5f;
|
||||||
float x3a4_ = 0.449f;
|
float x3a4_ = 0.449f;
|
||||||
EPlayerScanState x3a8_scanState = EPlayerScanState::Zero;
|
EPlayerScanState x3a8_scanState = EPlayerScanState::NotScanning;
|
||||||
float x3ac_scanningTime = 0.f;
|
float x3ac_scanningTime = 0.f;
|
||||||
float x3b0_ = 0.f;
|
float x3b0_ = 0.f;
|
||||||
TUniqueId x3b4_scanningObject = kInvalidUniqueId;
|
TUniqueId x3b4_scanningObject = kInvalidUniqueId;
|
||||||
|
@ -431,12 +437,15 @@ public:
|
||||||
void UpdateCinematicState(CStateManager& mgr);
|
void UpdateCinematicState(CStateManager& mgr);
|
||||||
void SetCameraState(EPlayerCameraState camState, CStateManager& stateMgr);
|
void SetCameraState(EPlayerCameraState camState, CStateManager& stateMgr);
|
||||||
bool IsEnergyLow(const CStateManager& mgr) const;
|
bool IsEnergyLow(const CStateManager& mgr) const;
|
||||||
|
EPlayerOrbitState GetOrbitState() const { return x304_orbitState; }
|
||||||
EPlayerScanState GetScanningState() const { return x3a8_scanState; }
|
EPlayerScanState GetScanningState() const { return x3a8_scanState; }
|
||||||
float GetScanningTime() const { return x3ac_scanningTime; }
|
float GetScanningTime() const { return x3ac_scanningTime; }
|
||||||
TUniqueId GetHudPOIId() const { return x310_hudPoiId; }
|
TUniqueId GetLockonObjectId() const { return x310_lockonObjectId; }
|
||||||
TUniqueId GetScanningObjectId() const { return x3b4_scanningObject; }
|
TUniqueId GetScanningObjectId() const { return x3b4_scanningObject; }
|
||||||
bool IsNewScanScanning() const { return x9c6_30_newScanScanning; }
|
bool IsNewScanScanning() const { return x9c6_30_newScanScanning; }
|
||||||
bool ObjectInScanningRange(TUniqueId id, const CStateManager& mgr) const;
|
bool ObjectInScanningRange(TUniqueId id, const CStateManager& mgr) const;
|
||||||
|
float GetMorphTime() const { return x574_morphTime; }
|
||||||
|
float GetMorphDuration() const { return x578_morphDuration; }
|
||||||
CPlayerGun* GetPlayerGun() const { return x490_gun.get(); }
|
CPlayerGun* GetPlayerGun() const { return x490_gun.get(); }
|
||||||
CMorphBall* GetMorphBall() const { return x768_morphball.get(); }
|
CMorphBall* GetMorphBall() const { return x768_morphball.get(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue