1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

fix animations possibly going nuts in the anim editor due to timer overflow handling

This commit is contained in:
fgenesis 2025-01-21 23:51:16 +01:00
parent dd403d7d55
commit 6bffa3a3f9

View file

@ -2005,7 +2005,14 @@ void AnimationLayer::updateBones()
unsigned nextidx = curidx + 1;
if(nextidx > maxidx)
{
if(key1->t < timer) // past the last keyframe? just stay there (unless the timer wraps too)
{
key2 = key1;
break;
}
nextidx = 0;
}
key2 = &a->keyframes[nextidx];
if((key1->t <= timer && timer <= key2->t) || !maxidx)
@ -2021,8 +2028,6 @@ void AnimationLayer::updateBones()
const float t2 = key2->t;
assert(t1 <= t2);
const float diff = t2-t1;
float dt;
if (diff != 0)