瀏覽代碼

[c][cpp] Ported fix for #1119

badlogic 7 年之前
父節點
當前提交
2726229071
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 3 2
      spine-c/spine-c/src/spine/AnimationState.c
  2. 3 2
      spine-cpp/spine-cpp/src/spine/AnimationState.cpp

+ 3 - 2
spine-c/spine-c/src/spine/AnimationState.c

@@ -325,6 +325,9 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
 
 
 	finished = _spAnimationState_updateMixingFrom(self, from, delta);
 	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. */
 	/* 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 || to->timeScale == 0)) {
 		/* 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). */
@@ -336,8 +339,6 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
 		return finished;
 		return finished;
 	}
 	}
 
 
-	from->animationLast = from->nextAnimationLast;
-	from->trackLast = from->nextTrackLast;
 	from->trackTime += delta * from->timeScale;
 	from->trackTime += delta * from->timeScale;
 	to->mixTime += delta * to->timeScale;
 	to->mixTime += delta * to->timeScale;
 	return 0;
 	return 0;

+ 3 - 2
spine-cpp/spine-cpp/src/spine/AnimationState.cpp

@@ -756,6 +756,9 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
 
 
 	bool finished = updateMixingFrom(from, 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.
 	// 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 || to->_timeScale == 0)) {
 		// 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).
@@ -767,8 +770,6 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
 		return finished;
 		return finished;
 	}
 	}
 
 
-	from->_animationLast = from->_nextAnimationLast;
-	from->_trackLast = from->_nextTrackLast;
 	from->_trackTime += delta * from->_timeScale;
 	from->_trackTime += delta * from->_timeScale;
 	to->_mixTime += delta * to->_timeScale;
 	to->_mixTime += delta * to->_timeScale;