[cpp] Ported 0 timeScale fix, see #1194.

This commit is contained in:
badlogic 2018-10-15 16:40:31 +02:00
parent 2c73175d88
commit e11e0d42d8

View File

@ -717,7 +717,7 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
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)) {
if (to->_mixTime > 0 && to->_mixTime >= to->_mixDuration) {
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
if (from->_totalAlpha == 0 || to->_mixDuration == 0) {
to->_mixingFrom = from->_mixingFrom;
@ -728,6 +728,12 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
return finished;
}
if (to->_timeScale == 0 && to->_mixingTo) {
to->_timeScale = 1;
to->_mixTime = 0;
to->_mixDuration = 0;
}
from->_trackTime += delta * from->_timeScale;
to->_mixTime += delta * to->_timeScale;