metaforce/Runtime/Character/CMetaAnimSequence.cpp

52 lines
1.3 KiB
C++
Raw Normal View History

2016-04-10 21:22:59 +00:00
#include "CMetaAnimSequence.hpp"
2016-04-11 03:59:54 +00:00
#include "CMetaAnimFactory.hpp"
2016-08-27 21:16:44 +00:00
#include "CAnimTreeSequence.hpp"
2016-04-10 21:22:59 +00:00
namespace urde
{
2016-04-11 03:59:54 +00:00
std::vector<std::shared_ptr<IMetaAnim>> CMetaAnimSequence::CreateSequence(CInputStream& in)
2016-04-10 21:22:59 +00:00
{
2016-04-11 03:59:54 +00:00
std::vector<std::shared_ptr<IMetaAnim>> ret;
u32 seqCount = in.readUint32Big();
ret.reserve(seqCount);
for (u32 i=0 ; i<seqCount ; ++i)
ret.push_back(CMetaAnimFactory::CreateMetaAnim(in));
2016-04-11 03:59:54 +00:00
return ret;
2016-04-10 21:22:59 +00:00
}
2016-04-11 03:59:54 +00:00
CMetaAnimSequence::CMetaAnimSequence(CInputStream& in)
: x4_sequence(CreateSequence(in)) {}
2016-04-10 21:22:59 +00:00
void CMetaAnimSequence::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{
2016-08-27 21:16:44 +00:00
for (const std::shared_ptr<IMetaAnim>& anim : x4_sequence)
anim->GetUniquePrimitives(primsOut);
2016-04-10 21:22:59 +00:00
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimSequence::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
2016-08-27 21:16:44 +00:00
if (orders.x0_)
{
CMetaAnimTreeBuildOrders modOrders;
modOrders.PreAdvanceForAll(*orders.x0_);
return GetAnimationTree(animSys, modOrders);
}
for (const std::shared_ptr<IMetaAnim>& anim : x4_sequence)
{
}
std::shared_ptr<CAnimTreeNode> ret =
std::make_shared<CAnimTreeSequence>(x4_sequence, animSys, "");
return ret;
2016-04-10 21:22:59 +00:00
}
}