Initial cook tool update

This commit is contained in:
Jack Andersen 2015-09-29 20:23:40 -10:00
parent eed44c8230
commit 5f68a2a992
6 changed files with 37 additions and 159 deletions

View File

@ -6,7 +6,7 @@ namespace Retro
static LogVisor::LogModule Log("Retro::SpecBase");
bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport>& reps)
bool SpecBase::canExtract(const ExtractPassInfo& info, std::list<ExtractReport>& reps)
{
m_disc = NOD::OpenDiscFromImage(info.srcpath.c_str(), m_isWii);
if (!m_disc)
@ -45,7 +45,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport
return checkFromTrilogyDisc(*m_disc, *regstr, info.extractArgs, reps);
}
void SpecBase::doExtract(const ExtractPassInfo& info, FExtractProgress progress)
void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress)
{
if (!Blender::BuildMasterShader(m_masterShader))
Log.report(LogVisor::FatalError, "Unable to build master shader blend");
@ -85,12 +85,12 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FExtractProgress progress)
extractFromDisc(*m_disc, info.force, progress);
}
bool SpecBase::canCook(const CookTaskInfo& info)
bool SpecBase::canCook(const HECL::ProjectPath& path)
{
return false;
}
void SpecBase::doCook(const CookTaskInfo& info)
void SpecBase::doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& cookedPath)
{
}

View File

@ -11,11 +11,11 @@ namespace Retro
struct SpecBase : HECL::Database::IDataSpec
{
bool canExtract(const ExtractPassInfo& info, std::vector<ExtractReport>& reps);
void doExtract(const ExtractPassInfo& info, FExtractProgress progress);
bool canExtract(const ExtractPassInfo& info, std::list<ExtractReport>& reps);
void doExtract(const ExtractPassInfo& info, FProgress progress);
bool canCook(const CookTaskInfo& info);
void doCook(const CookTaskInfo& info);
bool canCook(const HECL::ProjectPath& path);
void doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& cookedPath);
bool canPackage(const PackagePassInfo& info);
void gatherDependencies(const PackagePassInfo& info,
@ -25,31 +25,17 @@ struct SpecBase : HECL::Database::IDataSpec
virtual bool checkStandaloneID(const char* id) const=0;
virtual bool checkFromStandaloneDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)=0;
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)=0;
virtual bool checkFromTrilogyDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)=0;
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)=0;
virtual bool extractFromDisc(NOD::DiscBase& disc, bool force,
FExtractProgress progress)=0;
FProgress progress)=0;
virtual bool checkFromProject()=0;
virtual bool readFromProject()=0;
virtual bool visitGameObjects(std::function<bool(const HECL::Database::ObjectBase&)>)=0;
struct ILevelSpec
{
virtual bool visitLevelObjects(std::function<bool(const HECL::Database::ObjectBase&)>)=0;
struct IAreaSpec
{
virtual bool visitAreaObjects(std::function<bool(const HECL::Database::ObjectBase&)>)=0;
};
virtual bool visitAreas(std::function<bool(const IAreaSpec&)>)=0;
};
virtual bool visitLevels(std::function<bool(const ILevelSpec&)>)=0;
inline const HECL::ProjectPath& getMasterShaderPath() const {return m_masterShader;}
const HECL::ProjectPath& getMasterShaderPath() const {return m_masterShader;}
SpecBase(HECL::Database::Project& project)
: m_project(project),

View File

@ -35,7 +35,7 @@ struct SpecMP1 : SpecBase
m_pakRouter(*this, m_workPath, m_cookPath) {}
void buildPaks(NOD::DiscBase::IPartition::Node& root,
const std::vector<HECL::SystemString>& args,
const std::list<HECL::SystemString>& args,
ExtractReport& rep)
{
m_nonPaks.clear();
@ -118,8 +118,8 @@ struct SpecMP1 : SpecBase
bool checkFromStandaloneDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)
{
NOD::DiscGCN::IPartition* partition = disc.getDataPartition();
std::unique_ptr<uint8_t[]> dolBuf = partition->getDOLBuf();
@ -149,10 +149,10 @@ struct SpecMP1 : SpecBase
bool checkFromTrilogyDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)
{
std::vector<HECL::SystemString> mp1args;
std::list<HECL::SystemString> mp1args;
bool doExtract = false;
if (args.size())
{
@ -208,7 +208,7 @@ struct SpecMP1 : SpecBase
return true;
}
bool extractFromDisc(NOD::DiscBase&, bool force, FExtractProgress progress)
bool extractFromDisc(NOD::DiscBase&, bool force, FProgress progress)
{
NOD::ExtractionContext ctx = {true, force, nullptr};
@ -259,42 +259,6 @@ struct SpecMP1 : SpecBase
return true;
}
bool checkFromProject()
{
return false;
}
bool readFromProject()
{
return false;
}
bool visitGameObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
struct LevelSpec : public ILevelSpec
{
bool visitLevelObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
struct AreaSpec : public IAreaSpec
{
bool visitAreaObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
};
bool visitAreas(std::function<bool(const IAreaSpec&)>)
{
return false;
}
};
bool visitLevels(std::function<bool(const ILevelSpec&)>)
{
return false;
}
};
HECL::Database::DataSpecEntry SpecEntMP1 =

View File

@ -33,7 +33,7 @@ struct SpecMP2 : SpecBase
m_pakRouter(*this, m_workPath, m_cookPath) {}
void buildPaks(NOD::DiscBase::IPartition::Node& root,
const std::vector<HECL::SystemString>& args,
const std::list<HECL::SystemString>& args,
ExtractReport& rep)
{
m_nonPaks.clear();
@ -115,8 +115,8 @@ struct SpecMP2 : SpecBase
bool checkFromStandaloneDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)
{
NOD::DiscGCN::IPartition* partition = disc.getDataPartition();
std::unique_ptr<uint8_t[]> dolBuf = partition->getDOLBuf();
@ -142,10 +142,10 @@ struct SpecMP2 : SpecBase
bool checkFromTrilogyDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)
{
std::vector<HECL::SystemString> mp2args;
std::list<HECL::SystemString> mp2args;
bool doExtract = false;
if (args.size())
{
@ -201,7 +201,7 @@ struct SpecMP2 : SpecBase
return true;
}
bool extractFromDisc(NOD::DiscBase&, bool force, FExtractProgress progress)
bool extractFromDisc(NOD::DiscBase&, bool force, FProgress progress)
{
NOD::ExtractionContext ctx = {true, force, nullptr};
progress(_S("Indexing PAKs"), _S(""), 2, 0.0);
@ -251,42 +251,6 @@ struct SpecMP2 : SpecBase
return true;
}
bool checkFromProject()
{
return false;
}
bool readFromProject()
{
return false;
}
bool visitGameObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
struct LevelSpec : public ILevelSpec
{
bool visitLevelObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
struct AreaSpec : public IAreaSpec
{
bool visitAreaObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
};
bool visitAreas(std::function<bool(const IAreaSpec&)>)
{
return false;
}
};
bool visitLevels(std::function<bool(const ILevelSpec&)>)
{
return false;
}
};
HECL::Database::DataSpecEntry SpecEntMP2

View File

@ -48,7 +48,7 @@ struct SpecMP3 : SpecBase
m_fePakRouter(*this, m_feWorkPath, m_feCookPath) {}
void buildPaks(NOD::DiscBase::IPartition::Node& root,
const std::vector<HECL::SystemString>& args,
const std::list<HECL::SystemString>& args,
ExtractReport& rep,
bool fe)
{
@ -170,8 +170,8 @@ struct SpecMP3 : SpecBase
bool checkFromStandaloneDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)
{
doMP3 = true;
NOD::DiscGCN::IPartition* partition = disc.getDataPartition();
@ -202,11 +202,11 @@ struct SpecMP3 : SpecBase
bool checkFromTrilogyDisc(NOD::DiscBase& disc,
const HECL::SystemString& regstr,
const std::vector<HECL::SystemString>& args,
std::vector<ExtractReport>& reps)
const std::list<HECL::SystemString>& args,
std::list<ExtractReport>& reps)
{
std::vector<HECL::SystemString> mp3args;
std::vector<HECL::SystemString> feargs;
std::list<HECL::SystemString> mp3args;
std::list<HECL::SystemString> feargs;
if (args.size())
{
/* Needs filter */
@ -319,7 +319,7 @@ struct SpecMP3 : SpecBase
return true;
}
bool extractFromDisc(NOD::DiscBase&, bool force, FExtractProgress progress)
bool extractFromDisc(NOD::DiscBase&, bool force, FProgress progress)
{
int compIdx = 2;
HECL::SystemString currentTarget = _S("");
@ -430,42 +430,6 @@ struct SpecMP3 : SpecBase
}
return true;
}
bool checkFromProject()
{
return false;
}
bool readFromProject()
{
return false;
}
bool visitGameObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
struct LevelSpec : public ILevelSpec
{
bool visitLevelObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
struct AreaSpec : public IAreaSpec
{
bool visitAreaObjects(std::function<bool(const HECL::Database::ObjectBase&)>)
{
return false;
}
};
bool visitAreas(std::function<bool(const IAreaSpec&)>)
{
return false;
}
};
bool visitLevels(std::function<bool(const ILevelSpec&)>)
{
return false;
}
};
HECL::Database::DataSpecEntry SpecEntMP3

2
hecl

@ -1 +1 @@
Subproject commit a0f708ae8990798380ce5ef8c5d24290bac5035c
Subproject commit aae0f7390ff6a7fcf81df423a7fe66091713b7da