Merge branch '4.1-beta' into 4.1-beta-physics

This commit is contained in:
Mario Zechner 2022-01-27 18:42:52 +01:00
commit e4a92c8463
7 changed files with 22 additions and 24 deletions

View File

@ -655,8 +655,8 @@ void _spScaleTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float la
bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha; bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
break; break;
case SP_MIX_BLEND_ADD: case SP_MIX_BLEND_ADD:
bone->scaleX = (x - bone->data->scaleX) * alpha; bone->scaleX += (x - bone->data->scaleX) * alpha;
bone->scaleY = (y - bone->data->scaleY) * alpha; bone->scaleY += (y - bone->data->scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -748,7 +748,7 @@ void _spScaleXTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float l
bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha; bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha;
break; break;
case SP_MIX_BLEND_ADD: case SP_MIX_BLEND_ADD:
bone->scaleX = (x - bone->data->scaleX) * alpha; bone->scaleX += (x - bone->data->scaleX) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -834,7 +834,7 @@ void _spScaleYTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float l
bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha; bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
break; break;
case SP_MIX_BLEND_ADD: case SP_MIX_BLEND_ADD:
bone->scaleY = (y - bone->data->scaleY) * alpha; bone->scaleY += (y - bone->data->scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -1756,7 +1756,7 @@ void _spDeformTimeline_apply(
spTimeline *timeline, spSkeleton *skeleton, float lastTime, float time, spEvent **firedEvents, spTimeline *timeline, spSkeleton *skeleton, float lastTime, float time, spEvent **firedEvents,
int *eventsCount, float alpha, spMixBlend blend, spMixDirection direction) { int *eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
int frame, i, vertexCount; int frame, i, vertexCount;
float percent, frameTime; float percent;
const float *prevVertices; const float *prevVertices;
const float *nextVertices; const float *nextVertices;
float *frames; float *frames;
@ -1892,7 +1892,6 @@ void _spDeformTimeline_apply(
percent = _spDeformTimeline_getCurvePercent(self, time, frame); percent = _spDeformTimeline_getCurvePercent(self, time, frame);
prevVertices = frameVertices[frame]; prevVertices = frameVertices[frame];
nextVertices = frameVertices[frame + 1]; nextVertices = frameVertices[frame + 1];
frameTime = frames[frame];
if (alpha == 1) { if (alpha == 1) {
if (blend == SP_MIX_BLEND_ADD) { if (blend == SP_MIX_BLEND_ADD) {

View File

@ -131,8 +131,8 @@ void ScaleTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha; bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha;
break; break;
case MixBlend_Add: case MixBlend_Add:
bone->_scaleX = (x - bone->_data._scaleX) * alpha; bone->_scaleX += (x - bone->_data._scaleX) * alpha;
bone->_scaleY = (y - bone->_data._scaleY) * alpha; bone->_scaleY += (y - bone->_data._scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -210,7 +210,7 @@ void ScaleXTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
bone->_scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bx) * alpha; bone->_scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bx) * alpha;
break; break;
case MixBlend_Add: case MixBlend_Add:
bone->_scaleX = (x - bone->_data._scaleX) * alpha; bone->_scaleX += (x - bone->_data._scaleX) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -283,7 +283,7 @@ void ScaleYTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha; bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha;
break; break;
case MixBlend_Add: case MixBlend_Add:
bone->_scaleY = (y - bone->_data._scaleY) * alpha; bone->_scaleY += (y - bone->_data._scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {

View File

@ -774,8 +774,8 @@ namespace Spine {
bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha; bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha;
break; break;
case MixBlend.Add: case MixBlend.Add:
bone.scaleX = (x - bone.data.scaleX) * alpha; bone.scaleX += (x - bone.data.scaleX) * alpha;
bone.scaleY = (y - bone.data.scaleY) * alpha; bone.scaleY += (y - bone.data.scaleY) * alpha;
break; break;
} }
} else { } else {
@ -857,7 +857,7 @@ namespace Spine {
bone.scaleX = bx + (Math.Abs(x) * Math.Sign(bx) - bx) * alpha; bone.scaleX = bx + (Math.Abs(x) * Math.Sign(bx) - bx) * alpha;
break; break;
case MixBlend.Add: case MixBlend.Add:
bone.scaleX = (x - bone.data.scaleX) * alpha; bone.scaleX += (x - bone.data.scaleX) * alpha;
break; break;
} }
} else { } else {
@ -934,7 +934,7 @@ namespace Spine {
bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha; bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha;
break; break;
case MixBlend.Add: case MixBlend.Add:
bone.scaleY = (y - bone.data.scaleY) * alpha; bone.scaleY += (y - bone.data.scaleY) * alpha;
break; break;
} }
} else { } else {

View File

@ -28,7 +28,6 @@
*****************************************************************************/ *****************************************************************************/
using System; using System;
using System.Collections.Generic;
namespace Spine { namespace Spine {
public class Skeleton { public class Skeleton {

View File

@ -743,8 +743,8 @@ public class Animation {
bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha; bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha;
break; break;
case add: case add:
bone.scaleX = (x - bone.data.scaleX) * alpha; bone.scaleX += (x - bone.data.scaleX) * alpha;
bone.scaleY = (y - bone.data.scaleY) * alpha; bone.scaleY += (y - bone.data.scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -822,7 +822,7 @@ public class Animation {
bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha; bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha;
break; break;
case add: case add:
bone.scaleX = (x - bone.data.scaleX) * alpha; bone.scaleX += (x - bone.data.scaleX) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -895,7 +895,7 @@ public class Animation {
bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha; bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha;
break; break;
case add: case add:
bone.scaleY = (y - bone.data.scaleY) * alpha; bone.scaleY += (y - bone.data.scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {

View File

@ -54,7 +54,7 @@ You can include a module in your project via a `<script>` tag from the [unpkg](h
// spine-ts Player, which requires a spine-player.css as well // spine-ts Player, which requires a spine-player.css as well
<script src="https://unpkg.com/@esotericsoftware/spine-player@4.0.*/dist/iife/spine-player.js"> <script src="https://unpkg.com/@esotericsoftware/spine-player@4.0.*/dist/iife/spine-player.js">
<link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/spine-player@4.0.*/dist/iife/spine-player.css"> <link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/spine-player@4.0.*/dist/spine-player.css">
// spine-ts WebGL // spine-ts WebGL
<script src="https://unpkg.com/@esotericsoftware/spine-threejs@4.0.*/dist/iife/spine-webgl.js"> <script src="https://unpkg.com/@esotericsoftware/spine-threejs@4.0.*/dist/iife/spine-webgl.js">

View File

@ -626,8 +626,8 @@ export class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
break; break;
case MixBlend.add: case MixBlend.add:
bone.scaleX = (x - bone.data.scaleX) * alpha; bone.scaleX += (x - bone.data.scaleX) * alpha;
bone.scaleY = (y - bone.data.scaleY) * alpha; bone.scaleY += (y - bone.data.scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -699,7 +699,7 @@ export class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;
break; break;
case MixBlend.add: case MixBlend.add:
bone.scaleX = (x - bone.data.scaleX) * alpha; bone.scaleX += (x - bone.data.scaleX) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {
@ -766,7 +766,7 @@ export class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
break; break;
case MixBlend.add: case MixBlend.add:
bone.scaleY = (y - bone.data.scaleY) * alpha; bone.scaleY += (y - bone.data.scaleY) * alpha;
} }
} else { } else {
switch (blend) { switch (blend) {