From 3a96e695f06049b05aa1ad3ec3a59ac6816285e8 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 23 Oct 2022 19:03:16 -0700 Subject: [PATCH] Minor fixes, rename CStateFlowSetter to CStateSetterFlow Former-commit-id: 25294591f6b1c9b19c70606bd2520c99e6405f51 --- include/MetroidPrime/CStateFlowSetter.hpp | 12 ------------ include/MetroidPrime/CStateSetterFlow.hpp | 12 ++++++++++++ src/MetroidPrime/CMainFlow.cpp | 24 ++++++++--------------- 3 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 include/MetroidPrime/CStateFlowSetter.hpp create mode 100644 include/MetroidPrime/CStateSetterFlow.hpp diff --git a/include/MetroidPrime/CStateFlowSetter.hpp b/include/MetroidPrime/CStateFlowSetter.hpp deleted file mode 100644 index cf0a4ad2..00000000 --- a/include/MetroidPrime/CStateFlowSetter.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _CSTATEFLOWSETTER -#define _CSTATEFLOWSETTER - -#include "MetroidPrime/CIOWin.hpp" - -class CStateFlowSetter : public CIOWin { -public: - CStateFlowSetter(); - EMessageReturn OnMessage(const CArchitectureMessage& message, CArchitectureQueue& queue); -}; - -#endif // _CSTATEFLOWSETTER diff --git a/include/MetroidPrime/CStateSetterFlow.hpp b/include/MetroidPrime/CStateSetterFlow.hpp new file mode 100644 index 00000000..cd9787b8 --- /dev/null +++ b/include/MetroidPrime/CStateSetterFlow.hpp @@ -0,0 +1,12 @@ +#ifndef _CSTATESETTERFLOW +#define _CSTATESETTERFLOW + +#include "MetroidPrime/CIOWin.hpp" + +class CStateSetterFlow : public CIOWin { +public: + CStateSetterFlow(); + EMessageReturn OnMessage(const CArchitectureMessage& message, CArchitectureQueue& queue); +}; + +#endif // _CSTATESETTERFLOW diff --git a/src/MetroidPrime/CMainFlow.cpp b/src/MetroidPrime/CMainFlow.cpp index c96f01b7..29620bd1 100644 --- a/src/MetroidPrime/CMainFlow.cpp +++ b/src/MetroidPrime/CMainFlow.cpp @@ -8,7 +8,7 @@ #include "MetroidPrime/CMFGameLoader.hpp" #include "MetroidPrime/CPlayMovie.hpp" #include "MetroidPrime/CPreFrontEnd.hpp" -#include "MetroidPrime/CStateFlowSetter.hpp" +#include "MetroidPrime/CStateSetterFlow.hpp" #include "MetroidPrime/Decode.hpp" #include "MetroidPrime/CMain.hpp" @@ -63,7 +63,7 @@ void CMainFlow::AdvanceGameState(CArchitectureQueue& queue) { void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue) { x14_gameState = state; - switch (state) { + switch (x14_gameState) { case kCFS_GameExit: { switch (gpMain->GetRestartMode()) { case CMain::kRM_WinBad: @@ -78,6 +78,7 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue) default: break; } + break; } case kCFS_PreFrontEnd: { if (gpMain->GetRestartMode() == CMain::kRM_None) { @@ -88,22 +89,13 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue) break; } case kCFS_FrontEnd: - CIOWin* ioWin = nullptr; - switch (gpMain->GetRestartMode()) { - case CMain::kRM_StateSetter: - ioWin = new CStateFlowSetter(); - break; - case CMain::kRM_WinBad: - case CMain::kRM_WinGood: - case CMain::kRM_WinBest: - case CMain::kRM_LoseGame: - case CMain::kRM_Default: - ioWin = new CFrontEndUI(); - default: + if (gpMain->GetRestartMode() == CMain::kRM_None) { break; } - - queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, 12, 11, ioWin)); + queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, 12, 11, + gpMain->GetRestartMode() == CMain::kRM_StateSetter + ? (CIOWin*)new CStateSetterFlow() + : (CIOWin*)new CFrontEndUI())); break; case kCFS_Game: gpGameState->GameOptions().EnsureOptions();