echoes/include/MetroidPrime/CMain.hpp

101 lines
2.3 KiB
C++
Raw Normal View History

2023-08-08 00:18:08 +00:00
#ifndef _CMAIN
#define _CMAIN
#include "Kyoto/SObjectTag.hpp"
#include "MetroidPrime/TGameTypes.hpp"
#include "rstl/reserved_vector.hpp"
class CStopwatch;
class CGameGlobalObjects;
class CMemorySys;
class CMain {
public:
enum ERestartMode {
kRM_None,
kRM_WinBad,
kRM_WinGood,
kRM_WinBest,
kRM_LoseGame,
kRM_Default,
kRM_StateSetter,
kRM_PreFrontEnd,
kRM_FrontEnd,
kRM_Game,
kRM_GameExit,
};
2023-08-08 14:31:30 +00:00
CMain(COsContext* context, void* unk1, CMemorySys* memorySys, void* unk2);
2023-08-08 00:18:08 +00:00
~CMain();
bool LoadAudio();
void UpdateStreamedAudio();
void RegisterResourceTweaks();
void ResetGameState();
void StreamNewGameState(CInputStream& in, int saveIdx);
void RefreshGameState();
void AddWorldPaks();
void AsyncIdle(uint time);
int RsMain(int argc, const char* const* argv);
void InitializeSubsystems();
void FillInAssetIDs();
void ShutdownSubsystems();
void MemoryCardInitializePump();
void DoPredrawMetrics();
void DrawDebugMetrics(double dt, CStopwatch& stopWatch);
bool CheckTerminate();
bool CheckReset();
void OpenWindow();
void SetRestartMode(ERestartMode s) { restartMode = s; }
ERestartMode GetRestartMode() const { return restartMode; }
// void SetCardBusy(bool v) { x160_31_cardBusy = v; }
2023-08-08 12:31:12 +00:00
void SetMaxSpeed(bool v); // {x160_26_screenFading = v; }
2023-08-08 00:18:08 +00:00
bool fn_80008A1C();
// void SetX30(bool v) { x160_30_ = v; }
static void EnsureWorldPaksReady();
static void EnsureWorldPakReady(CAssetId id);
void Increment_x5c(float f) { x5c + f; }
bool GetFinished() const { return finished; }
2023-08-08 00:18:08 +00:00
// // TODO
// COsContext& InitOsContext() {
// OpenWindow();
// return x0_osContext;
// }
private:
2023-08-08 14:31:30 +00:00
COsContext* osContext;
void* x4_unk1;
CMemorySys* memorySys;
void* xc_unk2;
char x10_pad[0x38];
2023-08-08 00:18:08 +00:00
int frameTimeMinimum;
2023-08-08 14:31:30 +00:00
float x4c;
float x50;
2023-08-08 00:18:08 +00:00
CGameGlobalObjects* gameGlobalObjects;
ERestartMode restartMode;
float x5c;
rstl::reserved_vector< uint, 10 > frameTimes;
int frameTimeIdx;
bool finished : 1;
bool mfGameBuilt : 1;
bool screenFading : 1;
2023-08-08 14:31:30 +00:00
bool x90_27_ : 1;
bool x90_28_manageCard : 1;
bool x90_29_ : 1;
bool x90_30_ : 1;
bool x90_31_cardBusy : 1;
2023-08-08 00:18:08 +00:00
// bool x161_24_gameFrameDrawn : 1;
// CGameArchitectureSupport* x164_;
};
extern CMain* gpMain;
#endif // _CMAIN