Skip to content

Commit c48487a

Browse files
committed
[haxe] Fix some missing porting loc.
1 parent 9fa2a04 commit c48487a

13 files changed

+41
-15
lines changed

spine-haxe/spine-haxe/spine/BonePose.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ class BonePose implements Pose<BonePose> implements Update {
262262
ib = pb * pid;
263263
case Inherit.noScale, Inherit.noScaleOrReflection:
264264
var r = rotation * MathUtils.degRad,
265-
cos = Math.cos(rotation),
266-
sin = Math.sin(rotation);
265+
cos = Math.cos(r),
266+
sin = Math.sin(r);
267267
pa = (pa * cos + pb * sin) / skeleton.scaleX;
268268
pc = (pc * cos + pd * sin) / skeleton.scaleY;
269269
var s = Math.sqrt(pa * pa + pc * pc);
@@ -405,7 +405,7 @@ class BonePose implements Pose<BonePose> implements Update {
405405

406406
/** Transforms a local rotation to a world rotation. */
407407
public function localToWorldRotation(localRotation:Float):Float {
408-
localRotation -= rotation - shearX;
408+
localRotation -= rotation + shearX;
409409
var sin:Float = MathUtils.sinDeg(localRotation),
410410
cos:Float = MathUtils.cosDeg(localRotation);
411411
return Math.atan2(cos * c + sin * d, cos * a + sin * b) * MathUtils.radDeg;

spine-haxe/spine-haxe/spine/animation/AnimationState.hx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ class AnimationState {
115115
var nextTime:Float = current.trackLast - next.delay;
116116
if (nextTime >= 0) {
117117
next.delay = 0;
118-
next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;
118+
next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;
119119
current.trackTime += currentDelta;
120120
setCurrent(i, next, true);
121121
while (next.mixingFrom != null) {
122-
next.mixTime += currentDelta;
122+
next.mixTime += delta;
123123
next = next.mixingFrom;
124124
}
125125
continue;
@@ -530,6 +530,7 @@ class AnimationState {
530530
private function setCurrent(index:Int, current:TrackEntry, interrupt:Bool):Void {
531531
var from:TrackEntry = expandToIndex(index);
532532
tracks[index] = current;
533+
current.previous = null;
533534

534535
if (from != null) {
535536
if (interrupt)

spine-haxe/spine-haxe/spine/animation/DeformTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class DeformTimeline extends SlotCurveTimeline {
5252
this.attachment = attachment;
5353
vertices = new Array<Array<Float>>();
5454
vertices.resize(frameCount);
55+
this.additive = true;
5556
}
5657

5758
public override function getFrameCount():Int {

spine-haxe/spine-haxe/spine/animation/DrawOrderFolderTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class DrawOrderFolderTimeline extends Timeline {
5252
inFolder[i] = false;
5353
for (i in slots)
5454
inFolder[i] = true;
55+
this.instant = true;
5556
}
5657

5758
private static function getPropertyIds(slots:Array<Int>):Array<String> {

spine-haxe/spine-haxe/spine/animation/DrawOrderTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class DrawOrderTimeline extends Timeline {
4444
super(frameCount, Property.drawOrder);
4545
drawOrders = new Array<Array<Int>>();
4646
drawOrders.resize(frameCount);
47+
this.instant = true;
4748
}
4849

4950
public var frameCount(get, never):Int;

spine-haxe/spine-haxe/spine/animation/EventTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class EventTimeline extends Timeline {
4242
super(frameCount, Property.event);
4343
events = new Array<Event>();
4444
events.resize(frameCount);
45+
this.instant = true;
4546
}
4647

4748
public override function getFrameCount():Int {

spine-haxe/spine-haxe/spine/animation/PathConstraintMixTimeline.hx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,14 @@ class PathConstraintMixTimeline extends CurveTimeline implements ConstraintTimel
110110
}
111111

112112
var base = fromSetup ? constraint.data.setupPose : pose;
113-
pose.mixRotate = base.mixRotate + (rotate - base.mixRotate) * alpha;
114-
pose.mixX = base.mixX + (x - base.mixX) * alpha;
115-
pose.mixY = base.mixY + (y - base.mixY) * alpha;
113+
if (add) {
114+
pose.mixRotate = base.mixRotate + rotate * alpha;
115+
pose.mixX = base.mixX + x * alpha;
116+
pose.mixY = base.mixY + y * alpha;
117+
} else {
118+
pose.mixRotate = base.mixRotate + (rotate - base.mixRotate) * alpha;
119+
pose.mixX = base.mixX + (x - base.mixX) * alpha;
120+
pose.mixY = base.mixY + (y - base.mixY) * alpha;
121+
}
116122
}
117123
}

spine-haxe/spine-haxe/spine/animation/PathConstraintPositionTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ package spine.animation;
3333
class PathConstraintPositionTimeline extends ConstraintTimeline1 {
3434
public function new(frameCount:Int, bezierCount:Int, constraintIndex:Int) {
3535
super(frameCount, bezierCount, constraintIndex, Property.pathConstraintPosition);
36+
this.additive = true;
3637
}
3738

3839
public function apply(skeleton:Skeleton, lastTime:Float, time:Float, events:Array<Event>, alpha:Float, fromSetup:Bool, add:Bool, out:Bool,

spine-haxe/spine-haxe/spine/animation/PhysicsConstraintResetTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class PhysicsConstraintResetTimeline extends Timeline implements ConstraintTimel
4141
public function new(frameCount:Int, constraintIndex:Int) {
4242
super(frameCount, Property.physicsConstraintReset);
4343
this.constraintIndex = constraintIndex;
44+
this.instant = true;
4445
}
4546

4647
public function getConstraintIndex() {

spine-haxe/spine-haxe/spine/animation/SequenceTimeline.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class SequenceTimeline extends Timeline implements SlotTimeline {
4444
super(frameCount, Std.string(Property.sequence) + "|" + Std.string(slotIndex) + "|" + Std.string(attachment.sequence.id));
4545
this.slotIndex = slotIndex;
4646
this.attachment = attachment;
47+
this.instant = true;
4748
}
4849

4950
public override function getFrameEntries():Int {

0 commit comments

Comments
 (0)