Merge branch '3.8' into 4.0-beta

This commit is contained in:
badlogic 2020-08-13 14:50:18 +02:00
commit 10ecbcf8f3
27 changed files with 167 additions and 90 deletions

View File

@ -39,8 +39,9 @@ package spine.animation {
public class AnimationState {
public static var SUBSEQUENT : int = 0;
public static var FIRST : int = 1;
public static var HOLD : int = 2;
public static var HOLD_MIX : int = 3;
public static var HOLD_SUBSEQUENT : int = 2;
public static var HOLD_FIRST : int = 3;
public static var HOLD_MIX : int = 4;
public static var SETUP : int = 1;
public static var CURRENT : int = 2;
@ -281,7 +282,11 @@ package spine.animation {
timelineBlend = MixBlend.setup;
alpha = alphaMix;
break;
case HOLD:
case HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case HOLD_FIRST:
timelineBlend = MixBlend.setup;
alpha = alphaHold;
break;
@ -664,8 +669,13 @@ package spine.animation {
var i : int = 0;
if (to != null && to.holdPrevious) {
for (i = 0; i < timelinesCount; i++) {
if (!propertyIDs[timelines[i].getPropertyId().toString()]) {
timelineMode[i] = HOLD_FIRST;
} else {
timelineMode[i] = HOLD_SUBSEQUENT;
}
propertyIDs[timelines[i].getPropertyId().toString()] = true;
timelineMode[i] = HOLD;
}
return;
}
@ -692,7 +702,7 @@ package spine.animation {
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
}

View File

@ -33,8 +33,9 @@
#define SUBSEQUENT 0
#define FIRST 1
#define HOLD 2
#define HOLD_MIX 3
#define HOLD_SUBSEQUENT 2
#define HOLD_FIRST 3
#define HOLD_MIX 4
#define SETUP 1
#define CURRENT 2
@ -501,7 +502,11 @@ float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* t
timelineBlend = SP_MIX_BLEND_SETUP;
alpha = alphaMix;
break;
case HOLD:
case HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case HOLD_FIRST:
timelineBlend = SP_MIX_BLEND_SETUP;
alpha = alphaHold;
break;
@ -1024,8 +1029,7 @@ void _spTrackEntry_computeHold(spTrackEntry* entry, spAnimationState* state) {
if (to != 0 && to->holdPrevious) {
for (i = 0; i < timelinesCount; i++) {
int id = spTimeline_getPropertyId(timelines[i]);
_spAnimationState_addPropertyID(state, id);
timelineMode[i] = HOLD;
timelineMode[i] = _spAnimationState_addPropertyID(state, id) ? HOLD_FIRST : HOLD_SUBSEQUENT;
}
return;
}
@ -1051,7 +1055,7 @@ void _spTrackEntry_computeHold(spTrackEntry* entry, spAnimationState* state) {
}
break;
}
timelineMode[i] = HOLD;
timelineMode[i] = HOLD_FIRST;
}
}
}

View File

@ -290,8 +290,9 @@ void EventQueue::drain() {
const int Subsequent = 0;
const int First = 1;
const int Hold = 2;
const int HoldMix = 3;
const int HoldSubsequent = 2;
const int HoldFirst = 3;
const int HoldMix = 4;
const int Setup = 1;
const int Current = 2;
@ -836,7 +837,11 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
timelineBlend = MixBlend_Setup;
alpha = alphaMix;
break;
case Hold:
case HoldSubsequent:
timelineBlend = blend;
alpha = alphaHold;
break;
case HoldFirst:
timelineBlend = MixBlend_Setup;
alpha = alphaHold;
break;
@ -1007,8 +1012,12 @@ void AnimationState::computeHold(TrackEntry *entry) {
if (to != NULL && to->_holdPrevious) {
for (size_t i = 0; i < timelinesCount; i++) {
int id = timelines[i]->getPropertyId();
if (!_propertyIDs.containsKey(id)) _propertyIDs.put(id, true);
timelineMode[i] = Hold;
if (!_propertyIDs.containsKey(id)) {
_propertyIDs.put(id, true);
timelineMode[i] = HoldFirst;
} else {
timelineMode[i] = HoldSubsequent;
}
}
return;
}
@ -1039,7 +1048,7 @@ void AnimationState::computeHold(TrackEntry *entry) {
}
break;
}
timelineMode[i] = Hold;
timelineMode[i] = HoldFirst;
}
}
}

View File

@ -55,6 +55,7 @@ Slot::Slot(SlotData &data, Bone &bone) :
void Slot::setToSetupPose() {
_color.set(_data.getColor());
if (_hasDarkColor) _darkColor.set(_data.getDarkColor());
const String &attachmentName = _data.getAttachmentName();
if (attachmentName.length() > 0) {

View File

@ -49,12 +49,18 @@ namespace Spine {
/// 2) The next track entry applied after this one does not have a timeline to set this property.<para />
/// Result: Mix from the setup pose to the timeline pose.
internal const int First = 1;
/// 1) A previously applied timeline has set this property.<br>
/// 2) The next track entry to be applied does have a timeline to set this property.<br>
/// 3) The next track entry after that one does not have a timeline to set this property.<br>
/// Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading
/// animations that key the same property. A subsequent timeline will set this property using a mix.
internal const int HoldSubsequent = 2;
/// 1) This is the first timeline to set this property.<para />
/// 2) The next track entry to be applied does have a timeline to set this property.<para />
/// 3) The next track entry after that one does not have a timeline to set this property.<para />
/// Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading animations
/// that key the same property. A subsequent timeline will set this property using a mix.
internal const int Hold = 2;
internal const int HoldFirst = 3;
/// 1) This is the first timeline to set this property.<para />
/// 2) The next track entry to be applied does have a timeline to set this property.<para />
/// 3) The next track entry after that one does have a timeline to set this property.<para />
@ -63,9 +69,9 @@ namespace Spine {
/// 2 track entries in a row have a timeline that sets the same property.<para />
/// Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid
/// "dipping" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A
/// (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into
/// place.
internal const int HoldMix = 3;
/// (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap to the mixed
/// out position.
internal const int HoldMix = 4;
internal const int Setup = 1, Current = 2;
@ -343,7 +349,11 @@ namespace Spine {
timelineBlend = MixBlend.Setup;
alpha = alphaMix;
break;
case AnimationState.Hold:
case AnimationState.HoldSubsequent:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HoldFirst:
timelineBlend = MixBlend.Setup;
alpha = alphaHold;
break;
@ -814,10 +824,9 @@ namespace Spine {
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (int i = 0; i < timelinesCount; i++) {
propertyIDs.Add(timelines[i].PropertyId);
timelineMode[i] = AnimationState.Hold;
}
for (int i = 0; i < timelinesCount; i++)
timelineMode[i] = propertyIDs.Add(timelines[i].PropertyId) ? AnimationState.HoldFirst : AnimationState.HoldSubsequent;
return;
}
@ -840,7 +849,7 @@ namespace Spine {
}
break;
}
timelineMode[i] = AnimationState.Hold;
timelineMode[i] = AnimationState.HoldFirst;
}
continue_outer: {}
}

View File

@ -52,8 +52,9 @@ end
local EMPTY_ANIMATION = Animation.new("<empty>", {}, 0)
local SUBSEQUENT = 0
local FIRST = 1
local HOLD = 2
local HOLD_MIX = 3
local HOLD_SUBSEQUENT = 2
local HOLD_FIRST = 3
local HOLD_MIX = 4
local SETUP = 1
local CURRENT = 2
@ -466,7 +467,10 @@ function AnimationState:applyMixingFrom (to, skeleton, blend)
elseif timelineMode[i] == FIRST then
timelineBlend = MixBlend.setup
alpha = alphaMix
elseif timelineMode[i] == HOLD then
elseif timelineMode[i] == HOLD_SUBSEQUENT then
timelineBlend = blend
alpha = alphaHold
elseif timelineMode[i] == HOLD_FIRST then
timelineBlend = MixBlend.setup
alpha = alphaHold
else
@ -932,8 +936,10 @@ function AnimationState:computeHold(entry)
local id = "" .. timelines[i]:getPropertyId()
if propertyIDs[id] == nil then
propertyIDs[id] = id
timelineMode[i] = HOLD_FIRST
else
timelineMode[i] = HOLD_SUBSEQUENT
end
timelineMode[i] = HOLD
end
return
end
@ -966,7 +972,7 @@ function AnimationState:computeHold(entry)
end
next = next.mixingTo
end
if not skip then timelineMode[i] = HOLD end
if not skip then timelineMode[i] = HOLD_FIRST end
end
end
i = i + 1

View File

@ -249,7 +249,8 @@ declare module spine {
static emptyAnimation: Animation;
static SUBSEQUENT: number;
static FIRST: number;
static HOLD: number;
static HOLD_SUBSEQUENT: number;
static HOLD_FIRST: number;
static HOLD_MIX: number;
static SETUP: number;
static CURRENT: number;

View File

@ -1554,7 +1554,11 @@ var spine;
timelineBlend = spine.MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = spine.MixBlend.setup;
alpha = alphaHold;
break;
@ -1908,8 +1912,7 @@ var spine;
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (var i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -1933,7 +1936,7 @@ var spine;
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
};
@ -1961,8 +1964,9 @@ var spine;
AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
AnimationState.SUBSEQUENT = 0;
AnimationState.FIRST = 1;
AnimationState.HOLD = 2;
AnimationState.HOLD_MIX = 3;
AnimationState.HOLD_SUBSEQUENT = 2;
AnimationState.HOLD_FIRST = 3;
AnimationState.HOLD_MIX = 4;
AnimationState.SETUP = 1;
AnimationState.CURRENT = 2;
return AnimationState;

File diff suppressed because one or more lines are too long

View File

@ -249,7 +249,8 @@ declare module spine {
static emptyAnimation: Animation;
static SUBSEQUENT: number;
static FIRST: number;
static HOLD: number;
static HOLD_SUBSEQUENT: number;
static HOLD_FIRST: number;
static HOLD_MIX: number;
static SETUP: number;
static CURRENT: number;

View File

@ -1554,7 +1554,11 @@ var spine;
timelineBlend = spine.MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = spine.MixBlend.setup;
alpha = alphaHold;
break;
@ -1908,8 +1912,7 @@ var spine;
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (var i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -1933,7 +1936,7 @@ var spine;
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
};
@ -1961,8 +1964,9 @@ var spine;
AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
AnimationState.SUBSEQUENT = 0;
AnimationState.FIRST = 1;
AnimationState.HOLD = 2;
AnimationState.HOLD_MIX = 3;
AnimationState.HOLD_SUBSEQUENT = 2;
AnimationState.HOLD_FIRST = 3;
AnimationState.HOLD_MIX = 4;
AnimationState.SETUP = 1;
AnimationState.CURRENT = 2;
return AnimationState;

File diff suppressed because one or more lines are too long

View File

@ -249,7 +249,8 @@ declare module spine {
static emptyAnimation: Animation;
static SUBSEQUENT: number;
static FIRST: number;
static HOLD: number;
static HOLD_SUBSEQUENT: number;
static HOLD_FIRST: number;
static HOLD_MIX: number;
static SETUP: number;
static CURRENT: number;

View File

@ -1554,7 +1554,11 @@ var spine;
timelineBlend = spine.MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = spine.MixBlend.setup;
alpha = alphaHold;
break;
@ -1908,8 +1912,7 @@ var spine;
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (var i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -1933,7 +1936,7 @@ var spine;
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
};
@ -1961,8 +1964,9 @@ var spine;
AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
AnimationState.SUBSEQUENT = 0;
AnimationState.FIRST = 1;
AnimationState.HOLD = 2;
AnimationState.HOLD_MIX = 3;
AnimationState.HOLD_SUBSEQUENT = 2;
AnimationState.HOLD_FIRST = 3;
AnimationState.HOLD_MIX = 4;
AnimationState.SETUP = 1;
AnimationState.CURRENT = 2;
return AnimationState;

File diff suppressed because one or more lines are too long

View File

@ -249,7 +249,8 @@ declare module spine {
static emptyAnimation: Animation;
static SUBSEQUENT: number;
static FIRST: number;
static HOLD: number;
static HOLD_SUBSEQUENT: number;
static HOLD_FIRST: number;
static HOLD_MIX: number;
static SETUP: number;
static CURRENT: number;

View File

@ -1554,7 +1554,11 @@ var spine;
timelineBlend = spine.MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = spine.MixBlend.setup;
alpha = alphaHold;
break;
@ -1908,8 +1912,7 @@ var spine;
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (var i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -1933,7 +1936,7 @@ var spine;
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
};
@ -1961,8 +1964,9 @@ var spine;
AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
AnimationState.SUBSEQUENT = 0;
AnimationState.FIRST = 1;
AnimationState.HOLD = 2;
AnimationState.HOLD_MIX = 3;
AnimationState.HOLD_SUBSEQUENT = 2;
AnimationState.HOLD_FIRST = 3;
AnimationState.HOLD_MIX = 4;
AnimationState.SETUP = 1;
AnimationState.CURRENT = 2;
return AnimationState;

File diff suppressed because one or more lines are too long

View File

@ -249,7 +249,8 @@ declare module spine {
static emptyAnimation: Animation;
static SUBSEQUENT: number;
static FIRST: number;
static HOLD: number;
static HOLD_SUBSEQUENT: number;
static HOLD_FIRST: number;
static HOLD_MIX: number;
static SETUP: number;
static CURRENT: number;

View File

@ -1554,7 +1554,11 @@ var spine;
timelineBlend = spine.MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = spine.MixBlend.setup;
alpha = alphaHold;
break;
@ -1908,8 +1912,7 @@ var spine;
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (var i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -1933,7 +1936,7 @@ var spine;
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
};
@ -1961,8 +1964,9 @@ var spine;
AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
AnimationState.SUBSEQUENT = 0;
AnimationState.FIRST = 1;
AnimationState.HOLD = 2;
AnimationState.HOLD_MIX = 3;
AnimationState.HOLD_SUBSEQUENT = 2;
AnimationState.HOLD_FIRST = 3;
AnimationState.HOLD_MIX = 4;
AnimationState.SETUP = 1;
AnimationState.CURRENT = 2;
return AnimationState;

File diff suppressed because one or more lines are too long

View File

@ -249,7 +249,8 @@ declare module spine {
static emptyAnimation: Animation;
static SUBSEQUENT: number;
static FIRST: number;
static HOLD: number;
static HOLD_SUBSEQUENT: number;
static HOLD_FIRST: number;
static HOLD_MIX: number;
static SETUP: number;
static CURRENT: number;

View File

@ -1554,7 +1554,11 @@ var spine;
timelineBlend = spine.MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = spine.MixBlend.setup;
alpha = alphaHold;
break;
@ -1908,8 +1912,7 @@ var spine;
var propertyIDs = this.propertyIDs;
if (to != null && to.holdPrevious) {
for (var i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -1933,7 +1936,7 @@ var spine;
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
};
@ -1961,8 +1964,9 @@ var spine;
AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
AnimationState.SUBSEQUENT = 0;
AnimationState.FIRST = 1;
AnimationState.HOLD = 2;
AnimationState.HOLD_MIX = 3;
AnimationState.HOLD_SUBSEQUENT = 2;
AnimationState.HOLD_FIRST = 3;
AnimationState.HOLD_MIX = 4;
AnimationState.SETUP = 1;
AnimationState.CURRENT = 2;
return AnimationState;

File diff suppressed because one or more lines are too long

View File

@ -45,13 +45,18 @@ module spine {
*
* Result: Mix from the setup pose to the timeline pose. */
static FIRST = 1;
/** 1. This is the first timeline to set this property.
* 2. The next track entry to be applied does have a timeline to set this property.
* 3. The next track entry after that one does not have a timeline to set this property.
*
/** 1) A previously applied timeline has set this property.<br>
* 2) The next track entry to be applied does have a timeline to set this property.<br>
* 3) The next track entry after that one does not have a timeline to set this property.<br>
* Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading
* animations that key the same property. A subsequent timeline will set this property using a mix. */
static HOLD_SUBSEQUENT = 2;
/** 1) This is the first timeline to set this property.<br>
* 2) The next track entry to be applied does have a timeline to set this property.<br>
* 3) The next track entry after that one does not have a timeline to set this property.<br>
* Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading animations
* that key the same property. A subsequent timeline will set this property using a mix. */
static HOLD = 2;
static HOLD_FIRST = 3;
/** 1. This is the first timeline to set this property.
* 2. The next track entry to be applied does have a timeline to set this property.
* 3. The next track entry after that one does have a timeline to set this property.
@ -64,7 +69,7 @@ module spine {
* "dipping" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A
* (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into
* place. */
static HOLD_MIX = 3;
static HOLD_MIX = 4;
static SETUP = 1;
static CURRENT = 2;
@ -311,7 +316,11 @@ module spine {
timelineBlend = MixBlend.setup;
alpha = alphaMix;
break;
case AnimationState.HOLD:
case AnimationState.HOLD_SUBSEQUENT:
timelineBlend = blend;
alpha = alphaHold;
break;
case AnimationState.HOLD_FIRST:
timelineBlend = MixBlend.setup;
alpha = alphaHold;
break;
@ -758,8 +767,7 @@ module spine {
if (to != null && to.holdPrevious) {
for (let i = 0; i < timelinesCount; i++) {
propertyIDs.add(timelines[i].getPropertyId());
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;
}
return;
}
@ -783,7 +791,7 @@ module spine {
}
break;
}
timelineMode[i] = AnimationState.HOLD;
timelineMode[i] = AnimationState.HOLD_FIRST;
}
}
}