2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-15 11:26:09 +00:00

Self-rebuilding resource cache; init performance improvements

This commit is contained in:
Jack Andersen
2016-09-17 11:33:32 -10:00
parent 386e9445e5
commit cfb16f34f1
13 changed files with 175 additions and 127 deletions

View File

@@ -9,9 +9,9 @@ namespace urde
static const char* SplashTextures[]
{
"MP1/NoARAM/TXTR_NintendoLogo.png",
"MP1/NoARAM/TXTR_RetroLogo.png",
"MP1/NoARAM/TXTR_DolbyLogo.png"
"TXTR_NintendoLogo",
"TXTR_RetroLogo",
"TXTR_DolbyLogo"
};
CSplashScreen::CSplashScreen(ESplashScreen which)

View File

@@ -13,21 +13,23 @@ CSlideShow::CSlideShow()
x134_30_ = true;
x135_24_ = true;
const SObjectTag* font = g_ResFactory->GetResourceIdByName(g_tweakSlideShow->GetFont().c_str());
if (font)
{
CGuiTextProperties propsA(false, true, EJustification::Center, EVerticalJustification::Bottom);
xc4_textA = std::make_unique<CGuiTextSupport>(font->id, propsA,
g_tweakSlideShow->GetFontColor(),
g_tweakSlideShow->GetOutlineColor(),
zeus::CColor::skWhite, 640, 480, g_SimplePool);
/* Originally came from SlideShow tweak */
SObjectTag font = ProjectManager::g_SharedManager->TagFromPath(_S("MP1/NoARAM/FONT_Deface14B.yaml"));
CGuiTextProperties propsB(false, true, EJustification::Right, EVerticalJustification::Bottom);
xc8_textB = std::make_unique<CGuiTextSupport>(font->id, propsB,
g_tweakSlideShow->GetFontColor(),
g_tweakSlideShow->GetOutlineColor(),
zeus::CColor::skWhite, 640, 480, g_SimplePool);
}
CGuiTextProperties propsA(false, true, EJustification::Center, EVerticalJustification::Bottom);
xc4_textA = std::make_unique<CGuiTextSupport>(font.id, propsA,
g_tweakSlideShow->GetFontColor(),
g_tweakSlideShow->GetOutlineColor(),
zeus::CColor::skWhite, 640, 480, g_SimplePool);
CGuiTextProperties propsB(false, true, EJustification::Right, EVerticalJustification::Bottom);
xc8_textB = std::make_unique<CGuiTextSupport>(font.id, propsB,
g_tweakSlideShow->GetFontColor(),
g_tweakSlideShow->GetOutlineColor(),
zeus::CColor::skWhite, 640, 480, g_SimplePool);
xf8_.reserve(18);
}
CIOWin::EMessageReturn CSlideShow::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)

View File

@@ -34,16 +34,16 @@ void CTweaks::RegisterTweaks()
ProjectResourceFactoryMP1& factory = ProjectManager::g_SharedManager->resourceFactoryMP1();
std::experimental::optional<CMemoryInStream> strm;
SObjectTag tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/SlideShow.yaml"));
strm.emplace(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag));
const SObjectTag* tag = factory.GetResourceIdByName("SlideShow");
strm.emplace(factory.LoadResourceSync(*tag).release(), factory.ResourceSize(*tag));
g_tweakSlideShow = new DataSpec::DNAMP1::CTweakSlideShow(*strm);
tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/Player.yaml"));
strm.emplace(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag));
tag = factory.GetResourceIdByName("Player");
strm.emplace(factory.LoadResourceSync(*tag).release(), factory.ResourceSize(*tag));
g_tweakPlayer = new DataSpec::DNAMP1::CTweakPlayer(*strm);
tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/CameraBob.yaml"));
strm.emplace(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag));
tag = factory.GetResourceIdByName("CameraBob");
strm.emplace(factory.LoadResourceSync(*tag).release(), factory.ResourceSize(*tag));
CPlayerCameraBob::ReadTweaks(*strm);
}
@@ -52,12 +52,12 @@ void CTweaks::RegisterResourceTweaks()
ProjectResourceFactoryMP1& factory = ProjectManager::g_SharedManager->resourceFactoryMP1();
std::experimental::optional<CMemoryInStream> strm;
SObjectTag tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/GunRes.yaml"));
strm.emplace(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag));
const SObjectTag* tag = factory.GetResourceIdByName("GunRes");
strm.emplace(factory.LoadResourceSync(*tag).release(), factory.ResourceSize(*tag));
g_tweakGunRes = new DataSpec::DNAMP1::CTweakGunRes(*strm);
tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/PlayerRes.yaml"));
strm.emplace(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag));
tag = factory.GetResourceIdByName("PlayerRes");
strm.emplace(factory.LoadResourceSync(*tag).release(), factory.ResourceSize(*tag));
g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm);
}

View File

@@ -339,7 +339,7 @@ void CWorldTransManager::EnableTransition(const CAnimRes& samusRes,
const std::string& modelName = g_tweakPlayerRes->GetBeamCineModel(
DataSpec::ITweakPlayerRes::EBeamId(g_GameState->GetPlayerState()->GetCurrentBeam()));
x4_modelData->x14c_beamModel = g_SimplePool->GetObj(("MP1/TestAnim/" + modelName + ".blend").c_str());
x4_modelData->x14c_beamModel = g_SimplePool->GetObj(modelName.c_str());
TToken<CCharacterFactory> fac = g_CharFactoryBuilder->GetFactory(samusRes);
const CCharacterInfo& info = fac.GetObj()->GetCharInfo(GetSuitCharIdx());