metaforce/Runtime/MP1/CMFGame.hpp

80 lines
2.0 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-27 00:23:46 +00:00
#include <memory>
#include <vector>
#include "Runtime/CMFGameBase.hpp"
#include "Runtime/Camera/CCameraFilter.hpp"
#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp"
#include "Runtime/MP1/CInGameGuiManager.hpp"
2015-08-27 00:23:46 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
2016-08-15 20:58:07 +00:00
class CStateManager;
class CToken;
2018-12-08 05:30:43 +00:00
namespace MP1 {
2015-08-27 00:23:46 +00:00
2018-12-08 05:30:43 +00:00
enum class EGameFlowState { InGame = 0, Paused, SamusDied, CinematicSkip };
2017-02-18 02:19:50 +00:00
2018-12-08 05:30:43 +00:00
class CMFGame : public CMFGameBase {
std::shared_ptr<CStateManager> x14_stateManager;
std::shared_ptr<CInGameGuiManager> x18_guiManager;
EGameFlowState x1c_flowState = EGameFlowState::InGame;
float x20_cineSkipTime;
u32 x24_ = 0;
TUniqueId x28_skippedCineCam = kInvalidUniqueId;
union {
struct {
bool x2a_24_initialized : 1;
bool x2a_25_samusAlive : 1;
};
2018-12-08 05:30:43 +00:00
u8 _dummy = 0;
};
2017-02-18 02:19:50 +00:00
CColoredQuadFilter m_fadeToBlack{EFilterType::Multiply};
2017-02-18 02:19:50 +00:00
2018-12-08 05:30:43 +00:00
bool IsCameraActiveFlow() const {
return (x1c_flowState == EGameFlowState::InGame || x1c_flowState == EGameFlowState::SamusDied);
}
2017-02-18 02:19:50 +00:00
2015-08-27 00:23:46 +00:00
public:
2018-12-08 05:30:43 +00:00
CMFGame(const std::weak_ptr<CStateManager>& stateMgr, const std::weak_ptr<CInGameGuiManager>& guiMgr,
const CArchitectureQueue&);
~CMFGame() override;
CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) override;
2018-12-08 05:30:43 +00:00
void Touch();
void Draw() override;
2018-12-08 05:30:43 +00:00
void PlayerDied();
void UnpauseGame();
void EnterMessageScreen(float time);
void SaveGame();
void EnterLogBook();
void PauseGame();
void EnterMapScreen();
2015-08-27 00:23:46 +00:00
};
2018-12-08 05:30:43 +00:00
class CMFGameLoader : public CMFGameLoaderBase {
std::shared_ptr<CStateManager> x14_stateMgr;
std::shared_ptr<CInGameGuiManager> x18_guiMgr;
std::vector<CToken> x1c_loadList;
2016-08-15 20:58:07 +00:00
2018-12-08 05:30:43 +00:00
union {
struct {
bool x2c_24_initialized : 1;
bool x2c_25_transitionFinished : 1;
2016-08-15 20:58:07 +00:00
};
2018-12-08 05:30:43 +00:00
u8 _dummy = 0;
};
2016-08-15 20:58:07 +00:00
2018-12-08 05:30:43 +00:00
void MakeLoadDependencyList();
2016-10-09 07:45:04 +00:00
2015-08-27 00:23:46 +00:00
public:
2018-12-08 05:30:43 +00:00
CMFGameLoader();
~CMFGameLoader() override;
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) override;
void Draw() override;
2015-08-27 00:23:46 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace MP1
} // namespace urde