2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:47:42 +00:00

CFrontEndUI work

This commit is contained in:
Jack Andersen
2017-01-08 17:44:00 -10:00
parent ef43c3319b
commit 4c09493a3f
19 changed files with 938 additions and 376 deletions

View File

@@ -61,6 +61,22 @@ bool CSaveWorldIntermediate::InitializePump()
return false;
}
bool CMemoryCardSys::HasSaveWorldMemory(ResId wldId) const
{
auto existingSearch =
std::find_if(xc_memoryWorlds.cbegin(), xc_memoryWorlds.cend(), [&](const auto& wld)
{ return wld.first == wldId; });
return existingSearch != xc_memoryWorlds.cend();
}
const CSaveWorldMemory& CMemoryCardSys::GetSaveWorldMemory(ResId wldId) const
{
auto existingSearch =
std::find_if(xc_memoryWorlds.cbegin(), xc_memoryWorlds.cend(), [&](const auto& wld)
{ return wld.first == wldId; });
return existingSearch->second;
}
CMemoryCardSys::CMemoryCardSys()
{
g_CardImagePaths[0] = ResolveDolphinCardPath(kabufuda::ECardSlot::SlotA);
@@ -74,10 +90,7 @@ CMemoryCardSys::CMemoryCardSys()
{
if (tag.type == FOURCC('MLVL'))
{
auto existingSearch =
std::find_if(xc_memoryWorlds.cbegin(), xc_memoryWorlds.cend(), [&](const auto& wld)
{ return wld.first == tag.id; });
if (existingSearch == xc_memoryWorlds.cend())
if (!HasSaveWorldMemory(tag.id))
{
xc_memoryWorlds.emplace_back(tag.id, CSaveWorldMemory{});
x1c_worldInter->emplace_back(tag.id, -1);