metaforce/Runtime/Character/CMetaAnimPlay.cpp

26 lines
1.1 KiB
C++
Raw Normal View History

#include "Runtime/Character/CMetaAnimPlay.hpp"
#include "Runtime/CSimplePool.hpp"
#include "Runtime/Character/CAllFormatsAnimSource.hpp"
#include "Runtime/Character/CAnimSysContext.hpp"
#include "Runtime/Character/CAnimTreeAnimReaderContainer.hpp"
2016-04-10 21:22:59 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce {
2016-04-10 21:22:59 +00:00
2018-12-08 05:30:43 +00:00
CMetaAnimPlay::CMetaAnimPlay(CInputStream& in) : x4_primitive(in), x1c_startTime(in) {}
2016-04-10 21:22:59 +00:00
2018-12-08 05:30:43 +00:00
void CMetaAnimPlay::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const { primsOut.insert(x4_primitive); }
2016-04-10 21:22:59 +00:00
2018-12-08 05:30:43 +00:00
std::shared_ptr<CAnimTreeNode> CMetaAnimPlay::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const {
2019-03-09 08:58:27 +00:00
if (orders.x0_recursiveAdvance)
return GetAnimationTree(animSys, CMetaAnimTreeBuildOrders::PreAdvanceForAll(*orders.x0_recursiveAdvance));
2016-08-27 04:54:53 +00:00
2018-12-08 05:30:43 +00:00
TLockedToken<CAllFormatsAnimSource> prim =
animSys.xc_store.GetObj(SObjectTag{FOURCC('ANIM'), x4_primitive.GetAnimResId()});
2019-03-09 08:58:27 +00:00
return std::make_shared<CAnimTreeAnimReaderContainer>(
2018-12-08 05:30:43 +00:00
x4_primitive.GetName(), CAllFormatsAnimSource::GetNewReader(prim, x1c_startTime), x4_primitive.GetAnimDbIdx());
2016-04-10 21:22:59 +00:00
}
2021-04-10 08:42:06 +00:00
} // namespace metaforce