metaforce/Runtime/MP1/CPreFrontEnd.cpp

38 lines
921 B
C++
Raw Normal View History

#include "CPreFrontEnd.hpp"
2017-01-20 03:53:32 +00:00
#include "CResLoader.hpp"
#include "GameGlobalObjects.hpp"
#include "MP1.hpp"
2017-12-29 08:08:12 +00:00
namespace urde::MP1
{
CPreFrontEnd::CPreFrontEnd()
: CIOWin("Pre front-end window")
{
}
2017-01-20 03:53:32 +00:00
CIOWin::EMessageReturn CPreFrontEnd::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue&)
{
2017-01-20 03:53:32 +00:00
if (msg.GetType() != EArchMsgType::TimerTick)
return EMessageReturn::Normal;
CMain* m = static_cast<CMain*>(g_Main);
2017-10-26 05:37:46 +00:00
if (CResLoader* loader = g_ResFactory->GetResLoader())
2017-10-27 10:10:32 +00:00
if (!loader->AreAllPaksLoaded())
2017-10-26 05:37:46 +00:00
return EMessageReturn::Exit;
2017-01-20 03:53:32 +00:00
if (!x14_resourceTweaksRegistered)
{
m->RegisterResourceTweaks();
x14_resourceTweaksRegistered = true;
}
m->MemoryCardInitializePump();
if (!g_MemoryCardSys)
return EMessageReturn::Exit;
if (!m->LoadAudio())
return EMessageReturn::Exit;
return EMessageReturn::RemoveIOWinAndExit;
}
}