From 402e45ecb52955f4cca796398a003b5aa764f2db Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 10 Apr 2020 15:25:40 -0400 Subject: [PATCH] Runtime/MP1: Replace bitfield unions with constructor initializers --- Runtime/MP1/CFrontEndUI.cpp | 3 +-- Runtime/MP1/CFrontEndUI.hpp | 9 ++------- Runtime/MP1/CInGameGuiManager.cpp | 9 +++++---- Runtime/MP1/CInGameGuiManager.hpp | 14 ++++---------- Runtime/MP1/CLogBookScreen.cpp | 6 ++++-- Runtime/MP1/CLogBookScreen.hpp | 22 +++++++++------------ Runtime/MP1/CMFGame.cpp | 14 +++++++++----- Runtime/MP1/CMFGame.hpp | 19 ++++-------------- Runtime/MP1/CPauseScreenBase.cpp | 19 +++++++++++++++--- Runtime/MP1/CPauseScreenBase.hpp | 32 ++++++++++++++----------------- Runtime/MP1/CPauseScreenBlur.cpp | 5 ++--- Runtime/MP1/CPauseScreenBlur.hpp | 10 +++------- Runtime/MP1/CPlayMovie.cpp | 8 +++++++- Runtime/MP1/CPlayMovie.hpp | 14 +++++--------- Runtime/MP1/CSamusDoll.cpp | 12 +++++++++--- Runtime/MP1/CSamusDoll.hpp | 21 ++++++++------------ Runtime/MP1/CSamusHud.cpp | 6 ++++-- Runtime/MP1/CSamusHud.hpp | 15 ++++----------- Runtime/MP1/CSlideShow.cpp | 20 +++++++++++++------ Runtime/MP1/CSlideShow.hpp | 24 +++++++++-------------- Runtime/MP1/MP1.cpp | 12 +++++++++++- Runtime/MP1/MP1.hpp | 23 +++++++++------------- 22 files changed, 153 insertions(+), 164 deletions(-) diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 6fedaf6f3..9da2e65db 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -1412,10 +1412,9 @@ void CFrontEndUI::SNesEmulatorFrame::Draw(CSaveGameScreen* saveUi) const { } } -CFrontEndUI::SOptionsFrontEndFrame::SOptionsFrontEndFrame() { +CFrontEndUI::SOptionsFrontEndFrame::SOptionsFrontEndFrame() : x134_24_visible(true), x134_25_exitOptions(false) { x4_frme = g_SimplePool->GetObj("FRME_OptionsFrontEnd"); x10_pauseScreen = g_SimplePool->GetObj("STRG_PauseScreen"); - x134_24_visible = true; } void CFrontEndUI::SOptionsFrontEndFrame::DoSliderChange(CGuiSliderGroup* caller, float value) { diff --git a/Runtime/MP1/CFrontEndUI.hpp b/Runtime/MP1/CFrontEndUI.hpp index b1c2aac75..046f0522a 100644 --- a/Runtime/MP1/CFrontEndUI.hpp +++ b/Runtime/MP1/CFrontEndUI.hpp @@ -279,13 +279,8 @@ public: float x38_rowPitch = 0.f; CSfxHandle x3c_sliderSfx; CRumbleGenerator x40_rumbleGen; - union { - u8 _dummy = 0; - struct { - bool x134_24_visible : 1; - bool x134_25_exitOptions : 1; - }; - }; + bool x134_24_visible : 1; + bool x134_25_exitOptions : 1; std::unique_ptr m_touchBar; bool m_touchBarInValue = false; diff --git a/Runtime/MP1/CInGameGuiManager.cpp b/Runtime/MP1/CInGameGuiManager.cpp index effe4dd60..31a4dd461 100644 --- a/Runtime/MP1/CInGameGuiManager.cpp +++ b/Runtime/MP1/CInGameGuiManager.cpp @@ -178,7 +178,11 @@ CInGameGuiManager::CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue , x1c_rand(1234) , x20_faceplateDecor(stateMgr) , x50_deathDot(g_SimplePool->GetObj("TXTR_DeathDot")) -, x5c_pauseScreenDGRPs(LockPauseScreenDependencies()) { +, x5c_pauseScreenDGRPs(LockPauseScreenDependencies()) +, x1f8_24_(false) +, x1f8_25_playerAlive(true) +, x1f8_26_deferTransition(false) +, x1f8_27_exitSaveUI(true) { x1e0_helmetVisMode = g_tweakGui->GetHelmetVisMode(); x1e4_enableTargetingManager = g_tweakGui->GetEnableTargetingManager(); x1e8_enableAutoMapper = g_tweakGui->GetEnableAutoMapper(); @@ -187,9 +191,6 @@ CInGameGuiManager::CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue x1f4_visorStaticAlpha = stateMgr.GetPlayer().GetVisorStaticAlpha(); - x1f8_25_playerAlive = true; - x1f8_27_exitSaveUI = true; - xc8_inGameGuiDGRPs.reserve(InGameGuiDGRPs.size()); for (const char* const dgrp : InGameGuiDGRPs) { xc8_inGameGuiDGRPs.emplace_back(g_SimplePool->GetObj(dgrp)); diff --git a/Runtime/MP1/CInGameGuiManager.hpp b/Runtime/MP1/CInGameGuiManager.hpp index 76ba934f2..3009e4d34 100644 --- a/Runtime/MP1/CInGameGuiManager.hpp +++ b/Runtime/MP1/CInGameGuiManager.hpp @@ -95,6 +95,10 @@ private: EHudVisMode x1ec_hudVisMode; u32 x1f0_enablePlayerVisor; float x1f4_visorStaticAlpha; + bool x1f8_24_ : 1; + bool x1f8_25_playerAlive : 1; + bool x1f8_26_deferTransition : 1; + bool x1f8_27_exitSaveUI : 1; std::optional m_deathRenderTexQuad; std::optional m_deathDotQuad; @@ -102,16 +106,6 @@ private: CColoredQuadFilter m_deathWhiteout{EFilterType::Blend}; CColoredQuadFilter m_deathBlackout{EFilterType::Blend}; - union { - struct { - bool x1f8_24_ : 1; - bool x1f8_25_playerAlive : 1; - bool x1f8_26_deferTransition : 1; - bool x1f8_27_exitSaveUI : 1; - }; - u32 _dummy = 0; - }; - static std::vector> LockPauseScreenDependencies(); bool CheckDGRPLoadComplete() const; void BeginStateTransition(EInGameGuiState state, CStateManager& stateMgr); diff --git a/Runtime/MP1/CLogBookScreen.cpp b/Runtime/MP1/CLogBookScreen.cpp index e665c0c16..e4dc73fff 100644 --- a/Runtime/MP1/CLogBookScreen.cpp +++ b/Runtime/MP1/CLogBookScreen.cpp @@ -14,7 +14,10 @@ namespace urde::MP1 { CLogBookScreen::CLogBookScreen(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg) -: CPauseScreenBase(mgr, frame, pauseStrg, true) { +: CPauseScreenBase(mgr, frame, pauseStrg, true) +, x260_24_loaded(false) +, x260_25_inTextScroll(false) +, x260_26_exitTextScroll(false) { x19c_scanCompletes.resize(5); x200_viewScans.resize(5); x258_artifactDoll = std::make_unique(); @@ -177,7 +180,6 @@ bool CLogBookScreen::IsScanCategoryReady(CSaveWorld::EScanCategory category) con }); } - void CLogBookScreen::UpdateBodyText() { if (x10_mode != EMode::TextScroll) { x174_textpane_body->TextSupport().SetText(u""); diff --git a/Runtime/MP1/CLogBookScreen.hpp b/Runtime/MP1/CLogBookScreen.hpp index 8b2892b7b..f782faf0f 100644 --- a/Runtime/MP1/CLogBookScreen.hpp +++ b/Runtime/MP1/CLogBookScreen.hpp @@ -13,7 +13,7 @@ namespace urde { class CPlayerState; class CScannableObjectInfo; class CStringTable; -} +} // namespace urde namespace urde::MP1 { class CArtifactDoll; @@ -25,18 +25,14 @@ class CLogBookScreen : public CPauseScreenBase { x200_viewScans; float x254_viewInterp = 0.f; std::unique_ptr x258_artifactDoll; - - enum class ELeavePauseState { InPause = 0, LeavingPause = 1, LeftPause = 2 }; - - ELeavePauseState x25c_leavePauseState = ELeavePauseState::InPause; - union { - struct { - bool x260_24_loaded : 1; - bool x260_25_inTextScroll : 1; - bool x260_26_exitTextScroll : 1; - }; - s32 _dummy = 0; - }; + enum class ELeavePauseState { + InPause = 0, + LeavingPause = 1, + LeftPause = 2 + } x25c_leavePauseState = ELeavePauseState::InPause; + bool x260_24_loaded : 1; + bool x260_25_inTextScroll : 1; + bool x260_26_exitTextScroll : 1; void InitializeLogBook(); void UpdateRightTitles(); diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index affd3f57e..1691b80f7 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -14,13 +14,16 @@ namespace urde::MP1 { CMFGame::CMFGame(const std::weak_ptr& stateMgr, const std::weak_ptr& guiMgr, const CArchitectureQueue&) -: CMFGameBase("CMFGame"), x14_stateManager(stateMgr.lock()), x18_guiManager(guiMgr.lock()) { - x2a_25_samusAlive = true; +: CMFGameBase("CMFGame") +, x14_stateManager(stateMgr.lock()) +, x18_guiManager(guiMgr.lock()) +, x2a_24_initialized(false) +, x2a_25_samusAlive(true) { static_cast(*g_Main).SetMFGameBuilt(true); } CMFGame::~CMFGame() { - CMain& main = static_cast(*g_Main); + auto& main = static_cast(*g_Main); main.SetMFGameBuilt(false); main.SetScreenFading(false); CDecalManager::Reinitialize(); @@ -253,8 +256,9 @@ void CMFGame::EnterMapScreen() { x14_stateManager->SetInMapScreen(true); } -CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader") { - CMain* m = static_cast(g_Main); +CMFGameLoader::CMFGameLoader() +: CMFGameLoaderBase("CMFGameLoader"), x2c_24_initialized(false), x2c_25_transitionFinished(false) { + auto* m = static_cast(g_Main); switch (m->GetFlowState()) { case EFlowState::Default: case EFlowState::StateSetter: { diff --git a/Runtime/MP1/CMFGame.hpp b/Runtime/MP1/CMFGame.hpp index fe7d70ca3..d491089b1 100644 --- a/Runtime/MP1/CMFGame.hpp +++ b/Runtime/MP1/CMFGame.hpp @@ -23,13 +23,8 @@ class CMFGame : public CMFGameBase { float x20_cineSkipTime; u32 x24_ = 0; TUniqueId x28_skippedCineCam = kInvalidUniqueId; - union { - struct { - bool x2a_24_initialized : 1; - bool x2a_25_samusAlive : 1; - }; - u8 _dummy = 0; - }; + bool x2a_24_initialized : 1; + bool x2a_25_samusAlive : 1; CColoredQuadFilter m_fadeToBlack{EFilterType::Multiply}; @@ -57,14 +52,8 @@ class CMFGameLoader : public CMFGameLoaderBase { std::shared_ptr x14_stateMgr; std::shared_ptr x18_guiMgr; std::vector x1c_loadList; - - union { - struct { - bool x2c_24_initialized : 1; - bool x2c_25_transitionFinished : 1; - }; - u8 _dummy = 0; - }; + bool x2c_24_initialized : 1; + bool x2c_25_transitionFinished : 1; void MakeLoadDependencyList(); diff --git a/Runtime/MP1/CPauseScreenBase.cpp b/Runtime/MP1/CPauseScreenBase.cpp index 1f9e662c8..f8d4adde5 100644 --- a/Runtime/MP1/CPauseScreenBase.cpp +++ b/Runtime/MP1/CPauseScreenBase.cpp @@ -18,9 +18,22 @@ namespace urde::MP1 { CPauseScreenBase::CPauseScreenBase(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg, bool isLogBook) -: x4_mgr(mgr), x8_frame(frame), xc_pauseStrg(pauseStrg) { - m_isLogBook = isLogBook; - m_playRightTableSfx = true; +: x4_mgr(mgr) +, x8_frame(frame) +, xc_pauseStrg(pauseStrg) +, x198_24_ready(false) +, x198_25_handledInput(false) +, x198_26_exitPauseScreen(false) +, x198_27_canDraw(false) +, x198_28_pulseTextArrowTop(false) +, x198_29_pulseTextArrowBottom(false) +, m_isLogBook(isLogBook) +, m_bodyUpClicked(false) +, m_bodyDownClicked(false) +, m_bodyClicked(false) +, m_leftClicked(false) +, m_rightClicked(false) +, m_playRightTableSfx(true) { InitializeFrameGlue(); } diff --git a/Runtime/MP1/CPauseScreenBase.hpp b/Runtime/MP1/CPauseScreenBase.hpp index 7b9937143..95178d5e2 100644 --- a/Runtime/MP1/CPauseScreenBase.hpp +++ b/Runtime/MP1/CPauseScreenBase.hpp @@ -74,24 +74,20 @@ protected: CGuiSliderGroup* x18c_slidergroup_slider = nullptr; CGuiTableGroup* x190_tablegroup_double = nullptr; CGuiTableGroup* x194_tablegroup_triple = nullptr; - union { - struct { - bool x198_24_ready : 1; - bool x198_25_handledInput : 1; - bool x198_26_exitPauseScreen : 1; - bool x198_27_canDraw : 1; - bool x198_28_pulseTextArrowTop : 1; - bool x198_29_pulseTextArrowBottom : 1; - bool m_isLogBook : 1; - bool m_bodyUpClicked : 1; - bool m_bodyDownClicked : 1; - bool m_bodyClicked : 1; - bool m_leftClicked : 1; - bool m_rightClicked : 1; - bool m_playRightTableSfx : 1; - }; - u32 _dummy = 0; - }; + bool x198_24_ready : 1; + bool x198_25_handledInput : 1; + bool x198_26_exitPauseScreen : 1; + bool x198_27_canDraw : 1; + bool x198_28_pulseTextArrowTop : 1; + bool x198_29_pulseTextArrowBottom : 1; + bool m_isLogBook : 1; + bool m_bodyUpClicked : 1; + bool m_bodyDownClicked : 1; + bool m_bodyClicked : 1; + bool m_leftClicked : 1; + bool m_rightClicked : 1; + bool m_playRightTableSfx : 1; + void InitializeFrameGlue(); void ChangeMode(EMode mode, bool playSfx = true); void UpdateSideTable(CGuiTableGroup* table); diff --git a/Runtime/MP1/CPauseScreenBlur.cpp b/Runtime/MP1/CPauseScreenBlur.cpp index 37dbacbef..f750dba69 100644 --- a/Runtime/MP1/CPauseScreenBlur.cpp +++ b/Runtime/MP1/CPauseScreenBlur.cpp @@ -6,9 +6,8 @@ namespace urde::MP1 { -CPauseScreenBlur::CPauseScreenBlur() : x4_mapLightQuarter(g_SimplePool->GetObj("TXTR_MapLightQuarter")) { - x50_25_gameDraw = true; -} +CPauseScreenBlur::CPauseScreenBlur() +: x4_mapLightQuarter(g_SimplePool->GetObj("TXTR_MapLightQuarter")), x50_24_blurring(false), x50_25_gameDraw(true) {} void CPauseScreenBlur::OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr) { switch (state) { diff --git a/Runtime/MP1/CPauseScreenBlur.hpp b/Runtime/MP1/CPauseScreenBlur.hpp index e96b2eafc..69a7e4951 100644 --- a/Runtime/MP1/CPauseScreenBlur.hpp +++ b/Runtime/MP1/CPauseScreenBlur.hpp @@ -20,16 +20,12 @@ class CPauseScreenBlur { EState x14_nextState = EState::InGame; float x18_blurAmt = 0.f; CCameraBlurPass x1c_camBlur; + bool x50_24_blurring : 1; + bool x50_25_gameDraw : 1; + CTexturedQuadFilter m_quarterFilter{EFilterType::Multiply, x4_mapLightQuarter}; CScanLinesFilterEven m_linesFilter{EFilterType::Multiply}; - union { - struct { - bool x50_24_blurring : 1; - bool x50_25_gameDraw : 1; - }; - u32 _dummy = 0; - }; void OnBlurComplete(bool); void SetState(EState state); diff --git a/Runtime/MP1/CPlayMovie.cpp b/Runtime/MP1/CPlayMovie.cpp index fcffdaf28..9d9494fc8 100644 --- a/Runtime/MP1/CPlayMovie.cpp +++ b/Runtime/MP1/CPlayMovie.cpp @@ -8,7 +8,13 @@ const char* kMovies[] = {"Video/wingame.thp", "Video/wingame_best.thp", " bool CPlayMovie::IsResultsScreen(EWhichMovie which) { return int(which) <= 2; } -CPlayMovie::CPlayMovie(EWhichMovie which) : CPlayMovieBase("CPlayMovie", kMovies[int(which)]), x18_which(which) { +CPlayMovie::CPlayMovie(EWhichMovie which) +: CPlayMovieBase("CPlayMovie", kMovies[int(which)]) +, x18_which(which) +, x78_24_(false) +, x78_25_(false) +, x78_26_resultsScreen(false) +, x78_27_(false) { (void)x18_which; } diff --git a/Runtime/MP1/CPlayMovie.hpp b/Runtime/MP1/CPlayMovie.hpp index f881461e1..8e40a9f85 100644 --- a/Runtime/MP1/CPlayMovie.hpp +++ b/Runtime/MP1/CPlayMovie.hpp @@ -20,15 +20,11 @@ public: private: EWhichMovie x18_which; - union { - struct { - bool x78_24_ : 1; - bool x78_25_ : 1; - bool x78_26_resultsScreen : 1; - bool x78_27_ : 1; - }; - u16 _dummy = 0; - }; + bool x78_24_ : 1; + bool x78_25_ : 1; + bool x78_26_resultsScreen : 1; + bool x78_27_ : 1; + static bool IsResultsScreen(EWhichMovie which); public: diff --git a/Runtime/MP1/CSamusDoll.cpp b/Runtime/MP1/CSamusDoll.cpp index a4ca9f2cb..74fbbd177 100644 --- a/Runtime/MP1/CSamusDoll.cpp +++ b/Runtime/MP1/CSamusDoll.cpp @@ -98,7 +98,15 @@ CSamusDoll::CSamusDoll(const CDependencyGroup& suitDgrp, const CDependencyGroup& bool hasGrappleBeam) : x10_ballXf(zeus::CTransform::Translate(0.f, 0.f, 0.625f * g_tweakPlayer->GetPlayerBallHalfExtent())) , x44_suit(suit) -, x48_beam(beam) { +, x48_beam(beam) +, x270_24_hasSpiderBall(hasSpiderBall) +, x270_25_hasGrappleBeam(hasGrappleBeam) +, x270_26_pulseSuit(false) +, x270_27_pulseBeam(false) +, x270_28_pulseGrapple(false) +, x270_29_pulseBoots(false) +, x270_30_pulseVisor(false) +, x270_31_loaded(false) { x70_fixedRot.rotateZ(M_PIF); x90_userInterpRot = xb0_userRot = x70_fixedRot; x1d4_spiderBallGlass = g_SimplePool->GetObj(SpiderBallGlassModels[size_t(suit)].first); @@ -115,8 +123,6 @@ CSamusDoll::CSamusDoll(const CDependencyGroup& suitDgrp, const CDependencyGroup& x230_ballTransitionFlash = g_SimplePool->GetObj("MorphBallTransitionFlash"); x23c_lights.push_back(CLight::BuildDirectional(zeus::skForward, zeus::skWhite)); x24c_actorLights = std::make_unique(8, zeus::skZero3f, 4, 4, false, false, false, 0.1f); - x270_24_hasSpiderBall = hasSpiderBall; - x270_25_hasGrappleBeam = hasGrappleBeam; x22c_ballInnerGlowGen->SetGlobalScale(zeus::CVector3f(0.625f)); x0_depToks.reserve(suitDgrp.GetObjectTagVector().size() + ballDgrp.GetObjectTagVector().size()); for (const SObjectTag& tag : suitDgrp.GetObjectTagVector()) { diff --git a/Runtime/MP1/CSamusDoll.hpp b/Runtime/MP1/CSamusDoll.hpp index ac0ddd645..6833a75e6 100644 --- a/Runtime/MP1/CSamusDoll.hpp +++ b/Runtime/MP1/CSamusDoll.hpp @@ -71,19 +71,14 @@ class CSamusDoll { CSfxHandle x264_offsetSfx; CSfxHandle x268_rotateSfx; CSfxHandle x26c_zoomSfx; - union { - struct { - bool x270_24_hasSpiderBall : 1; - bool x270_25_hasGrappleBeam : 1; - bool x270_26_pulseSuit : 1; - bool x270_27_pulseBeam : 1; - bool x270_28_pulseGrapple : 1; - bool x270_29_pulseBoots : 1; - bool x270_30_pulseVisor : 1; - bool x270_31_loaded : 1; - }; - u32 _dummy = 0; - }; + bool x270_24_hasSpiderBall : 1; + bool x270_25_hasGrappleBeam : 1; + bool x270_26_pulseSuit : 1; + bool x270_27_pulseBeam : 1; + bool x270_28_pulseGrapple : 1; + bool x270_29_pulseBoots : 1; + bool x270_30_pulseVisor : 1; + bool x270_31_loaded : 1; static constexpr zeus::CVector3f skInitialOffset{0.0f, 0.0f, 0.8f}; static CModelData BuildSuitModelData1(CPlayerState::EPlayerSuit suit); diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index 5681b8c86..8d003aa98 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -23,9 +23,11 @@ CSamusHud::CSamusHud(CStateManager& stateMgr) : x8_targetingMgr(stateMgr) , x258_frmeHelmet(g_SimplePool->GetObj("FRME_Helmet")) , x268_frmeBaseHud(g_SimplePool->GetObj("FRME_BaseHud")) +, x2e0_24_inFreeLook(false) +, x2e0_25_lookControlHeld(false) +, x2e0_26_latestFirstPerson(true) +, x2e0_27_energyLow(stateMgr.GetPlayer().IsEnergyLow(stateMgr)) , m_energyDrainFilter(g_tweakGui->GetEnergyDrainFilterAdditive() ? EFilterType::Add : EFilterType::Blend) { - x2e0_26_latestFirstPerson = true; - x2e0_27_energyLow = stateMgr.GetPlayer().IsEnergyLow(stateMgr); x33c_lights = std::make_unique(8, zeus::skZero3f, 4, 1, true, 0, 0, 0.1f); x340_hudLights.resize(3, SCachedHudLight(zeus::skZero3f, zeus::skWhite, 0.f, 0.f, 0.f, 0.f)); x46c_.resize(3); diff --git a/Runtime/MP1/CSamusHud.hpp b/Runtime/MP1/CSamusHud.hpp index 47baf9248..c140ba43d 100644 --- a/Runtime/MP1/CSamusHud.hpp +++ b/Runtime/MP1/CSamusHud.hpp @@ -95,17 +95,10 @@ class CSamusHud { u32 x2d4_totalEnergyTanks = 0; u32 x2d8_missileAmount = 0; u32 x2dc_missileCapacity = 0; - - union { - struct { - bool x2e0_24_inFreeLook : 1; - bool x2e0_25_lookControlHeld : 1; - bool x2e0_26_latestFirstPerson : 1; - bool x2e0_27_energyLow : 1; - }; - u16 _dummy = 0; - }; - + bool x2e0_24_inFreeLook : 1; + bool x2e0_25_lookControlHeld : 1; + bool x2e0_26_latestFirstPerson : 1; + bool x2e0_27_energyLow : 1; u32 x2e4_ = 0; u32 x2e8_ = 0; CPlayerGun::EMissleMode x2ec_missileMode = CPlayerGun::EMissleMode::Inactive; diff --git a/Runtime/MP1/CSlideShow.cpp b/Runtime/MP1/CSlideShow.cpp index 40b0d9571..9c588f7cd 100644 --- a/Runtime/MP1/CSlideShow.cpp +++ b/Runtime/MP1/CSlideShow.cpp @@ -6,12 +6,20 @@ namespace urde { -CSlideShow::CSlideShow() : CIOWin("SlideShow"), x5c_slideA(*this), x90_slideB(*this) { - x130_ = g_tweakSlideShow->GetX54(); - x134_24_ = true; - x134_30_ = true; - x135_24_ = true; - +CSlideShow::CSlideShow() +: CIOWin("SlideShow") +, x5c_slideA(*this) +, x90_slideB(*this) +, x130_(g_tweakSlideShow->GetX54()) +, x134_24_(true) +, x134_25_(false) +, x134_26_(false) +, x134_27_(false) +, x134_28_disableInput(false) +, x134_29_(false) +, x134_30_(true) +, x134_31_(false) +, x135_24_(true) { const SObjectTag* font = g_ResFactory->GetResourceIdByName(g_tweakSlideShow->GetFont()); if (font) { CGuiTextProperties propsA(false, true, EJustification::Center, EVerticalJustification::Bottom); diff --git a/Runtime/MP1/CSlideShow.hpp b/Runtime/MP1/CSlideShow.hpp index 11087684f..20bed1176 100644 --- a/Runtime/MP1/CSlideShow.hpp +++ b/Runtime/MP1/CSlideShow.hpp @@ -87,21 +87,15 @@ private: float x12c_ = 32.f; */ float x130_; - - union { - struct { - bool x134_24_ : 1; - bool x134_25_ : 1; - bool x134_26_ : 1; - bool x134_27_ : 1; - bool x134_28_disableInput : 1; - bool x134_29_ : 1; - bool x134_30_ : 1; - bool x134_31_ : 1; - bool x135_24_ : 1; - }; - u32 dummy = 0; - }; + bool x134_24_ : 1; + bool x134_25_ : 1; + bool x134_26_ : 1; + bool x134_27_ : 1; + bool x134_28_disableInput : 1; + bool x134_29_ : 1; + bool x134_30_ : 1; + bool x134_31_ : 1; + bool x135_24_ : 1; bool LoadTXTRDep(std::string_view name); static bool AreAllDepsLoaded(const std::vector>& deps); diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 3c1735d0d..eb89c9578 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -240,7 +240,17 @@ void CGameArchitectureSupport::specialKeyUp(boo::ESpecialKey key, boo::EModifier CMain::CMain(IFactory* resFactory, CSimplePool* resStore, boo::IGraphicsDataFactory* gfxFactory, boo::IGraphicsCommandQueue* cmdQ, const boo::ObjToken& spareTex) -: m_booSetter(gfxFactory, cmdQ, spareTex), x128_globalObjects(resFactory, resStore) { +: m_booSetter(gfxFactory, cmdQ, spareTex) +, x128_globalObjects(resFactory, resStore) +, x160_24_finished(false) +, x160_25_mfGameBuilt(false) +, x160_26_screenFading(false) +, x160_27_(false) +, x160_28_manageCard(false) +, x160_29_(false) +, x160_30_(false) +, x160_31_cardBusy(false) +, x161_24_gameFrameDrawn(false) { xe4_gameplayResult = EGameplayResult::Playing; g_Main = this; } diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index cf25985ec..f805dff6a 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -227,20 +227,15 @@ private: u32 x130_[10] = {1000000}; - union { - struct { - bool x160_24_finished : 1; - bool x160_25_mfGameBuilt : 1; - bool x160_26_screenFading : 1; - bool x160_27_ : 1; - bool x160_28_manageCard : 1; - bool x160_29_ : 1; - bool x160_30_ : 1; - bool x160_31_cardBusy : 1; - bool x161_24_gameFrameDrawn : 1; - }; - u16 _dummy = 0; - }; + bool x160_24_finished : 1; + bool x160_25_mfGameBuilt : 1; + bool x160_26_screenFading : 1; + bool x160_27_ : 1; + bool x160_28_manageCard : 1; + bool x160_29_ : 1; + bool x160_30_ : 1; + bool x160_31_cardBusy : 1; + bool x161_24_gameFrameDrawn : 1; std::unique_ptr x164_archSupport;