2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 05:07:43 +00:00
This commit is contained in:
2017-02-12 16:00:28 -08:00
29 changed files with 1314 additions and 1842 deletions

View File

@@ -41,6 +41,8 @@ public:
virtual std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag)=0;
virtual std::unique_ptr<u8[]> LoadResourcePartSync(const urde::SObjectTag& tag, u32 size, u32 off)=0;
virtual void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const {}
virtual ResId TranslateOriginalToNew(ResId id) const { return -1; }
virtual ResId TranslateNewToOriginal(ResId id) const { return -1; }
};

View File

@@ -65,9 +65,23 @@ CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader")
}
}
static const char* LoadDepPAKs[] =
{
"TestAnim",
"SamusGun",
"SamGunFx",
nullptr
};
void CMFGameLoader::MakeLoadDependencyList()
{
std::vector<SObjectTag> tags;
for (int i=0 ; LoadDepPAKs[i] ; ++i)
g_ResFactory->GetTagListForFile(LoadDepPAKs[i], tags);
x1c_loadList.reserve(tags.size());
for (const SObjectTag& tag : tags)
x1c_loadList.push_back(g_SimplePool->GetObj(tag));
}
CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
@@ -124,12 +138,26 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg,
wldState.GetDesiredAreaAssetId());
return EMessageReturn::Exit;
}
else
if (!x18_guiMgr)
x18_guiMgr = std::make_shared<CInGameGuiManager>(*x14_stateMgr, queue);
if (!x18_guiMgr->CheckLoadComplete(*x14_stateMgr))
return EMessageReturn::Exit;
x1c_loadList.clear();
wtMgr->StartTextFadeOut();
x2c_25_transitionFinished = wtMgr->IsTransitionFinished();
return EMessageReturn::Exit;
}
case EArchMsgType::FrameBegin:
{
if (x2c_25_transitionFinished)
{
if (!x18_guiMgr)
{
x18_guiMgr = std::make_shared<CInGameGuiManager>(*x14_stateMgr, queue);
}
queue.Push(
MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 10, 1000,
std::make_shared<CMFGame>(x14_stateMgr, x18_guiMgr, queue)));
return EMessageReturn::RemoveIOWinAndExit;
}
}
default:

View File

@@ -47,7 +47,7 @@ class CMFGameLoader : public CMFGameLoaderBase
struct
{
bool x2c_24_initialized : 1;
bool x2c_25_ : 1;
bool x2c_25_transitionFinished : 1;
};
u8 _dummy = 0;
};