Merge branch '3.7-beta' into 3.7-beta-cpp

This commit is contained in:
badlogic 2018-10-15 16:52:57 +02:00
commit 53d15a47a1
21 changed files with 99 additions and 30 deletions

View File

@ -135,7 +135,7 @@ package spine.animation {
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;
@ -145,6 +145,13 @@ package spine.animation {
}
return finished;
}
// If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;

View File

@ -327,7 +327,7 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
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;
@ -338,6 +338,12 @@ 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;
return 0;

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;

View File

@ -142,7 +142,7 @@ namespace Spine {
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;
@ -153,6 +153,13 @@ namespace Spine {
return finished;
}
// If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;
@ -250,7 +257,7 @@ namespace Spine {
bool firstFrame = from.timelinesRotation.Count == 0;
if (firstFrame) from.timelinesRotation.Resize(timelines.Count << 1); // from.timelinesRotation.setSize
var timelinesRotation = from.timelinesRotation.Items;
from.totalAlpha = 0;
for (int i = 0; i < timelineCount; i++) {
Timeline timeline = timelinesItems[i];
@ -507,7 +514,7 @@ namespace Spine {
/// for a track. If the track is empty, it is equivalent to calling <see cref="SetAnimation"/>.</summary>
/// <param name="delay">
/// delay Seconds to begin this animation after the start of the previous animation. If &lt;= 0, uses the duration of the
/// previous track entry minus any mix duration plus the specified<code>delay</code>.If the previous entry is
/// previous track entry minus any mix duration plus the specified<code>delay</code>.If the previous entry is
/// looping, its next loop completion is used instead of the duration.
/// </param>
/// <returns>A track entry to allow further customization of animation playback. References to the track entry must not be kept
@ -897,7 +904,7 @@ namespace Spine {
public float MixDuration { get { return mixDuration; } set { mixDuration = value; } }
/// <summary>
/// Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which
/// Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which
/// replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to
/// the values from the lower tracks.
/// <para>
@ -914,9 +921,9 @@ namespace Spine {
/// <summary>
/// If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead of being mixed out.
///
///
/// When mixing between animations that key the same property, if a lower track also keys that property then the value will briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% while the second animation mixes from 0% to 100%. Setting HoldPrevious to true applies the first animation at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which keys the property, only when a higher track also keys the property.
///
///
/// Snapping will occur if HoldPrevious is true and this animation does not key all the same properties as the previous animation.
/// </summary>
public bool HoldPrevious { get { return holdPrevious; } set { holdPrevious = value; } }

View File

@ -299,7 +299,7 @@ function AnimationState:updateMixingFrom (to, delta)
from.trackLast = from.nextTrackLast
-- Require mixTime > 0 to ensure the mixing from entry was applied at least once.
if (to.mixTime > 0 and (to.mixTime >= to.mixDuration or to.timeScale == 0)) then
if (to.mixTime > 0 and to.mixTime >= to.mixDuration) then
-- Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
if (from.totalAlpha == 0 or to.mixDuration == 0) then
to.mixingFrom = from.mixingFrom
@ -310,6 +310,13 @@ function AnimationState:updateMixingFrom (to, delta)
return finished
end
-- If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
if to.timeScale == 0 and to.mixingTo then
to.timeScale = 1
to.mixTime = 0
to.mixDuration = 0
end
from.trackTime = from.trackTime + delta * from.timeScale
to.mixTime = to.mixTime + delta * to.timeScale
return false;
@ -781,30 +788,30 @@ function AnimationState:_animationsChanged ()
self.propertyIDs = {}
for i, entry in pairs(self.tracks) do
for i, entry in pairs(self.tracks) do
if entry then
while entry.mixingFrom do
while entry.mixingFrom do
entry = entry.mixingFrom
end
repeat
if (entry.mixingTo == nil or entry.mixBlend ~= MixBlend.add) then
self:setTimelineModes(entry)
end
entry = entry.mixingTo
until (entry == nil)
until (entry == nil)
end
end
end
function AnimationState:setTimelineModes(entry)
local to = entry.mixingTo
function AnimationState:setTimelineModes(entry)
local to = entry.mixingTo
local timelines = entry.animation.timelines
local timelinesCount = #entry.animation.timelines
local timelineMode = entry.timelineMode
local timelineHoldMix = entry.timelineHoldMix
local propertyIDs = self.propertyIDs
if (to and to.holdPrevious) then
local i = 1
while i <= timelinesCount do

View File

@ -1367,7 +1367,7 @@ var spine;
var finished = this.updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
if (from.totalAlpha == 0 || to.mixDuration == 0) {
to.mixingFrom = from.mixingFrom;
if (from.mixingFrom != null)
@ -1377,6 +1377,11 @@ var spine;
}
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

File diff suppressed because one or more lines are too long

View File

@ -1367,7 +1367,7 @@ var spine;
var finished = this.updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
if (from.totalAlpha == 0 || to.mixDuration == 0) {
to.mixingFrom = from.mixingFrom;
if (from.mixingFrom != null)
@ -1377,6 +1377,11 @@ var spine;
}
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

File diff suppressed because one or more lines are too long

View File

@ -1367,7 +1367,7 @@ var spine;
var finished = this.updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
if (from.totalAlpha == 0 || to.mixDuration == 0) {
to.mixingFrom = from.mixingFrom;
if (from.mixingFrom != null)
@ -1377,6 +1377,11 @@ var spine;
}
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

File diff suppressed because one or more lines are too long

View File

@ -1367,7 +1367,7 @@ var spine;
var finished = this.updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
if (from.totalAlpha == 0 || to.mixDuration == 0) {
to.mixingFrom = from.mixingFrom;
if (from.mixingFrom != null)
@ -1377,6 +1377,11 @@ var spine;
}
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

File diff suppressed because one or more lines are too long

View File

@ -1367,7 +1367,7 @@ var spine;
var finished = this.updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
if (from.totalAlpha == 0 || to.mixDuration == 0) {
to.mixingFrom = from.mixingFrom;
if (from.mixingFrom != null)
@ -1377,6 +1377,11 @@ var spine;
}
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

File diff suppressed because one or more lines are too long

View File

@ -1367,7 +1367,7 @@ var spine;
var finished = this.updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
if (from.totalAlpha == 0 || to.mixDuration == 0) {
to.mixingFrom = from.mixingFrom;
if (from.mixingFrom != null)
@ -1377,6 +1377,11 @@ var spine;
}
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

File diff suppressed because one or more lines are too long

View File

@ -118,7 +118,7 @@ module spine {
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;
@ -129,6 +129,12 @@ module spine {
return finished;
}
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;