diff --git a/spine-c/spine-c/src/spine/AnimationState.c b/spine-c/spine-c/src/spine/AnimationState.c index 553367425..6c5746b48 100644 --- a/spine-c/spine-c/src/spine/AnimationState.c +++ b/spine-c/spine-c/src/spine/AnimationState.c @@ -280,11 +280,11 @@ void spAnimationState_update (spAnimationState* self, float delta) { float nextTime = current->trackLast - next->delay; if (nextTime >= 0) { next->delay = 0; - next->trackTime = nextTime + delta * next->timeScale; + next->trackTime = (nextTime / current->timeScale + delta) * next->timeScale; current->trackTime += currentDelta; _spAnimationState_setCurrent(self, i, next, 1); while (next->mixingFrom) { - next->mixTime += currentDelta; + next->mixTime += delta; next = next->mixingFrom; } continue; @@ -338,14 +338,8 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr 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; + to->mixTime += delta; return 0; } diff --git a/spine-cpp/spine-cpp/src/spine/AnimationState.cpp b/spine-cpp/spine-cpp/src/spine/AnimationState.cpp index 33bb57c75..fc20cd314 100644 --- a/spine-cpp/spine-cpp/src/spine/AnimationState.cpp +++ b/spine-cpp/spine-cpp/src/spine/AnimationState.cpp @@ -334,11 +334,11 @@ void AnimationState::update(float delta) { float nextTime = current._trackLast - next->_delay; if (nextTime >= 0) { next->_delay = 0; - next->_trackTime = nextTime + (delta * next->_timeScale); + next->_trackTime = (nextTime / current._timeScale + delta) * next->_timeScale; current._trackTime += currentDelta; setCurrent(i, next, true); while (next->_mixingFrom != NULL) { - next->_mixTime += currentDelta; + next->_mixTime += delta; next = next->_mixingFrom; } continue; @@ -728,14 +728,8 @@ 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; + to->_mixTime += delta; return false; }