[all] AnimationState, fixed an attachment timeline from changing the mix blend for other timelines.

closes #1461
This commit is contained in:
NathanSweet 2019-08-27 13:20:24 +02:00
parent 88ece3181e
commit 2fa85fc1c6
7 changed files with 15 additions and 15 deletions

View File

@ -247,12 +247,12 @@ package spine.animation {
var alpha : Number = 0; var alpha : Number = 0;
switch (timelineMode[i] & (NOT_LAST - 1)) { switch (timelineMode[i] & (NOT_LAST - 1)) {
case SUBSEQUENT: case SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline is AttachmentTimeline) { if (!attachments && timeline is AttachmentTimeline) {
if ((timelineMode[i] & NOT_LAST) == NOT_LAST) continue; if ((timelineMode[i] & NOT_LAST) == NOT_LAST) continue;
blend = MixBlend.setup; timelineBlend = MixBlend.setup;
} }
if (!drawOrder && timeline is DrawOrderTimeline) continue; if (!drawOrder && timeline is DrawOrderTimeline) continue;
timelineBlend = blend;
alpha = alphaMix; alpha = alphaMix;
break; break;
case FIRST: case FIRST:

View File

@ -468,12 +468,12 @@ float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* t
switch (timelineMode->items[i] & (NOT_LAST - 1)) { switch (timelineMode->items[i] & (NOT_LAST - 1)) {
case SUBSEQUENT: case SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline->type == SP_TIMELINE_ATTACHMENT) { if (!attachments && timeline->type == SP_TIMELINE_ATTACHMENT) {
if ((timelineMode->items[i] & NOT_LAST) == NOT_LAST) continue; if ((timelineMode->items[i] & NOT_LAST) == NOT_LAST) continue;
blend = SP_MIX_BLEND_SETUP; timelineBlend = SP_MIX_BLEND_SETUP;
} }
if (!drawOrder && timeline->type == SP_TIMELINE_DRAWORDER) continue; if (!drawOrder && timeline->type == SP_TIMELINE_DRAWORDER) continue;
timelineBlend = blend;
alpha = alphaMix; alpha = alphaMix;
break; break;
case FIRST: case FIRST:

View File

@ -815,12 +815,12 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
float alpha; float alpha;
switch (timelineMode[i] & (NotLast - 1)) { switch (timelineMode[i] & (NotLast - 1)) {
case Subsequent: case Subsequent:
timelineBlend = blend;
if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) { if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) {
if ((timelineMode[i] & NotLast) == NotLast) continue; if ((timelineMode[i] & NotLast) == NotLast) continue;
blend = MixBlend_Setup; timelineBlend = MixBlend_Setup;
} }
if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue; if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue;
timelineBlend = blend;
alpha = alphaMix; alpha = alphaMix;
break; break;
case First: case First:

View File

@ -299,12 +299,12 @@ namespace Spine {
float alpha; float alpha;
switch (timelineMode[i] & AnimationState.NotLast - 1) { switch (timelineMode[i] & AnimationState.NotLast - 1) {
case AnimationState.Subsequent: case AnimationState.Subsequent:
timelineBlend = blend;
if (!attachments && timeline is AttachmentTimeline) { if (!attachments && timeline is AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NotLast) == AnimationState.NotLast) continue; if ((timelineMode[i] & AnimationState.NotLast) == AnimationState.NotLast) continue;
blend = MixBlend.Setup; timelineBlend = MixBlend.Setup;
} }
if (!drawOrder && timeline is DrawOrderTimeline) continue; if (!drawOrder && timeline is DrawOrderTimeline) continue;
timelineBlend = blend;
alpha = alphaMix; alpha = alphaMix;
break; break;
case AnimationState.First: case AnimationState.First:

View File

@ -291,12 +291,12 @@ public class AnimationState {
float alpha; float alpha;
switch (timelineMode[i] & NOT_LAST - 1) { switch (timelineMode[i] & NOT_LAST - 1) {
case SUBSEQUENT: case SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof AttachmentTimeline) { if (!attachments && timeline instanceof AttachmentTimeline) {
if ((timelineMode[i] & NOT_LAST) == NOT_LAST) continue; if ((timelineMode[i] & NOT_LAST) == NOT_LAST) continue;
blend = MixBlend.setup; timelineBlend = MixBlend.setup;
} }
if (!drawOrder && timeline instanceof DrawOrderTimeline) continue; if (!drawOrder && timeline instanceof DrawOrderTimeline) continue;
timelineBlend = blend;
alpha = alphaMix; alpha = alphaMix;
break; break;
case FIRST: case FIRST:

View File

@ -424,15 +424,15 @@ function AnimationState:applyMixingFrom (to, skeleton, blend)
local timelineBlend = MixBlend.setup local timelineBlend = MixBlend.setup
local alpha = 0 local alpha = 0
if clearBit(timelineMode[i], NOT_LAST) == SUBSEQUENT then if clearBit(timelineMode[i], NOT_LAST) == SUBSEQUENT then
timelineBlend = blend
if not attachments and timeline.type == Animation.TimelineType.attachment then if not attachments and timeline.type == Animation.TimelineType.attachment then
if testBit(timelineMode[i], NOT_LAST) then if testBit(timelineMode[i], NOT_LAST) then
skipSubsequent = true skipSubsequent = true
else else
blend = MixBlend.setup timelineBlend = MixBlend.setup
end end
end end
if not drawOrder and timeline.type == Animation.TimelineType.drawOrder then skipSubsequent = true end if not drawOrder and timeline.type == Animation.TimelineType.drawOrder then skipSubsequent = true end
timelineBlend = blend
alpha = alphaMix alpha = alphaMix
elseif clearBit(timelineMode[i], NOT_LAST) == FIRST then elseif clearBit(timelineMode[i], NOT_LAST) == FIRST then
timelineBlend = MixBlend.setup timelineBlend = MixBlend.setup

View File

@ -235,12 +235,12 @@ module spine {
let alpha = 0; let alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) { switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT: case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof AttachmentTimeline) { if (!attachments && timeline instanceof AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST) continue; if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST) continue;
blend = MixBlend.setup; timelineBlend = MixBlend.setup;
} }
if (!drawOrder && timeline instanceof DrawOrderTimeline) continue; if (!drawOrder && timeline instanceof DrawOrderTimeline) continue;
timelineBlend = blend;
alpha = alphaMix; alpha = alphaMix;
break; break;
case AnimationState.FIRST: case AnimationState.FIRST: