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)
|
2016-10-03 04:39:31 +00:00
|
|
|
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
|
|
|
|
{
|
2017-12-20 06:06:54 +00:00
|
|
|
if (orders.x0_recursiveAdvance)
|
2016-08-27 21:16:44 +00:00
|
|
|
{
|
|
|
|
CMetaAnimTreeBuildOrders modOrders;
|
2017-12-20 06:06:54 +00:00
|
|
|
modOrders.PreAdvanceForAll(*orders.x0_recursiveAdvance);
|
2016-08-27 21:16:44 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
}
|