Merge remote-tracking branch 'origin/3.7-beta' into 3.7-beta

This commit is contained in:
Nathan Sweet 2017-10-28 20:26:57 +02:00
commit a75e166cbb
21 changed files with 49 additions and 32 deletions

View File

@ -207,9 +207,10 @@ package spine.animation {
if (from.mixingFrom != null) applyMixingFrom(from, skeleton, currentPose); if (from.mixingFrom != null) applyMixingFrom(from, skeleton, currentPose);
var mix : Number = 0; var mix : Number = 0;
if (to.mixDuration == 0) // Single frame mix to undo mixingFrom changes. if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.
mix = 1; mix = 1;
else { currentPose = MixPose.setup;
} else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) mix = 1; if (mix > 1) mix = 1;
} }

View File

@ -253,10 +253,10 @@ void _spRotateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
bone->rotation = bone->data->rotation; bone->rotation = bone->data->rotation;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
r = bone->data->rotation - bone->rotation; r = bone->data->rotation - bone->rotation;
r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360; r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360;
bone->rotation += r * alpha; bone->rotation += r * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -333,9 +333,9 @@ void _spTranslateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleto
bone->y = bone->data->y; bone->y = bone->data->y;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
bone->x += (bone->data->x - bone->x) * alpha; bone->x += (bone->data->x - bone->x) * alpha;
bone->y += (bone->data->y - bone->y) * alpha; bone->y += (bone->data->y - bone->y) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -405,9 +405,9 @@ void _spScaleTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
bone->scaleY = bone->data->scaleY; bone->scaleY = bone->data->scaleY;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
bone->scaleX += (bone->data->scaleX - bone->scaleX) * alpha; bone->scaleX += (bone->data->scaleX - bone->scaleX) * alpha;
bone->scaleY += (bone->data->scaleY - bone->scaleY) * alpha; bone->scaleY += (bone->data->scaleY - bone->scaleY) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -492,9 +492,9 @@ void _spShearTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
bone->shearY = bone->data->shearY; bone->shearY = bone->data->shearY;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
bone->shearX += (bone->data->shearX - bone->shearX) * alpha; bone->shearX += (bone->data->shearX - bone->shearX) * alpha;
bone->shearY += (bone->data->shearY - bone->shearY) * alpha; bone->shearY += (bone->data->shearY - bone->shearY) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -561,11 +561,11 @@ void _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
spColor_setFromColor(&slot->color, &slot->data->color); spColor_setFromColor(&slot->color, &slot->data->color);
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
color = &slot->color; color = &slot->color;
setup = &slot->data->color; setup = &slot->data->color;
spColor_addFloats(color, (setup->r - color->r) * alpha, (setup->g - color->g) * alpha, (setup->b - color->b) * alpha, spColor_addFloats(color, (setup->r - color->r) * alpha, (setup->g - color->g) * alpha, (setup->b - color->b) * alpha,
(setup->a - color->a) * alpha); (setup->a - color->a) * alpha);
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -651,7 +651,6 @@ void _spTwoColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton
spColor_setFromColor(slot->darkColor, slot->data->darkColor); spColor_setFromColor(slot->darkColor, slot->data->darkColor);
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
light = &slot->color; light = &slot->color;
dark = slot->darkColor; dark = slot->darkColor;
setupLight = &slot->data->color; setupLight = &slot->data->color;
@ -659,6 +658,7 @@ void _spTwoColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton
spColor_addFloats(light, (setupLight->r - light->r) * alpha, (setupLight->g - light->g) * alpha, (setupLight->b - light->b) * alpha, spColor_addFloats(light, (setupLight->r - light->r) * alpha, (setupLight->g - light->g) * alpha, (setupLight->b - light->b) * alpha,
(setupLight->a - light->a) * alpha); (setupLight->a - light->a) * alpha);
spColor_addFloats(dark, (setupDark->r - dark->r) * alpha, (setupDark->g - dark->g) * alpha, (setupDark->b - dark->b) * alpha, 0); spColor_addFloats(dark, (setupDark->r - dark->r) * alpha, (setupDark->g - dark->g) * alpha, (setupDark->b - dark->b) * alpha, 0);
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -863,7 +863,6 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
slot->attachmentVerticesCount = 0; slot->attachmentVerticesCount = 0;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
if (alpha == 1) { if (alpha == 1) {
slot->attachmentVerticesCount = 0; slot->attachmentVerticesCount = 0;
return; return;
@ -880,6 +879,7 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
vertices[i] *= alpha; vertices[i] *= alpha;
} }
} }
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -1164,9 +1164,9 @@ void _spIkConstraintTimeline_apply (const spTimeline* timeline, spSkeleton* skel
constraint->bendDirection = constraint->data->bendDirection; constraint->bendDirection = constraint->data->bendDirection;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
constraint->mix += (constraint->data->mix - constraint->mix) * alpha; constraint->mix += (constraint->data->mix - constraint->mix) * alpha;
constraint->bendDirection = constraint->data->bendDirection; constraint->bendDirection = constraint->data->bendDirection;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -1250,11 +1250,11 @@ void _spTransformConstraintTimeline_apply (const spTimeline* timeline, spSkeleto
constraint->shearMix = data->shearMix; constraint->shearMix = data->shearMix;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
constraint->rotateMix += (data->rotateMix - constraint->rotateMix) * alpha; constraint->rotateMix += (data->rotateMix - constraint->rotateMix) * alpha;
constraint->translateMix += (data->translateMix - constraint->translateMix) * alpha; constraint->translateMix += (data->translateMix - constraint->translateMix) * alpha;
constraint->scaleMix += (data->scaleMix - constraint->scaleMix) * alpha; constraint->scaleMix += (data->scaleMix - constraint->scaleMix) * alpha;
constraint->shearMix += (data->shearMix - constraint->shearMix) * alpha; constraint->shearMix += (data->shearMix - constraint->shearMix) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
return; return;
@ -1341,8 +1341,8 @@ void _spPathConstraintPositionTimeline_apply(const spTimeline* timeline, spSkele
constraint->position = constraint->data->position; constraint->position = constraint->data->position;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
constraint->position += (constraint->data->position - constraint->position) * alpha; constraint->position += (constraint->data->position - constraint->position) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -1406,8 +1406,8 @@ void _spPathConstraintSpacingTimeline_apply(const spTimeline* timeline, spSkelet
constraint->spacing = constraint->data->spacing; constraint->spacing = constraint->data->spacing;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
constraint->spacing += (constraint->data->spacing - constraint->spacing) * alpha; constraint->spacing += (constraint->data->spacing - constraint->spacing) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }
@ -1476,9 +1476,9 @@ void _spPathConstraintMixTimeline_apply(const spTimeline* timeline, spSkeleton*
constraint->translateMix = constraint->data->translateMix; constraint->translateMix = constraint->data->translateMix;
return; return;
case SP_MIX_POSE_CURRENT: case SP_MIX_POSE_CURRENT:
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
constraint->rotateMix += (constraint->data->rotateMix - constraint->rotateMix) * alpha; constraint->rotateMix += (constraint->data->rotateMix - constraint->rotateMix) * alpha;
constraint->translateMix += (constraint->data->translateMix - constraint->translateMix) * alpha; constraint->translateMix += (constraint->data->translateMix - constraint->translateMix) * alpha;
case SP_MIX_POSE_CURRENT_LAYERED:; /* to appease compiler */
} }
return; return;
} }

View File

@ -419,9 +419,10 @@ float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* t
spTrackEntry* from = to->mixingFrom; spTrackEntry* from = to->mixingFrom;
if (from->mixingFrom) _spAnimationState_applyMixingFrom(self, from, skeleton, currentPose); if (from->mixingFrom) _spAnimationState_applyMixingFrom(self, from, skeleton, currentPose);
if (to->mixDuration == 0) /* Single frame mix to undo mixingFrom changes. */ if (to->mixDuration == 0) { /* Single frame mix to undo mixingFrom changes. */
mix = 1; mix = 1;
else { currentPose = SP_MIX_POSE_SETUP;
} else {
mix = to->mixTime / to->mixDuration; mix = to->mixTime / to->mixDuration;
if (mix > 1) mix = 1; if (mix > 1) mix = 1;
} }

View File

@ -220,9 +220,10 @@ namespace Spine {
if (from.mixingFrom != null) ApplyMixingFrom(from, skeleton, currentPose); if (from.mixingFrom != null) ApplyMixingFrom(from, skeleton, currentPose);
float mix; float mix;
if (to.mixDuration == 0) // Single frame mix to undo mixingFrom changes. if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.
mix = 1; mix = 1;
else { currentPose = MixPose.Setup;
} else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) mix = 1; if (mix > 1) mix = 1;
} }

View File

@ -428,6 +428,7 @@ function AnimationState:applyMixingFrom (to, skeleton, currentPose)
local mix = 0 local mix = 0
if to.mixDuration == 0 then -- Single frame mix to undo mixingFrom changes. if to.mixDuration == 0 then -- Single frame mix to undo mixingFrom changes.
mix = 1 mix = 1
currentPose = MixPose.setup
else else
mix = to.mixTime / to.mixDuration mix = to.mixTime / to.mixDuration
if mix > 1 then mix = 1 end if mix > 1 then mix = 1 end

View File

@ -1715,8 +1715,10 @@ var spine;
if (from.mixingFrom != null) if (from.mixingFrom != null)
this.applyMixingFrom(from, skeleton, currentPose); this.applyMixingFrom(from, skeleton, currentPose);
var mix = 0; var mix = 0;
if (to.mixDuration == 0) if (to.mixDuration == 0) {
mix = 1; mix = 1;
currentPose = spine.MixPose.setup;
}
else { else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) if (mix > 1)

File diff suppressed because one or more lines are too long

View File

@ -1715,8 +1715,10 @@ var spine;
if (from.mixingFrom != null) if (from.mixingFrom != null)
this.applyMixingFrom(from, skeleton, currentPose); this.applyMixingFrom(from, skeleton, currentPose);
var mix = 0; var mix = 0;
if (to.mixDuration == 0) if (to.mixDuration == 0) {
mix = 1; mix = 1;
currentPose = spine.MixPose.setup;
}
else { else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) if (mix > 1)

File diff suppressed because one or more lines are too long

View File

@ -1266,8 +1266,10 @@ var spine;
if (from.mixingFrom != null) if (from.mixingFrom != null)
this.applyMixingFrom(from, skeleton, currentPose); this.applyMixingFrom(from, skeleton, currentPose);
var mix = 0; var mix = 0;
if (to.mixDuration == 0) if (to.mixDuration == 0) {
mix = 1; mix = 1;
currentPose = spine.MixPose.setup;
}
else { else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) if (mix > 1)

File diff suppressed because one or more lines are too long

View File

@ -1266,8 +1266,10 @@ var spine;
if (from.mixingFrom != null) if (from.mixingFrom != null)
this.applyMixingFrom(from, skeleton, currentPose); this.applyMixingFrom(from, skeleton, currentPose);
var mix = 0; var mix = 0;
if (to.mixDuration == 0) if (to.mixDuration == 0) {
mix = 1; mix = 1;
currentPose = spine.MixPose.setup;
}
else { else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) if (mix > 1)

File diff suppressed because one or more lines are too long

View File

@ -1266,8 +1266,10 @@ var spine;
if (from.mixingFrom != null) if (from.mixingFrom != null)
this.applyMixingFrom(from, skeleton, currentPose); this.applyMixingFrom(from, skeleton, currentPose);
var mix = 0; var mix = 0;
if (to.mixDuration == 0) if (to.mixDuration == 0) {
mix = 1; mix = 1;
currentPose = spine.MixPose.setup;
}
else { else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) if (mix > 1)

File diff suppressed because one or more lines are too long

View File

@ -1266,8 +1266,10 @@ var spine;
if (from.mixingFrom != null) if (from.mixingFrom != null)
this.applyMixingFrom(from, skeleton, currentPose); this.applyMixingFrom(from, skeleton, currentPose);
var mix = 0; var mix = 0;
if (to.mixDuration == 0) if (to.mixDuration == 0) {
mix = 1; mix = 1;
currentPose = spine.MixPose.setup;
}
else { else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) if (mix > 1)

File diff suppressed because one or more lines are too long

View File

@ -191,9 +191,10 @@ module spine {
if (from.mixingFrom != null) this.applyMixingFrom(from, skeleton, currentPose); if (from.mixingFrom != null) this.applyMixingFrom(from, skeleton, currentPose);
let mix = 0; let mix = 0;
if (to.mixDuration == 0) // Single frame mix to undo mixingFrom changes. if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.
mix = 1; mix = 1;
else { currentPose = MixPose.setup;
} else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) mix = 1; if (mix > 1) mix = 1;
} }