CSamusHud: Make use of std::array where applicable

Same behavior without any array->pointer decay.
This commit is contained in:
Lioncash 2020-04-02 08:25:48 -04:00
parent 333fee56e3
commit 013b715c63
2 changed files with 20 additions and 14 deletions

View File

@ -36,12 +36,15 @@ CSamusHud::CSamusHud(CStateManager& stateMgr)
UpdateStateTransition(1.f, stateMgr);
g_SamusHud = this;
for (int i = 0; i < 16; ++i)
x5ec_camFovTweaks[i] = 5.f * i + 40.f;
for (int i = 0; i < 64; ++i)
x62c_camYTweaks[i] = -0.5f * i;
for (int i = 0; i < 32; ++i)
x72c_camZTweaks[i] = 0.5f * i - 8.f;
for (size_t i = 0; i < x5ec_camFovTweaks.size(); ++i) {
x5ec_camFovTweaks[i] = 5.f * float(i) + 40.f;
}
for (size_t i = 0; i < x62c_camYTweaks.size(); ++i) {
x62c_camYTweaks[i] = -0.5f * float(i);
}
for (size_t i = 0; i < x72c_camZTweaks.size(); ++i) {
x72c_camZTweaks[i] = 0.5f * float(i) - 8.f;
}
x264_loadedFrmeHelmet = x258_frmeHelmet.GetObj();
x264_loadedFrmeHelmet->Reset();
@ -577,13 +580,15 @@ 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)
const float fov = x5ec_camFovTweaks[g_tweakGui->GetHudCamFovTweak()];
const float y = x62c_camYTweaks[g_tweakGui->GetHudCamYTweak()];
const float z = x72c_camZTweaks[g_tweakGui->GetHudCamZTweak()];
if (x2a0_helmetIntf) {
x2a0_helmetIntf->UpdateCameraDebugSettings(fov, y, z);
if (x29c_decoIntf)
}
if (x29c_decoIntf) {
x29c_decoIntf->UpdateCameraDebugSettings(fov, y, z);
}
x274_loadedFrmeBaseHud->GetFrameCamera()->SetFov(fov);
x310_cameraPos.y() = y;
x310_cameraPos.z() = z;

View File

@ -1,5 +1,6 @@
#pragma once
#include <array>
#include <memory>
#include <string_view>
#include <vector>
@ -167,9 +168,9 @@ class CSamusHud {
CGuiModel* x5a0_base_model_abutton;
rstl::reserved_vector<SVideoBand, 4> x5a4_videoBands;
rstl::reserved_vector<CGuiLight*, 4> x5d8_guiLights;
float x5ec_camFovTweaks[16];
float x62c_camYTweaks[64];
float x72c_camZTweaks[32];
std::array<float, 16> x5ec_camFovTweaks;
std::array<float, 64> x62c_camYTweaks;
std::array<float, 32> x72c_camZTweaks;
rstl::reserved_vector<SProfileInfo, 15> x7ac_;
CColoredQuadFilter m_energyDrainFilter;