More class stubs

This commit is contained in:
Jack Andersen 2015-08-26 14:23:46 -10:00
parent acb3c549f5
commit d6e0a1c7c6
33 changed files with 716 additions and 126 deletions

56
Runtime/CGameDebug.hpp Normal file
View File

@ -0,0 +1,56 @@
#ifndef __RETRO_CGAMEDEBUG_HPP__
#define __RETRO_CGAMEDEBUG_HPP__
#include <string>
namespace Retro
{
class CFinalInput;
const char* StringForControlOption(int);
enum EDebugMenu
{
};
enum EDebugOptions
{
};
enum EDebugMainMenu
{
};
class CDebugOption
{
public:
CDebugOption(EDebugMenu, EDebugOptions, const std::string&, bool);
CDebugOption(EDebugMenu, EDebugOptions, const std::string&, float, float, float, float);
};
class CGameDebug
{
public:
enum EReturnValue
{
};
void DeactivateMenu();
void AddDebugOption(EDebugMenu, EDebugOptions, const char*, bool);
void AddDebugOption(EDebugMenu, EDebugOptions, const char*, float, float, float, float);
void SetCaptureMovieTimeLeft(float);
const std::string& GetCaptureMovieName();
void SetCaptureMovieName(const std::string&);
void AddDebugOptions();
void CopyDebugToTweaks();
void CopyTweaksToDebug();
void ProcessControllerInput(const CFinalInput&);
void Update(float);
void Draw(void) const;
void ActivateMenu(EDebugMainMenu, int);
void AddDebugOption(const CDebugOption&);
};
}
#endif // __RETRO_CGAMEDEBUG_HPP__

View File

@ -22,7 +22,7 @@ public:
MsgRetRemoveIOWin = 3
};
virtual ~CIOWin() {}
CIOWin(const std::string& name) : m_name(name) {m_nameHash = std::hash<std::string>()(name);}
CIOWin(const char* name) : m_name(name) {m_nameHash = std::hash<std::string>()(m_name);}
virtual EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&)=0;
virtual bool GetIsContinueDraw() const {return true;}
virtual void Draw() const {}

View File

@ -70,16 +70,16 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
while (node)
{
CIOWin* iow = node->GetIOWin();
CIOWin::EMessageReturn mret = iow->OnMessage(msg, x8_internalQueue);
CIOWin::EMessageReturn mret = iow->OnMessage(msg, x8_localGatherQueue);
while (x8_internalQueue)
while (x8_localGatherQueue)
{
CArchitectureMessage msg = x8_internalQueue.Pop();
CArchitectureMessage msg = x8_localGatherQueue.Pop();
if (msg.GetTarget() == TargetIOWinManager)
{
if (OnIOWinMessage(msg))
{
x8_internalQueue.Clear();
x8_localGatherQueue.Clear();
queue.Clear();
return true;
}
@ -238,6 +238,7 @@ void CIOWinManager::RemoveAllIOWins()
node = node->x8_next;
delete delNode;
}
x0_drawRoot = nullptr;
node = x4_pumpRoot;
while (node)
{
@ -245,6 +246,7 @@ void CIOWinManager::RemoveAllIOWins()
node = node->x8_next;
delete delNode;
}
x4_pumpRoot = nullptr;
}
void CIOWinManager::RemoveIOWin(CIOWin* chIow)

View File

@ -25,7 +25,7 @@ class CIOWinManager
};
IOWinPQNode* x0_drawRoot = nullptr;
IOWinPQNode* x4_pumpRoot = nullptr;
CArchitectureQueue x8_internalQueue;
CArchitectureQueue x8_localGatherQueue;
public:
bool OnIOWinMessage(const CArchitectureMessage& msg);
void Draw() const;
@ -39,8 +39,6 @@ public:
void AddIOWin(rstl::ncrc_ptr<CIOWin> toAdd, int pumpPrio, int drawPrio);
};
}
#endif // __RETRO_CIOWINMANAGER_HPP__

View File

@ -0,0 +1,20 @@
#ifndef __RETRO_CINGAMETWEAKMANAGERBASE_HPP__
#define __RETRO_CINGAMETWEAKMANAGERBASE_HPP__
#include <string>
namespace Retro
{
class CInGameTweakManagerBase
{
public:
bool ReadFromMemoryCard(const std::string& name)
{
return true;
}
};
}
#endif // __RETRO_CINGAMETWEAKMANAGERBASE_HPP__

View File

@ -1,19 +0,0 @@
#ifndef __RETRO_CMFGAME_HPP__
#define __RETRO_CMFGAME_HPP__
#include "CIOWin.hpp"
namespace Retro
{
class CMFGameLoader : public CIOWin
{
public:
CMFGameLoader() : CIOWin("CMFGameLoader") {}
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void Draw() const;
};
}
#endif // __RETRO_CMFGAME_HPP__

23
Runtime/CMFGameBase.hpp Normal file
View File

@ -0,0 +1,23 @@
#ifndef __RETRO_CMFGAMEBASE_HPP__
#define __RETRO_CMFGAMEBASE_HPP__
#include "CIOWin.hpp"
namespace Retro
{
class CMFGameBase : public CIOWin
{
public:
CMFGameBase(const char* name) : CIOWin(name) {}
};
class CMFGameLoaderBase : public CIOWin
{
public:
CMFGameLoaderBase(const char* name) : CIOWin(name) {}
};
}
#endif // __RETRO_CMFGAMEBASE_HPP__

View File

@ -1,39 +0,0 @@
#include "CMainFlow.hpp"
#include "CArchitectureQueue.hpp"
#include "CMFGame.hpp"
namespace Retro
{
void CMainFlow::AdvanceGameState(CArchitectureQueue& queue)
{
}
void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
{
switch (state)
{
case StateGameLoad:
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 10, 1000, new CMFGameLoader())));
break;
default: break;
}
}
CIOWin::EMessageReturn CMainFlow::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{
switch (msg.GetType())
{
case MsgTimerTick:
AdvanceGameState(queue);
break;
case MsgSetGameState:
{
CArchMsgParmInt32 state = MakeMsg::GetParmNewGameflowState(msg);
SetGameState(EClientFlowStates(state.x4_parm), queue);
return MsgRetExit;
}
default: break;
}
return MsgRetNormal;
}
}

43
Runtime/CMainFlowBase.cpp Normal file
View File

@ -0,0 +1,43 @@
#include "CMainFlowBase.hpp"
#include "CArchitectureMessage.hpp"
namespace Retro
{
CIOWin::EMessageReturn CMainFlowBase::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{
switch (msg.GetType())
{
case MsgTimerTick:
AdvanceGameState(queue);
break;
case MsgSetGameState:
{
const CArchMsgParmInt32& state = MakeMsg::GetParmNewGameflowState(msg);
x14_gameState = EClientFlowStates(state.x4_parm);
SetGameState(x14_gameState, queue);
return MsgRetExit;
}
default: break;
}
return MsgRetNormal;
}
void CMainFlowBase::AdvanceGameState(CArchitectureQueue& queue)
{
switch (x14_gameState)
{
case ClientStateFrontEnd:
SetGameState(ClientStateGameLoad, queue);
break;
case ClientStateUnspecified:
case ClientStateGameLoad:
SetGameState(ClientStateMoviePlay, queue);
break;
case ClientStateMoviePlay:
SetGameState(ClientStateFrontEnd, queue);
break;
}
}
}

30
Runtime/CMainFlowBase.hpp Normal file
View File

@ -0,0 +1,30 @@
#ifndef __RETRO_CMAINFLOWBASE_HPP__
#define __RETRO_CMAINFLOWBASE_HPP__
#include "CIOWin.hpp"
namespace Retro
{
enum EClientFlowStates
{
ClientStateUnspecified = -1,
ClientStateFrontEnd = 7,
ClientStateGameLoad = 13,
ClientStateMoviePlay = 14
};
class CMainFlowBase : public CIOWin
{
protected:
EClientFlowStates x14_gameState;
public:
CMainFlowBase(const char* name) : CIOWin(name) {}
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void AdvanceGameState(CArchitectureQueue& queue);
virtual void SetGameState(EClientFlowStates state, CArchitectureQueue& queue)=0;
};
}
#endif // __RETRO_CMAINFLOWBASE_HPP__

View File

@ -17,13 +17,12 @@ endif()
add_library(RuntimeCommon
COsContext.hpp COsContextBoo.cpp
CMainFlow.hpp CMainFlow.cpp
CMemory.hpp CMemory.cpp
CMemoryCardSys.hpp
IAllocator.hpp IAllocator.cpp
CGameAllocator.hpp CGameAllocator.cpp
CBasics.hpp CBasicsPC.cpp
CIOWin.hpp CIOWin.cpp
CIOWin.hpp
CIOWinManager.hpp CIOWinManager.cpp
CStateManager.hpp CStateManager.cpp
CGameState.hpp CGameState.cpp
@ -46,8 +45,6 @@ add_library(RuntimeCommon
IFactory.hpp
ScriptObjectSupport.hpp ScriptObjectSupport.cpp
CObjectList.hpp
CMFGame.hpp CMFGame.cpp
CMainFlow.hpp CMainFlow.cpp
CArchitectureMessage.hpp
CArchitectureQueue.hpp CArchitectureQueue.cpp
IObj.hpp
@ -61,6 +58,12 @@ add_library(RuntimeCommon
CStringExtras.hpp
CCallStack.hpp
IOStreams.hpp IOStreams.cpp
CMainFlowBase.hpp CMainFlowBase.cpp
CMFGameBase.hpp
CInGameTweakManagerBase.hpp
CPlayMovieBase.hpp
CMoviePlayer.hpp CMoviePlayer.cpp
CGameDebug.hpp CGameDebug.cpp
rstl.hpp rstl.cpp
GameGlobalObjects.hpp
RetroTypes.hpp

71
Runtime/CMoviePlayer.cpp Normal file
View File

@ -0,0 +1,71 @@
#include "CMoviePlayer.hpp"
namespace Retro
{
CMoviePlayer::CMoviePlayer(const char* path, float startTime, bool flag)
: CDvdFile(path)
{
}
void CMoviePlayer::VerifyCallbackStatus()
{
}
void CMoviePlayer::DisableStaticAudio()
{
}
void CMoviePlayer::SetStaticAudioVolume(int vol)
{
}
void CMoviePlayer::SetStaticAudio(const void* data, u32 length, u32 loopStart, u32 loopEnd)
{
}
void CMoviePlayer::MixAudio(short* out, const short* in, u32 length)
{
}
void CMoviePlayer::MixStaticAudio(short* out, const short* in, u32 length)
{
}
void CMoviePlayer::StaticMyAudioCallback()
{
}
void CMoviePlayer::Rewind()
{
}
bool CMoviePlayer::GetIsMovieFinishedPlaying() const
{
}
bool CMoviePlayer::GetIsFullyCached() const
{
}
float CMoviePlayer::GetPlayedSeconds() const
{
}
float CMoviePlayer::GetTotalSeconds() const
{
}
void CMoviePlayer::SetPlayMode(EPlayMode mode)
{
}
void CMoviePlayer::DrawFrame(const CVector3f& a, const CVector3f& b,
const CVector3f& c, const CVector3f& d)
{
}
void CMoviePlayer::Update(float dt)
{
}
void CMoviePlayer::DecodeFromRead(const void* data)
{
}
void CMoviePlayer::ReadCompleted()
{
}
void CMoviePlayer::PostDVDReadRequestIfNeeded()
{
}
void CMoviePlayer::InitializeTextures()
{
}
}

44
Runtime/CMoviePlayer.hpp Normal file
View File

@ -0,0 +1,44 @@
#ifndef __RETRO_CMOVIEPLAYER_HPP__
#define __RETRO_CMOVIEPLAYER_HPP__
#include "RetroTypes.hpp"
#include "CDvdFile.hpp"
namespace Retro
{
class CVector3f;
class CMoviePlayer : public CDvdFile
{
public:
enum EPlayMode
{
};
CMoviePlayer(const char* path, float startTime, bool flag);
static void VerifyCallbackStatus();
static void DisableStaticAudio();
static void SetStaticAudioVolume(int vol);
static void SetStaticAudio(const void* data, u32 length, u32 loopStart, u32 loopEnd);
void MixAudio(short* out, const short* in, u32 length);
static void MixStaticAudio(short* out, const short* in, u32 length);
static void StaticMyAudioCallback();
void Rewind();
bool GetIsMovieFinishedPlaying() const;
bool GetIsFullyCached() const;
float GetPlayedSeconds() const;
float GetTotalSeconds() const;
void SetPlayMode(EPlayMode);
void DrawFrame(const CVector3f& a, const CVector3f& b, const CVector3f& c, const CVector3f& d);
void Update(float dt);
void DecodeFromRead(const void* data);
void ReadCompleted();
void PostDVDReadRequestIfNeeded();
void InitializeTextures();
};
}
#endif // __RETRO_CMOVIEPLAYER_HPP__

View File

@ -0,0 +1,22 @@
#ifndef __RETRO_CPLAYMOVIEBASE_HPP__
#define __RETRO_CPLAYMOVIEBASE_HPP__
#include "CIOWin.hpp"
#include "CMoviePlayer.hpp"
namespace Retro
{
class CPlayMovieBase : public CIOWin
{
CMoviePlayer x18_moviePlayer;
public:
CPlayMovieBase(const char* iowName, const char* path)
: CIOWin(iowName), x18_moviePlayer(path, 0.0, false) {}
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {}
void Draw() const {}
};
}
#endif // __RETRO_CPLAYMOVIEBASE_HPP__

View File

@ -25,6 +25,7 @@ private:
std::unordered_map<SObjectTag, SLoadingData> m_loadList;
void AddToLoadList(const SLoadingData& data) {m_loadList[data.tag] = data;}
public:
CResLoader& GetLoader() {return x4_loader;}
std::unique_ptr<IObj> Build(const SObjectTag&, const CVParamTransfer&);
void BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**);
void CancelBuild(const SObjectTag&);

View File

@ -10,7 +10,7 @@ extern class CSimplePool* g_SimplePool;
extern class CCharacterFactoryBuilder* g_CharFactoryBuilder;
extern class CAiFuncMap* g_AiFuncMap;
extern class CGameState* g_GameState;
extern class CInGameTweakManager* g_TweakManager;
extern class CInGameTweakManagerBase* g_TweakManager;
extern class CBooRenderer* g_Renderer;
}

View File

@ -0,0 +1,67 @@
#include "CFrontEndUI.hpp"
namespace Retro
{
namespace MP1
{
CFrontEndUI::CFrontEndUI(CArchitectureQueue& queue)
: CIOWin("CFrontEnd")
{}
void CFrontEndUI::OnSliderSelectionChange(CGuiSliderGroup* grp, float)
{}
void CFrontEndUI::OnCheckBoxSelectionChange(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnOptionSubMenuCancel(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnOptionsMenuCancel(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnNewGameMenuCancel(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnFileMenuCancel(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnGenericMenuSelectionChange(CGuiTableGroup* grp, int, int)
{}
void CFrontEndUI::OnOptionsMenuAdvance(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnNewGameMenuAdvance(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnFileMenuAdvance(CGuiTableGroup* grp)
{}
void CFrontEndUI::OnMainMenuAdvance(CGuiTableGroup* grp)
{}
const char* CFrontEndUI::GetAttractMovieFileName(int idx)
{}
const char* CFrontEndUI::GetNextAttractMovieFileName(int idx)
{}
void CFrontEndUI::SetCurrentMovie(EMenuMovie movie)
{}
void CFrontEndUI::StopAttractMovie()
{}
void CFrontEndUI::StartAttractMovie(int idx)
{}
void CFrontEndUI::UpdateMenuHighlights(CGuiTableGroup* grp)
{}
void CFrontEndUI::CompleteStateTransition()
{}
bool CFrontEndUI::CanBuild(const SObjectTag& tag)
{}
void CFrontEndUI::StartStateTransition(EScreen screen)
{}
void CFrontEndUI::HandleDebugMenuReturnValue(CGameDebug::EReturnValue val, CArchitectureQueue& queue)
{}
void CFrontEndUI::Draw() const
{}
void CFrontEndUI::UpdateMovies(float dt)
{}
void CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
{}
CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{}
void CFrontEndUI::StartGame()
{}
void CFrontEndUI::InitializeFrame()
{}
}
}

View File

@ -0,0 +1,59 @@
#ifndef __RETRO_CFRONTENDUI_HPP__
#define __RETRO_CFRONTENDUI_HPP__
#include "CIOWin.hpp"
#include "CGameDebug.hpp"
namespace Retro
{
class CGuiSliderGroup;
class CGuiTableGroup;
class SObjectTag;
namespace MP1
{
class CFrontEndUI : public CIOWin
{
public:
enum EMenuMovie
{
};
enum EScreen
{
};
CFrontEndUI(CArchitectureQueue& queue);
void OnSliderSelectionChange(CGuiSliderGroup* grp, float);
void OnCheckBoxSelectionChange(CGuiTableGroup* grp);
void OnOptionSubMenuCancel(CGuiTableGroup* grp);
void OnOptionsMenuCancel(CGuiTableGroup* grp);
void OnNewGameMenuCancel(CGuiTableGroup* grp);
void OnFileMenuCancel(CGuiTableGroup* grp);
void OnGenericMenuSelectionChange(CGuiTableGroup* grp, int, int);
void OnOptionsMenuAdvance(CGuiTableGroup* grp);
void OnNewGameMenuAdvance(CGuiTableGroup* grp);
void OnFileMenuAdvance(CGuiTableGroup* grp);
void OnMainMenuAdvance(CGuiTableGroup* grp);
const char* GetAttractMovieFileName(int idx);
const char* GetNextAttractMovieFileName(int idx);
void SetCurrentMovie(EMenuMovie movie);
void StopAttractMovie();
void StartAttractMovie(int idx);
void UpdateMenuHighlights(CGuiTableGroup* grp);
void CompleteStateTransition();
bool CanBuild(const SObjectTag& tag);
void StartStateTransition(EScreen screen);
void HandleDebugMenuReturnValue(CGameDebug::EReturnValue val, CArchitectureQueue& queue);
void Draw() const;
void UpdateMovies(float dt);
void Update(float dt, CArchitectureQueue& queue);
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void StartGame();
void InitializeFrame();
};
}
}
#endif // __RETRO_CFRONTENDUI_HPP__

View File

@ -1,20 +1,20 @@
#ifndef __RETRO_CINGAMETWEAKMANAGER_HPP__
#define __RETRO_CINGAMETWEAKMANAGER_HPP__
#include <string>
#include "CInGameTweakManagerBase.hpp"
namespace Retro
{
namespace MP1
{
class CInGameTweakManager
class CInGameTweakManager : public CInGameTweakManagerBase
{
public:
bool ReadFromMemoryCard(const std::string& name)
{
return true;
}
};
}
}
#endif // __RETRO_CINGAMETWEAKMANAGER_HPP__

View File

@ -5,6 +5,8 @@
namespace Retro
{
namespace MP1
{
CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{
@ -26,3 +28,4 @@ void CMFGameLoader::Draw() const
}
}
}

30
Runtime/MP1/CMFGame.hpp Normal file
View File

@ -0,0 +1,30 @@
#ifndef __RETRO_CMFGAME_HPP__
#define __RETRO_CMFGAME_HPP__
#include "CMFGameBase.hpp"
namespace Retro
{
namespace MP1
{
class CMFGame : public CMFGameBase
{
public:
CMFGame() : CMFGameBase("CMFGame") {}
CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void Draw() const;
};
class CMFGameLoader : public CMFGameLoaderBase
{
public:
CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader") {}
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void Draw() const;
};
}
}
#endif // __RETRO_CMFGAME_HPP__

54
Runtime/MP1/CMain.hpp Normal file
View File

@ -0,0 +1,54 @@
#ifndef __RETRO_CMAIN_HPP__
#define __RETRO_CMAIN_HPP__
#include "COsContext.hpp"
#include "CMemory.hpp"
#include "CTweaks.hpp"
#include "CPlayMovie.hpp"
namespace Retro
{
class CStopwatch;
namespace MP1
{
enum EGameplayResult
{
GameplayResultNone,
GameplayResultWin,
GameplayResultLose,
GameplayResultPlaying
};
class CMain : public COsContext
{
CMemorySys x6c_memSys;
CTweaks x70_tweaks;
EGameplayResult xe4_gameplayResult;
bool xe8_finished = false;
public:
CMain();
void RegisterResourceTweaks();
void ResetGameState();
void StreamNewGameState(CInputStream&);
void CheckTweakManagerDebugOptions() {}
void AddWorldPaks();
int RsMain(int argc, const char* argv[]);
bool CheckReset();
bool CheckTerminate() {return false;}
void DrawDebugMetrics(double, CStopwatch&) {}
void DoPredrawMetrics() {}
void FillInAssetIDs();
void LoadAudio();
void ShutdownSubsystems();
void InitializeSubsystems();
EGameplayResult GetGameplayResult() const {return xe4_gameplayResult;}
void SetGameplayResult(EGameplayResult wl) {xe4_gameplayResult = wl;}
};
extern CMain* g_main;
}
}
#endif // __RETRO_CMAIN_HPP__

61
Runtime/MP1/CMainFlow.cpp Normal file
View File

@ -0,0 +1,61 @@
#include "CMainFlow.hpp"
#include "CArchitectureQueue.hpp"
#include "CMFGame.hpp"
#include "CMain.hpp"
#include "CPlayMovie.hpp"
#include "CResFactory.hpp"
#include "CFrontEndUI.hpp"
#include "GameGlobalObjects.hpp"
namespace Retro
{
namespace MP1
{
void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
{
switch (state)
{
case ClientStateFrontEnd:
{
if (g_main->GetGameplayResult() == GameplayResultNone)
{
g_main->SetGameplayResult(GameplayResultPlaying);
break;
}
CResLoader& loader = g_ResFactory->GetLoader();
while (!loader.AreAllPaksLoaded())
loader.AsyncIdlePakLoading();
g_main->LoadAudio();
g_main->RegisterResourceTweaks();
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 12, 11, new CFrontEndUI(queue))));
break;
}
case ClientStateGameLoad:
{
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 10, 1000, new CMFGameLoader())));
break;
}
case ClientStateMoviePlay:
{
switch (g_main->GetGameplayResult())
{
case GameplayResultWin:
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 12, 11, new CPlayMovie(CPlayMovie::MovieWinGame))));
break;
case GameplayResultLose:
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 12, 11, new CPlayMovie(CPlayMovie::MovieLoseGame))));
break;
default: break;
}
break;
}
default: break;
}
}
}
}

View File

@ -1,29 +1,27 @@
#ifndef __RETRO_CMAINFLOW_HPP__
#define __RETRO_CMAINFLOW_HPP__
#include "CIOWin.hpp"
#include "CMainFlowBase.hpp"
namespace Retro
{
class CArchitectureMessage;
class CArchitectureQueue;
enum EClientFlowStates
namespace MP1
{
StateGameLoad = 13,
};
class CMainFlow : public CIOWin
class CMainFlow : public CMainFlowBase
{
public:
CMainFlow() : CIOWin("CMainFlow") {}
void AdvanceGameState(CArchitectureQueue& queue);
CMainFlow() : CMainFlowBase("CMainFlow") {}
void SetGameState(EClientFlowStates state, CArchitectureQueue& queue);
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
bool GetIsContinueDraw() const {return false;}
void Draw() const {}
};
}
}
#endif // __RETRO_CMAINFLOW_HPP__

View File

@ -3,6 +3,11 @@ add_executable(mp1
CTweaks.hpp CTweaks.cpp
CInGameTweakManager.hpp CInGameTweakManager.cpp
CTweakParticle.hpp CTweakParticle.cpp
CMainFlow.hpp CMainFlow.cpp
CMFGame.hpp CMFGame.cpp
CPlayMovie.hpp CPlayMovie.cpp
CFrontEndUI.hpp CFrontEndUI.cpp
CMain.hpp
main.cpp)
target_link_libraries(mp1
RuntimeCommonCharacter

View File

@ -0,0 +1,13 @@
namespace Retro
{
namespace MP1
{
const char* kMovies[] =
{
"Video/wingame.thp",
"Video/losegame.thp"
};
}
}

View File

@ -0,0 +1,30 @@
#ifndef __RETRO_CPLAYMOVIE_HPP__
#define __RETRO_CPLAYMOVIE_HPP__
#include "CPlayMovieBase.hpp"
namespace Retro
{
namespace MP1
{
extern const char* kMovies[];
class CPlayMovie : public CPlayMovieBase
{
public:
enum EWhichMovie
{
MovieWinGame,
MovieLoseGame
};
private:
EWhichMovie x14_which;
public:
CPlayMovie(EWhichMovie which) : CPlayMovieBase("CPlayMovie", kMovies[which]), x14_which(which) {}
};
}
}
#endif // __RETRO_CPLAYMOVIE_HPP__

View File

@ -2,6 +2,8 @@
namespace Retro
{
namespace MP1
{
CTweakParticle::CTweakParticle(CInputStream&)
{
@ -9,3 +11,4 @@ CTweakParticle::CTweakParticle(CInputStream&)
}
}
}

View File

@ -6,6 +6,8 @@
namespace Retro
{
namespace MP1
{
class CTweakParticle : DNAMP1::CTweakParticle
{
@ -13,6 +15,7 @@ public:
CTweakParticle(CInputStream&);
};
}
}
#endif // __RETRO_CTWEAKPARTICLE_HPP__

View File

@ -2,6 +2,8 @@
namespace Retro
{
namespace MP1
{
void CTweaks::RegisterTweaks()
{
@ -12,3 +14,4 @@ void CTweaks::RegisterResourceTweaks()
}
}
}

View File

@ -6,6 +6,8 @@
namespace Retro
{
namespace MP1
{
class CTweaks
{
@ -15,6 +17,7 @@ public:
void RegisterResourceTweaks();
};
}
}
#endif // __RETRO_CTWEAKS_HPP__

View File

@ -1,9 +1,6 @@
#include <memory>
#include <boo/boo.hpp>
#include "COsContext.hpp"
#include "CBasics.hpp"
#include "CTweaks.hpp"
#include "CMemory.hpp"
#include "CMemoryCardSys.hpp"
#include "CResFactory.hpp"
#include "CSimplePool.hpp"
@ -25,6 +22,7 @@
#include "Audio/CAudioStateWin.hpp"
#include "GameGlobalObjects.hpp"
#include "CArchitectureQueue.hpp"
#include "CMain.hpp"
namespace Retro
{
@ -34,11 +32,12 @@ CSimplePool* g_SimplePool = nullptr;
CCharacterFactoryBuilder* g_CharFactoryBuilder = nullptr;
CAiFuncMap* g_AiFuncMap = nullptr;
CGameState* g_GameState = nullptr;
CInGameTweakManager* g_TweakManager = nullptr;
CInGameTweakManagerBase* g_TweakManager = nullptr;
CBooRenderer* g_Renderer = nullptr;
namespace MP1
{
class CMain* g_main = nullptr;
class CGameGlobalObjects
{
@ -109,46 +108,50 @@ public:
}
};
class CMain : public COsContext
{
CMemorySys m_memSys;
CTweaks m_tweaks;
bool m_finished = false;
public:
CMain()
: m_memSys(*this, CMemorySys::GetGameAllocator())
CMain::CMain()
: x6c_memSys(*this, CMemorySys::GetGameAllocator())
{
OpenWindow("", 0, 0, 640, 480);
g_main = this;
xe4_gameplayResult = GameplayResultPlaying;
}
void InitializeSubsystems()
void CMain::RegisterResourceTweaks()
{
}
void CMain::ResetGameState()
{
}
void CMain::InitializeSubsystems()
{
CElementGen::Initialize();
CAnimData::InitializeCache();
CDecalManager::Initialize();
}
void AddWorldPaks()
void CMain::AddWorldPaks()
{
}
void FillInAssetIDs()
void CMain::FillInAssetIDs()
{
}
int RsMain(int argc, const char* argv[])
void CMain::LoadAudio()
{
}
int CMain::RsMain(int argc, const char* argv[])
{
TOneStatic<CGameGlobalObjects> globalObjs;
InitializeSubsystems();
globalObjs->PostInitialize(*this, m_memSys);
m_tweaks.RegisterTweaks();
globalObjs->PostInitialize(*this, x6c_memSys);
x70_tweaks.RegisterTweaks();
AddWorldPaks();
g_TweakManager->ReadFromMemoryCard("AudioTweaks");
FillInAssetIDs();
TOneStatic<CGameArchitectureSupport> archSupport(*this);
while (!m_finished)
while (!xe8_finished)
{
m_finished = archSupport->Update();
xe8_finished = archSupport->Update();
}
return 0;
}
};
}
}