2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 17:47:43 +00:00

Refactor of CMDL to effectively share across games

This commit is contained in:
Jack Andersen
2015-08-09 15:53:24 -10:00
parent ca49972974
commit 310aa10116
19 changed files with 705 additions and 238 deletions

View File

@@ -20,7 +20,6 @@ struct SpecMP1 : SpecBase
return false;
}
bool doMP1 = false;
std::vector<const NOD::DiscBase::IPartition::Node*> m_nonPaks;
std::vector<DNAMP1::PAKBridge> m_paks;
std::map<std::string, DNAMP1::PAKBridge*, CaseInsensitiveCompare> m_orderedPaks;
@@ -122,7 +121,6 @@ struct SpecMP1 : SpecBase
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
{
doMP1 = true;
NOD::DiscGCN::IPartition* partition = disc.getDataPartition();
std::unique_ptr<uint8_t[]> dolBuf = partition->getDOLBuf();
const char* buildInfo = (char*)memmem(dolBuf.get(), partition->getDOLSize(), "MetroidBuildInfo", 16) + 19;
@@ -152,6 +150,7 @@ struct SpecMP1 : SpecBase
std::vector<ExtractReport>& reps)
{
std::vector<HECL::SystemString> mp1args;
bool doExtract = false;
if (args.size())
{
/* Needs filter */
@@ -161,7 +160,7 @@ struct SpecMP1 : SpecBase
HECL::ToLower(lowerArg);
if (!lowerArg.compare(0, 3, _S("mp1")))
{
doMP1 = true;
doExtract = true;
size_t slashPos = arg.find(_S('/'));
if (slashPos == HECL::SystemString::npos)
slashPos = arg.find(_S('\\'));
@@ -171,10 +170,10 @@ struct SpecMP1 : SpecBase
}
}
else
doMP1 = true;
doExtract = true;
if (!doMP1)
return true;
if (!doExtract)
return false;
NOD::DiscGCN::IPartition* partition = disc.getDataPartition();
NOD::DiscBase::IPartition::Node& root = partition->getFSTRoot();
@@ -208,9 +207,6 @@ struct SpecMP1 : SpecBase
bool extractFromDisc(NOD::DiscBase&, bool force, FExtractProgress progress)
{
if (!doMP1)
return true;
progress(_S("Indexing PAKs"), 2, 0.0);
m_pakRouter.build(m_paks, [&progress](float factor)
{