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

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <array>
#include <memory> #include <memory>
#include <string_view> #include <string_view>
#include <vector> #include <vector>
@ -167,9 +168,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_camFovTweaks[16]; std::array<float, 16> x5ec_camFovTweaks;
float x62c_camYTweaks[64]; std::array<float, 64> x62c_camYTweaks;
float x72c_camZTweaks[32]; std::array<float, 32> x72c_camZTweaks;
rstl::reserved_vector<SProfileInfo, 15> x7ac_; rstl::reserved_vector<SProfileInfo, 15> x7ac_;
CColoredQuadFilter m_energyDrainFilter; CColoredQuadFilter m_energyDrainFilter;