Initial commit

This commit is contained in:
Gericom
2025-11-22 17:21:45 +01:00
commit 5d6f67c612
517 changed files with 63025 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#include "common.h"
#include "core/math/fixed.h"
#include "Animator.h"
template <>
bool Animator<int>::Update()
{
if (++_frame >= _duration)
{
_frame = _duration;
_value = _to;
return true;
}
auto relativePos = _curve->Compute(_frame * _invDuration);
_value = _from + (relativePos.LongMul(_to - _from) + 0.5).Int();
return false;
}
template <>
bool Animator<fix32<12>>::Update()
{
if (++_frame >= _duration)
{
_frame = _duration;
_value = _to;
return true;
}
auto relativePos = _curve->Compute(_frame * _invDuration);
_value = _from + fix32<12>(relativePos.LongMul(_to - _from));
return false;
}