mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 01:47:43 +00:00
Migration to new ANIM extract
This commit is contained in:
@@ -528,8 +528,6 @@ void ANCS::CharacterSet::CharacterInfo::read(athena::io::YAMLDocReader& reader)
|
||||
atUint16 sectionCount = reader.readUint16("sectionCount");
|
||||
name = reader.readString("name");
|
||||
reader.enumerate("cmdl", cmdl);
|
||||
reader.enumerate("cskr", cskr);
|
||||
reader.enumerate("cinf", cinf);
|
||||
|
||||
reader.enumerate("animations", animations);
|
||||
|
||||
@@ -564,7 +562,6 @@ void ANCS::CharacterSet::CharacterInfo::read(athena::io::YAMLDocReader& reader)
|
||||
if (sectionCount > 3)
|
||||
{
|
||||
reader.enumerate("cmdlOverride", cmdlOverlay);
|
||||
reader.enumerate("cskrOverride", cskrOverlay);
|
||||
}
|
||||
|
||||
animIdxs.clear();
|
||||
@@ -595,8 +592,6 @@ void ANCS::CharacterSet::CharacterInfo::write(athena::io::YAMLDocWriter& writer)
|
||||
|
||||
writer.writeString("name", name);
|
||||
writer.enumerate("cmdl", cmdl);
|
||||
writer.enumerate("cskr", cskr);
|
||||
writer.enumerate("cinf", cinf);
|
||||
|
||||
writer.enumerate("animations", animations);
|
||||
|
||||
@@ -628,7 +623,6 @@ void ANCS::CharacterSet::CharacterInfo::write(athena::io::YAMLDocWriter& writer)
|
||||
if (sectionCount > 3)
|
||||
{
|
||||
writer.enumerate("cmdlOverride", cmdlOverlay);
|
||||
writer.enumerate("cskrOverride", cskrOverlay);
|
||||
}
|
||||
|
||||
if (sectionCount > 4)
|
||||
@@ -648,23 +642,23 @@ void ANCS::AnimationSet::MetaAnimFactory::read(athena::io::IStreamReader& reader
|
||||
switch (type)
|
||||
{
|
||||
case IMetaAnim::Type::Primitive:
|
||||
m_anim.reset(new struct MetaAnimPrimitive(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimPrimitive);
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::Blend:
|
||||
m_anim.reset(new struct MetaAnimBlend(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimBlend);
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::PhaseBlend:
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend);
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::Random:
|
||||
m_anim.reset(new struct MetaAnimRandom(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimRandom);
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
case IMetaAnim::Type::Sequence:
|
||||
m_anim.reset(new struct MetaAnimSequence(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimSequence);
|
||||
m_anim->read(reader);
|
||||
break;
|
||||
default:
|
||||
@@ -694,27 +688,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_ancsId));
|
||||
m_anim.reset(new struct MetaAnimPrimitive);
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("blend"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimBlend(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimBlend);
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("phaseblend"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimPhaseBlend);
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("random"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimRandom(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimRandom);
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else if (!type.compare("sequence"))
|
||||
{
|
||||
m_anim.reset(new struct MetaAnimSequence(m_ancsId));
|
||||
m_anim.reset(new struct MetaAnimSequence);
|
||||
m_anim->read(reader);
|
||||
}
|
||||
else
|
||||
@@ -743,15 +737,15 @@ void ANCS::AnimationSet::MetaTransFactory::read(athena::io::IStreamReader& reade
|
||||
switch (type)
|
||||
{
|
||||
case IMetaTrans::Type::MetaAnim:
|
||||
m_trans.reset(new struct MetaTransMetaAnim(m_ancsId));
|
||||
m_trans.reset(new struct MetaTransMetaAnim);
|
||||
m_trans->read(reader);
|
||||
break;
|
||||
case IMetaTrans::Type::Trans:
|
||||
m_trans.reset(new struct MetaTransTrans(m_ancsId));
|
||||
m_trans.reset(new struct MetaTransTrans);
|
||||
m_trans->read(reader);
|
||||
break;
|
||||
case IMetaTrans::Type::PhaseTrans:
|
||||
m_trans.reset(new struct MetaTransPhaseTrans(m_ancsId));
|
||||
m_trans.reset(new struct MetaTransPhaseTrans);
|
||||
m_trans->read(reader);
|
||||
break;
|
||||
case IMetaTrans::Type::NoTrans:
|
||||
@@ -785,17 +779,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_ancsId));
|
||||
m_trans.reset(new struct MetaTransMetaAnim);
|
||||
m_trans->read(reader);
|
||||
}
|
||||
else if (!type.compare("trans"))
|
||||
{
|
||||
m_trans.reset(new struct MetaTransTrans(m_ancsId));
|
||||
m_trans.reset(new struct MetaTransTrans);
|
||||
m_trans->read(reader);
|
||||
}
|
||||
else if (!type.compare("phasetrans"))
|
||||
{
|
||||
m_trans.reset(new struct MetaTransPhaseTrans(m_ancsId));
|
||||
m_trans.reset(new struct MetaTransPhaseTrans);
|
||||
m_trans->read(reader);
|
||||
}
|
||||
else
|
||||
@@ -826,23 +820,10 @@ void ANCS::AnimationSet::read(athena::io::IStreamReader& reader)
|
||||
atUint16 sectionCount = reader.readUint16Big();
|
||||
|
||||
atUint32 animationCount = reader.readUint32Big();
|
||||
animations.clear();
|
||||
animations.reserve(animationCount);
|
||||
for (size_t i=0 ; i<animationCount ; ++i)
|
||||
{
|
||||
animations.emplace_back(m_ancsId);
|
||||
animations.back().read(reader);
|
||||
}
|
||||
reader.enumerate(animations, animationCount);
|
||||
|
||||
atUint32 transitionCount = reader.readUint32Big();
|
||||
transitions.clear();
|
||||
transitions.reserve(transitionCount);
|
||||
for (size_t i=0 ; i<transitionCount ; ++i)
|
||||
{
|
||||
transitions.emplace_back(m_ancsId);
|
||||
transitions.back().read(reader);
|
||||
}
|
||||
|
||||
reader.enumerate(transitions, transitionCount);
|
||||
defaultTransition.read(reader);
|
||||
|
||||
additiveAnims.clear();
|
||||
@@ -857,13 +838,8 @@ void ANCS::AnimationSet::read(athena::io::IStreamReader& reader)
|
||||
halfTransitions.clear();
|
||||
if (sectionCount > 2)
|
||||
{
|
||||
atUint32 halfTransitionCount = reader.readUint32Big();
|
||||
halfTransitions.reserve(halfTransitionCount);
|
||||
for (size_t i=0 ; i<halfTransitionCount ; ++i)
|
||||
{
|
||||
halfTransitions.emplace_back(m_ancsId);
|
||||
halfTransitions.back().read(reader);
|
||||
}
|
||||
atUint32 halfTransitionCount = reader.readUint32Big();
|
||||
reader.enumerate(halfTransitions, halfTransitionCount);
|
||||
}
|
||||
|
||||
animResources.clear();
|
||||
@@ -961,36 +937,9 @@ void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader)
|
||||
{
|
||||
atUint16 sectionCount = reader.readUint16("sectionCount");
|
||||
|
||||
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("animations", animations);
|
||||
|
||||
reader.enumerate("transitions", transitions);
|
||||
reader.enumerate("defaultTransition", defaultTransition);
|
||||
|
||||
additiveAnims.clear();
|
||||
@@ -1004,28 +953,14 @@ void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader)
|
||||
halfTransitions.clear();
|
||||
if (sectionCount > 2)
|
||||
{
|
||||
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();
|
||||
}
|
||||
reader.enumerate("halfTransitions", halfTransitions);
|
||||
}
|
||||
|
||||
#if 0
|
||||
animResources.clear();
|
||||
if (sectionCount > 3)
|
||||
{
|
||||
reader.enumerate("animResources", animResources);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ANCS::AnimationSet::write(athena::io::YAMLDocWriter& writer) const
|
||||
@@ -1059,12 +994,10 @@ 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