mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 12:27:43 +00:00
AuxiliaryID32 implemented for sub-resources
This commit is contained in:
@@ -407,8 +407,8 @@ void ANCS::CharacterSet::CharacterInfo::write(athena::io::IStreamWriter& writer)
|
||||
|
||||
writer.writeString(name);
|
||||
cmdl.write(writer);
|
||||
cskr.write(writer);
|
||||
cinf.write(writer);
|
||||
cskr.UniqueID32::write(writer);
|
||||
cinf.UniqueID32::write(writer);
|
||||
|
||||
writer.writeUint32Big(animations.size());
|
||||
writer.enumerate(animations);
|
||||
@@ -447,7 +447,7 @@ void ANCS::CharacterSet::CharacterInfo::write(athena::io::IStreamWriter& writer)
|
||||
if (sectionCount > 3)
|
||||
{
|
||||
cmdlOverlay.write(writer);
|
||||
cskrOverlay.write(writer);
|
||||
cskrOverlay.UniqueID32::write(writer);
|
||||
}
|
||||
|
||||
if (sectionCount > 4)
|
||||
@@ -648,23 +648,23 @@ void ANCS::AnimationSet::MetaAnimFactory::read(athena::io::IStreamReader& reader
|
||||
switch (type)
|
||||
{
|
||||
case IMetaAnim::Type::Primitive:
|
||||
m_anim.reset(new struct MetaAnimPrimitive);
|
||||
m_anim.reset(new struct MetaAnimPrimitive(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::Blend:
|
||||
m_anim.reset(new struct MetaAnimBlend);
|
||||
m_anim.reset(new struct MetaAnimBlend(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::PhaseBlend:
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend);
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::Random:
|
||||
m_anim.reset(new struct MetaAnimRandom);
|
||||
m_anim.reset(new struct MetaAnimRandom(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::Sequence:
|
||||
m_anim.reset(new struct MetaAnimSequence);
|
||||
m_anim.reset(new struct MetaAnimSequence(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
default:
|
||||
@@ -694,27 +694,27 @@ void ANCS::AnimationSet::MetaAnimFactory::read(athena::io::YAMLDocReader& reader
|
||||
std::transform(type.begin(), type.end(), type.begin(), tolower);
|
||||
if (!type.compare("primitive"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimPrimitive);
|
||||
m_anim.reset(new struct MetaAnimPrimitive(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("blend"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimBlend);
|
||||
m_anim.reset(new struct MetaAnimBlend(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("phaseblend"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend);
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("random"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimRandom);
|
||||
m_anim.reset(new struct MetaAnimRandom(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("sequence"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimSequence);
|
||||
m_anim.reset(new struct MetaAnimSequence(m_ancsId));
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else
|
||||
@@ -743,15 +743,15 @@ void ANCS::AnimationSet::MetaTransFactory::read(athena::io::IStreamReader& reade
|
||||
switch (type)
|
||||
{
|
||||
case IMetaTrans::Type::MetaAnim:
|
||||
m_trans.reset(new struct MetaTransMetaAnim);
|
||||
m_trans.reset(new struct MetaTransMetaAnim(m_ancsId));
|
||||
m_trans->read(reader);
|
||||
break;
|
||||
case IMetaTrans::Type::Trans:
|
||||
m_trans.reset(new struct MetaTransTrans);
|
||||
m_trans.reset(new struct MetaTransTrans(m_ancsId));
|
||||
m_trans->read(reader);
|
||||
break;
|
||||
case IMetaTrans::Type::PhaseTrans:
|
||||
m_trans.reset(new struct MetaTransPhaseTrans);
|
||||
m_trans.reset(new struct MetaTransPhaseTrans(m_ancsId));
|
||||
m_trans->read(reader);
|
||||
break;
|
||||
case IMetaTrans::Type::NoTrans:
|
||||
@@ -785,17 +785,17 @@ void ANCS::AnimationSet::MetaTransFactory::read(athena::io::YAMLDocReader& reade
|
||||
std::transform(type.begin(), type.end(), type.begin(), tolower);
|
||||
if (!type.compare("metaanim"))
|
||||
{
|
||||
m_trans.reset(new struct MetaTransMetaAnim);
|
||||
m_trans.reset(new struct MetaTransMetaAnim(m_ancsId));
|
||||
m_trans->read(reader);
|
||||
}
|
||||
else if (!type.compare("trans"))
|
||||
{
|
||||
m_trans.reset(new struct MetaTransTrans);
|
||||
m_trans.reset(new struct MetaTransTrans(m_ancsId));
|
||||
m_trans->read(reader);
|
||||
}
|
||||
else if (!type.compare("phasetrans"))
|
||||
{
|
||||
m_trans.reset(new struct MetaTransPhaseTrans);
|
||||
m_trans.reset(new struct MetaTransPhaseTrans(m_ancsId));
|
||||
m_trans->read(reader);
|
||||
}
|
||||
else
|
||||
@@ -826,10 +826,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 (size_t 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 (size_t i=0 ; i<transitionCount ; ++i)
|
||||
{
|
||||
transitions.emplace_back(m_ancsId);
|
||||
transitions.back().read(reader);
|
||||
}
|
||||
|
||||
defaultTransition.read(reader);
|
||||
|
||||
additiveAnims.clear();
|
||||
@@ -844,8 +857,13 @@ 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.reserve(halfTransitionCount);
|
||||
for (size_t i=0 ; i<halfTransitionCount ; ++i)
|
||||
{
|
||||
halfTransitions.emplace_back(m_ancsId);
|
||||
halfTransitions.back().read(reader);
|
||||
}
|
||||
}
|
||||
|
||||
animResources.clear();
|
||||
@@ -943,9 +961,36 @@ void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader)
|
||||
{
|
||||
atUint16 sectionCount = reader.readUint16("sectionCount");
|
||||
|
||||
reader.enumerate("animations", animations);
|
||||
size_t animationCount;
|
||||
animations.clear();
|
||||
if (reader.enterSubVector("animations", animationCount))
|
||||
{
|
||||
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;
|
||||
transitions.clear();
|
||||
if (reader.enterSubVector("transitions", transitionCount))
|
||||
{
|
||||
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();
|
||||
@@ -959,14 +1004,28 @@ void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader)
|
||||
halfTransitions.clear();
|
||||
if (sectionCount > 2)
|
||||
{
|
||||
reader.enumerate("halfTransitions", halfTransitions);
|
||||
size_t halfTransitionCount;
|
||||
if (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();
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
animResources.clear();
|
||||
if (sectionCount > 3)
|
||||
{
|
||||
reader.enumerate("animResources", animResources);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ANCS::AnimationSet::write(athena::io::YAMLDocWriter& writer) const
|
||||
@@ -1000,10 +1059,12 @@ void ANCS::AnimationSet::write(athena::io::YAMLDocWriter& writer) const
|
||||
writer.enumerate("halfTransitions", halfTransitions);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (sectionCount > 3)
|
||||
{
|
||||
writer.enumerate("animResources", animResources);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const char* ANCS::AnimationSet::DNAType()
|
||||
|
||||
Reference in New Issue
Block a user