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

Various imps and stubs

This commit is contained in:
2016-09-13 22:45:46 -07:00
parent 8b23c0538e
commit c20eb76189
26 changed files with 479 additions and 134 deletions

View File

@@ -0,0 +1,50 @@
#include "CAnimTreeTimeScale.hpp"
namespace urde
{
CAnimTreeTimeScale::CAnimTreeTimeScale(const std::weak_ptr<CAnimTreeNode>& node, float scale, const std::string& name)
: CAnimTreeSingleChild(node, name)
, x18_timeScale(new CConstantAnimationTimeScale(scale))
{
}
std::string CAnimTreeTimeScale::CreatePrimitiveName(const std::weak_ptr<CAnimTreeNode>&, float, const CCharAnimTime&, float)
{
return {};
}
CCharAnimTime CAnimTreeTimeScale::GetRealLifeTime(const CCharAnimTime& time) const
{
CCharAnimTime timeRem = x14_child->VGetTimeRemaining();
CCharAnimTime tmp = std::min(timeRem, time);
if (x28_ > CCharAnimTime())
{
if (tmp < CCharAnimTime(x28_ * x20_))
return x18_timeScale->TimeScaleIntegral(x20_, x20_ + tmp);
else
{
CCharAnimTime integral = x18_timeScale->TimeScaleIntegral(x20_, x28_);
if (integral > tmp)
return x18_timeScale->FindUpperLimit(x20_, tmp) * x20_;
else
return integral + (integral * tmp);
}
}
return tmp;
}
void CAnimTreeTimeScale::VSetPhase(float phase)
{
x14_child->VSetPhase(phase);
}
std::shared_ptr<IAnimReader> CAnimTreeTimeScale::VSimplified()
{
return {};
}
}