mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 19:47:43 +00:00
AuxiliaryID32 implemented for sub-resources
This commit is contained in:
@@ -381,10 +381,23 @@ void ANCS::AnimationSet::read(athena::io::IStreamReader& reader)
|
||||
atUint16 sectionCount = reader.readUint16Big();
|
||||
|
||||
atUint32 animationCount = reader.readUint32Big();
|
||||
reader.enumerate(animations, animationCount);
|
||||
animations.clear();
|
||||
animations.reserve(animationCount);
|
||||
for (atUint32 i=0 ; i<animationCount ; ++i)
|
||||
{
|
||||
animations.emplace_back(m_ancsId);
|
||||
animations.back().read(reader);
|
||||
}
|
||||
|
||||
atUint32 transitionCount = reader.readUint32Big();
|
||||
reader.enumerate(transitions, transitionCount);
|
||||
transitions.clear();
|
||||
transitions.reserve(transitionCount);
|
||||
for (atUint32 i=0 ; i<transitionCount ; ++i)
|
||||
{
|
||||
transitions.emplace_back(m_ancsId);
|
||||
transitions.back().read(reader);
|
||||
}
|
||||
|
||||
defaultTransition.read(reader);
|
||||
|
||||
additiveAnims.clear();
|
||||
@@ -399,8 +412,14 @@ void ANCS::AnimationSet::read(athena::io::IStreamReader& reader)
|
||||
halfTransitions.clear();
|
||||
if (sectionCount > 2)
|
||||
{
|
||||
atUint32 halfTransitionCount = reader.readUint32Big();
|
||||
reader.enumerate(halfTransitions, halfTransitionCount);
|
||||
atUint32 halfTransitionCount = reader.readUint32Big();
|
||||
halfTransitions.clear();
|
||||
halfTransitions.reserve(halfTransitionCount);
|
||||
for (atUint32 i=0 ; i<halfTransitionCount ; ++i)
|
||||
{
|
||||
halfTransitions.emplace_back(m_ancsId);
|
||||
halfTransitions.back().read(reader);
|
||||
}
|
||||
}
|
||||
|
||||
evnts.clear();
|
||||
@@ -498,9 +517,32 @@ void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader)
|
||||
{
|
||||
atUint16 sectionCount = reader.readUint16("sectionCount");
|
||||
|
||||
reader.enumerate("animations", animations);
|
||||
size_t animationCount;
|
||||
reader.enterSubVector("animations", animationCount);
|
||||
animations.clear();
|
||||
animations.reserve(animationCount);
|
||||
for (size_t i=0 ; i<animationCount ; ++i)
|
||||
{
|
||||
animations.emplace_back(m_ancsId);
|
||||
reader.enterSubRecord(nullptr);
|
||||
animations.back().read(reader);
|
||||
reader.leaveSubRecord();
|
||||
}
|
||||
reader.leaveSubVector();
|
||||
|
||||
size_t transitionCount;
|
||||
reader.enterSubVector("transitions", transitionCount);
|
||||
transitions.clear();
|
||||
transitions.reserve(transitionCount);
|
||||
for (size_t i=0 ; i<transitionCount ; ++i)
|
||||
{
|
||||
transitions.emplace_back(m_ancsId);
|
||||
reader.enterSubRecord(nullptr);
|
||||
transitions.back().read(reader);
|
||||
reader.leaveSubRecord();
|
||||
}
|
||||
reader.leaveSubVector();
|
||||
|
||||
reader.enumerate("transitions", transitions);
|
||||
reader.enumerate("defaultTransition", defaultTransition);
|
||||
|
||||
additiveAnims.clear();
|
||||
@@ -514,7 +556,17 @@ void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader)
|
||||
halfTransitions.clear();
|
||||
if (sectionCount > 2)
|
||||
{
|
||||
reader.enumerate("halfTransitions", halfTransitions);
|
||||
size_t halfTransitionCount;
|
||||
reader.enterSubVector("halfTransitions", halfTransitionCount);
|
||||
halfTransitions.reserve(halfTransitionCount);
|
||||
for (size_t i=0 ; i<halfTransitionCount ; ++i)
|
||||
{
|
||||
halfTransitions.emplace_back(m_ancsId);
|
||||
reader.enterSubRecord(nullptr);
|
||||
halfTransitions.back().read(reader);
|
||||
reader.leaveSubRecord();
|
||||
}
|
||||
reader.leaveSubVector();
|
||||
}
|
||||
|
||||
evnts.clear();
|
||||
|
||||
@@ -22,6 +22,8 @@ struct ANCS : BigYAML
|
||||
using CSKRType = CSKR;
|
||||
using ANIMType = ANIM;
|
||||
|
||||
ANCS(const UniqueID32& ancsId) : animationSet(ancsId) {}
|
||||
|
||||
DECL_YAML
|
||||
Value<atUint16> version;
|
||||
|
||||
@@ -39,8 +41,8 @@ struct ANCS : BigYAML
|
||||
atUint32 idx;
|
||||
std::string name;
|
||||
UniqueID32 cmdl;
|
||||
UniqueID32 cskr;
|
||||
UniqueID32 cinf;
|
||||
AuxiliaryID32 cskr = _S("skin");
|
||||
AuxiliaryID32 cinf = {_S("layout"), _S("skin")};
|
||||
|
||||
struct Animation : BigYAML
|
||||
{
|
||||
@@ -86,7 +88,7 @@ struct ANCS : BigYAML
|
||||
std::vector<Effect> effects;
|
||||
|
||||
UniqueID32 cmdlOverlay;
|
||||
UniqueID32 cskrOverlay;
|
||||
AuxiliaryID32 cskrOverlay = _S("skin");
|
||||
|
||||
std::vector<atUint32> animIdxs;
|
||||
|
||||
@@ -108,6 +110,9 @@ struct ANCS : BigYAML
|
||||
{
|
||||
DECL_YAML
|
||||
Delete expl;
|
||||
const UniqueID32& m_ancsId;
|
||||
AnimationSet(const UniqueID32& ancsId) : m_ancsId(ancsId), defaultTransition(ancsId) {}
|
||||
|
||||
using MP1AnimationSet = DNAMP1::ANCS::AnimationSet;
|
||||
|
||||
std::vector<MP1AnimationSet::Animation> animations;
|
||||
@@ -229,7 +234,7 @@ struct ANCS : BigYAML
|
||||
yamlType == hecl::ProjectPath::Type::None ||
|
||||
blendType == hecl::ProjectPath::Type::None)
|
||||
{
|
||||
ANCS ancs;
|
||||
ANCS ancs(entry.id);
|
||||
ancs.read(rs);
|
||||
|
||||
if (force || yamlType == hecl::ProjectPath::Type::None)
|
||||
|
||||
@@ -198,13 +198,13 @@ void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter,
|
||||
if (entry.second->type == FOURCC('ANCS'))
|
||||
{
|
||||
PAKEntryReadStream rs = entry.second->beginReadStream(m_node);
|
||||
ANCS ancs;
|
||||
ANCS ancs(entry.first);
|
||||
ancs.read(rs);
|
||||
for (const ANCS::CharacterSet::CharacterInfo& ci : ancs.characterSet.characters)
|
||||
{
|
||||
addTo[ci.cmdl] = std::make_pair(ci.cskr, ci.cinf);
|
||||
addTo[ci.cmdl] = std::make_pair(ci.cskr.getBaseId(), ci.cinf.getBaseId());
|
||||
if (ci.cmdlOverlay)
|
||||
addTo[ci.cmdlOverlay] = std::make_pair(ci.cskrOverlay, ci.cinf);
|
||||
addTo[ci.cmdlOverlay] = std::make_pair(ci.cskrOverlay.getBaseId(), ci.cinf.getBaseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user