mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 17:04:55 +00:00
General resource handling bug fixes
This commit is contained in:
@@ -531,6 +531,21 @@ struct ANCS : BigYAML
|
||||
trans->enumeratePrimitives(func);
|
||||
}
|
||||
|
||||
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const
|
||||
{
|
||||
for (const CharacterSet::CharacterInfo& ci : characterSet.characters)
|
||||
{
|
||||
for (const auto& id : ci.partResData.part)
|
||||
g_curSpec->flattenDependencies(id, pathsOut);
|
||||
for (const auto& id : ci.partResData.swhc)
|
||||
g_curSpec->flattenDependencies(id, pathsOut);
|
||||
for (const auto& id : ci.partResData.unk)
|
||||
g_curSpec->flattenDependencies(id, pathsOut);
|
||||
for (const auto& id : ci.partResData.elsc)
|
||||
g_curSpec->flattenDependencies(id, pathsOut);
|
||||
}
|
||||
}
|
||||
|
||||
static bool Extract(const SpecBase& dataSpec,
|
||||
PAKEntryReadStream& rs,
|
||||
const hecl::ProjectPath& outPath,
|
||||
|
||||
@@ -400,6 +400,14 @@ void SpecBase::flattenDependencies(const hecl::ProjectPath& path,
|
||||
if (evntPath.isFile())
|
||||
pathsOut.push_back(evntPath);
|
||||
}
|
||||
ds.close();
|
||||
|
||||
hecl::ProjectPath yamlPath = asGlob.getWithExtension(_S(".yaml"), true);
|
||||
if (yamlPath.isFile())
|
||||
{
|
||||
athena::io::FileReader reader(yamlPath.getAbsolutePath());
|
||||
flattenDependenciesANCSYAML(reader, pathsOut);
|
||||
}
|
||||
|
||||
pathsOut.push_back(asGlob);
|
||||
return;
|
||||
|
||||
@@ -106,6 +106,7 @@ struct SpecBase : hecl::Database::IDataSpec
|
||||
void flattenDependencies(const class UniqueID32& id, std::vector<hecl::ProjectPath>& pathsOut);
|
||||
void flattenDependencies(const class UniqueID64& id, std::vector<hecl::ProjectPath>& pathsOut);
|
||||
virtual void flattenDependenciesYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)=0;
|
||||
virtual void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)=0;
|
||||
|
||||
virtual void buildWorldPakList(const hecl::ProjectPath& worldPath,
|
||||
const hecl::ProjectPath& worldPathCooked,
|
||||
|
||||
@@ -1132,6 +1132,21 @@ struct SpecMP1 : SpecBase
|
||||
}
|
||||
}
|
||||
|
||||
void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)
|
||||
{
|
||||
athena::io::YAMLDocReader reader;
|
||||
if (reader.parse(&fin))
|
||||
{
|
||||
std::string classStr = reader.readString("DNAType");
|
||||
if (!classStr.compare(DNAMP1::ANCS::DNAType()))
|
||||
{
|
||||
DNAMP1::ANCS ancs;
|
||||
ancs.read(reader);
|
||||
ancs.gatherDependencies(pathsOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void buildWorldPakList(const hecl::ProjectPath& worldPath,
|
||||
const hecl::ProjectPath& worldPathCooked,
|
||||
hecl::BlenderToken& btok,
|
||||
@@ -1168,8 +1183,13 @@ struct SpecMP1 : SpecBase
|
||||
nameEnt.write(w);
|
||||
|
||||
for (const auto& area : mlvl.areas)
|
||||
{
|
||||
urde::SObjectTag nameTag(FOURCC('STRG'), area.areaNameId.toUint32());
|
||||
if (nameTag)
|
||||
listOut.push_back(nameTag);
|
||||
for (const auto& dep : area.deps)
|
||||
listOut.push_back({dep.type, dep.id.toUint32()});
|
||||
}
|
||||
|
||||
urde::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint32());
|
||||
if (nameTag)
|
||||
|
||||
@@ -370,6 +370,10 @@ struct SpecMP2 : SpecBase
|
||||
{
|
||||
}
|
||||
|
||||
void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)
|
||||
{
|
||||
}
|
||||
|
||||
void cookAudioGroup(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
|
||||
FCookProgress progress)
|
||||
{
|
||||
|
||||
@@ -564,6 +564,10 @@ struct SpecMP3 : SpecBase
|
||||
{
|
||||
}
|
||||
|
||||
void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)
|
||||
{
|
||||
}
|
||||
|
||||
void cookAudioGroup(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
|
||||
FCookProgress progress)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user