[c][cpp] Ported fix for #1119

This commit is contained in:
badlogic 2018-06-07 16:54:32 +02:00
parent 73fca0ba63
commit 2726229071
2 changed files with 6 additions and 4 deletions

View File

@ -325,6 +325,9 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
finished = _spAnimationState_updateMixingFrom(self, from, delta);
from->animationLast = from->nextAnimationLast;
from->trackLast = from->nextTrackLast;
/* Require mixTime > 0 to ensure the mixing from entry was applied at least once. */
if (to->mixTime > 0 && (to->mixTime >= to->mixDuration || to->timeScale == 0)) {
/* Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame). */
@ -336,8 +339,6 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
return finished;
}
from->animationLast = from->nextAnimationLast;
from->trackLast = from->nextTrackLast;
from->trackTime += delta * from->timeScale;
to->mixTime += delta * to->timeScale;
return 0;

View File

@ -756,6 +756,9 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
bool finished = updateMixingFrom(from, delta);
from->_animationLast = from->_nextAnimationLast;
from->_trackLast = from->_nextTrackLast;
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
if (to->_mixTime > 0 && (to->_mixTime >= to->_mixDuration || to->_timeScale == 0)) {
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
@ -767,8 +770,6 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
return finished;
}
from->_animationLast = from->_nextAnimationLast;
from->_trackLast = from->_nextTrackLast;
from->_trackTime += delta * from->_timeScale;
to->_mixTime += delta * to->_timeScale;