mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-23 10:11:23 +08:00
[cpp] Ported 0 timeScale fix, see #1194.
This commit is contained in:
parent
2c73175d88
commit
e11e0d42d8
@ -717,7 +717,7 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
|
|||||||
from->_trackLast = from->_nextTrackLast;
|
from->_trackLast = from->_nextTrackLast;
|
||||||
|
|
||||||
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
|
// 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).
|
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
|
||||||
if (from->_totalAlpha == 0 || to->_mixDuration == 0) {
|
if (from->_totalAlpha == 0 || to->_mixDuration == 0) {
|
||||||
to->_mixingFrom = from->_mixingFrom;
|
to->_mixingFrom = from->_mixingFrom;
|
||||||
@ -728,6 +728,12 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
|
|||||||
return finished;
|
return finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (to->_timeScale == 0 && to->_mixingTo) {
|
||||||
|
to->_timeScale = 1;
|
||||||
|
to->_mixTime = 0;
|
||||||
|
to->_mixDuration = 0;
|
||||||
|
}
|
||||||
|
|
||||||
from->_trackTime += delta * from->_timeScale;
|
from->_trackTime += delta * from->_timeScale;
|
||||||
to->_mixTime += delta * to->_timeScale;
|
to->_mixTime += delta * to->_timeScale;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user