2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 09:47:43 +00:00

Additional ANIM integration

This commit is contained in:
Jack Andersen
2016-08-26 18:54:53 -10:00
parent c5ddb51dfc
commit f76324a029
13 changed files with 230 additions and 19 deletions

View File

@@ -1,10 +1,14 @@
#include "CMetaAnimPlay.hpp"
#include "CAnimSysContext.hpp"
#include "CSimplePool.hpp"
#include "CAllFormatsAnimSource.hpp"
#include "CAnimTreeAnimReaderContainer.hpp"
namespace urde
{
CMetaAnimPlay::CMetaAnimPlay(CInputStream& in)
: x4_primitive(in), x1c_(in.readFloatBig()), x20_(in.readUint32Big()) {}
: x4_primitive(in), x1c_startTime(in) {}
std::shared_ptr<CAnimTreeNode>
CMetaAnimPlay::GetAnimationTree(const CAnimSysContext& animSys,
@@ -21,7 +25,20 @@ std::shared_ptr<CAnimTreeNode>
CMetaAnimPlay::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
return {};
if (orders.x0_)
{
CMetaAnimTreeBuildOrders modOrders;
modOrders.PreAdvanceForAll(*orders.x0_);
return GetAnimationTree(animSys, modOrders);
}
TLockedToken<CAllFormatsAnimSource> prim =
animSys.xc_store.GetObj(SObjectTag{FOURCC('ANIM'), x4_primitive.GetAnimResId()});
std::shared_ptr<CAnimTreeNode> ret =
std::make_shared<CAnimTreeAnimReaderContainer>(x4_primitive.GetName(),
CAllFormatsAnimSource::GetNewReader(prim, x1c_startTime),
x4_primitive.GetAnimDbIdx());
return ret;
}
}