@esotericsoftware/spine-webgl 4.0.14 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AssetManager.d.ts +2 -2
- package/dist/AssetManager.js +2 -2
- package/dist/Camera.d.ts +2 -2
- package/dist/Camera.js +2 -2
- package/dist/CameraController.d.ts +2 -2
- package/dist/CameraController.js +2 -2
- package/dist/GLTexture.d.ts +2 -2
- package/dist/GLTexture.js +2 -2
- package/dist/Input.d.ts +2 -2
- package/dist/Input.js +2 -2
- package/dist/LoadingScreen.d.ts +2 -2
- package/dist/LoadingScreen.js +2 -2
- package/dist/Matrix4.d.ts +2 -2
- package/dist/Matrix4.js +2 -2
- package/dist/Mesh.d.ts +2 -2
- package/dist/Mesh.js +2 -2
- package/dist/PolygonBatcher.d.ts +2 -2
- package/dist/PolygonBatcher.js +5 -3
- package/dist/SceneRenderer.d.ts +2 -2
- package/dist/SceneRenderer.js +2 -2
- package/dist/Shader.d.ts +2 -2
- package/dist/Shader.js +2 -2
- package/dist/ShapeRenderer.d.ts +2 -2
- package/dist/ShapeRenderer.js +2 -2
- package/dist/SkeletonDebugRenderer.d.ts +2 -2
- package/dist/SkeletonDebugRenderer.js +8 -8
- package/dist/SkeletonRenderer.d.ts +2 -2
- package/dist/SkeletonRenderer.js +4 -4
- package/dist/SpineCanvas.d.ts +2 -2
- package/dist/SpineCanvas.js +2 -2
- package/dist/Vector3.d.ts +2 -2
- package/dist/Vector3.js +2 -2
- package/dist/WebGL.d.ts +2 -2
- package/dist/WebGL.js +2 -2
- package/dist/iife/spine-webgl.js +374 -149
- package/dist/iife/spine-webgl.js.map +3 -3
- package/dist/iife/spine-webgl.min.js +26 -26
- package/package.json +3 -3
package/dist/iife/spine-webgl.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var spine = (() => {
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
4
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
5
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
};
|
|
7
4
|
var __export = (target, all) => {
|
|
8
5
|
__markAsModule(target);
|
|
9
6
|
for (var name in all)
|
|
@@ -113,6 +110,7 @@ var spine = (() => {
|
|
|
113
110
|
ScaleXTimeline: () => ScaleXTimeline,
|
|
114
111
|
ScaleYTimeline: () => ScaleYTimeline,
|
|
115
112
|
SceneRenderer: () => SceneRenderer,
|
|
113
|
+
SequenceTimeline: () => SequenceTimeline,
|
|
116
114
|
Shader: () => Shader,
|
|
117
115
|
ShapeRenderer: () => ShapeRenderer,
|
|
118
116
|
ShapeType: () => ShapeType,
|
|
@@ -557,7 +555,7 @@ var spine = (() => {
|
|
|
557
555
|
super(name);
|
|
558
556
|
this.id = _VertexAttachment.nextID++;
|
|
559
557
|
this.worldVerticesLength = 0;
|
|
560
|
-
this.
|
|
558
|
+
this.timelineAttahment = this;
|
|
561
559
|
}
|
|
562
560
|
computeWorldVertices(slot, start, count, worldVertices, offset, stride) {
|
|
563
561
|
count = offset + (count >> 1) * stride;
|
|
@@ -629,12 +627,75 @@ var spine = (() => {
|
|
|
629
627
|
} else
|
|
630
628
|
attachment.vertices = null;
|
|
631
629
|
attachment.worldVerticesLength = this.worldVerticesLength;
|
|
632
|
-
attachment.
|
|
630
|
+
attachment.timelineAttahment = this.timelineAttahment;
|
|
633
631
|
}
|
|
634
632
|
};
|
|
635
633
|
var VertexAttachment = _VertexAttachment;
|
|
636
634
|
VertexAttachment.nextID = 0;
|
|
637
635
|
|
|
636
|
+
// spine-core/src/attachments/Sequence.ts
|
|
637
|
+
var _Sequence = class {
|
|
638
|
+
constructor(count) {
|
|
639
|
+
this.id = _Sequence.nextID();
|
|
640
|
+
this.start = 0;
|
|
641
|
+
this.digits = 0;
|
|
642
|
+
this.setupIndex = 0;
|
|
643
|
+
this.regions = new Array(count);
|
|
644
|
+
}
|
|
645
|
+
copy() {
|
|
646
|
+
let copy = new _Sequence(this.regions.length);
|
|
647
|
+
Utils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);
|
|
648
|
+
copy.start = this.start;
|
|
649
|
+
copy.digits = this.digits;
|
|
650
|
+
copy.setupIndex = this.setupIndex;
|
|
651
|
+
return copy;
|
|
652
|
+
}
|
|
653
|
+
apply(slot, attachment) {
|
|
654
|
+
let index = slot.sequenceIndex;
|
|
655
|
+
if (index == -1)
|
|
656
|
+
index = this.setupIndex;
|
|
657
|
+
if (index >= this.regions.length)
|
|
658
|
+
index = this.regions.length - 1;
|
|
659
|
+
let region = this.regions[index];
|
|
660
|
+
if (attachment.region != region) {
|
|
661
|
+
attachment.region = region;
|
|
662
|
+
attachment.updateRegion();
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
getPath(basePath, index) {
|
|
666
|
+
let result = basePath;
|
|
667
|
+
let frame = (this.start + index).toString();
|
|
668
|
+
for (let i = this.digits - frame.length; i > 0; i--)
|
|
669
|
+
result += "0";
|
|
670
|
+
result += frame;
|
|
671
|
+
return result;
|
|
672
|
+
}
|
|
673
|
+
static nextID() {
|
|
674
|
+
return _Sequence._nextID++;
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
var Sequence = _Sequence;
|
|
678
|
+
Sequence._nextID = 0;
|
|
679
|
+
var SequenceMode;
|
|
680
|
+
(function(SequenceMode2) {
|
|
681
|
+
SequenceMode2[SequenceMode2["hold"] = 0] = "hold";
|
|
682
|
+
SequenceMode2[SequenceMode2["once"] = 1] = "once";
|
|
683
|
+
SequenceMode2[SequenceMode2["loop"] = 2] = "loop";
|
|
684
|
+
SequenceMode2[SequenceMode2["pingpong"] = 3] = "pingpong";
|
|
685
|
+
SequenceMode2[SequenceMode2["onceReverse"] = 4] = "onceReverse";
|
|
686
|
+
SequenceMode2[SequenceMode2["loopReverse"] = 5] = "loopReverse";
|
|
687
|
+
SequenceMode2[SequenceMode2["pingpongReverse"] = 6] = "pingpongReverse";
|
|
688
|
+
})(SequenceMode || (SequenceMode = {}));
|
|
689
|
+
var SequenceModeValues = [
|
|
690
|
+
0,
|
|
691
|
+
1,
|
|
692
|
+
2,
|
|
693
|
+
3,
|
|
694
|
+
4,
|
|
695
|
+
5,
|
|
696
|
+
6
|
|
697
|
+
];
|
|
698
|
+
|
|
638
699
|
// spine-core/src/Animation.ts
|
|
639
700
|
var Animation = class {
|
|
640
701
|
constructor(name, timelines, duration) {
|
|
@@ -702,7 +763,8 @@ var spine = (() => {
|
|
|
702
763
|
transformConstraint: 15,
|
|
703
764
|
pathConstraintPosition: 16,
|
|
704
765
|
pathConstraintSpacing: 17,
|
|
705
|
-
pathConstraintMix: 18
|
|
766
|
+
pathConstraintMix: 18,
|
|
767
|
+
sequence: 19
|
|
706
768
|
};
|
|
707
769
|
var Timeline = class {
|
|
708
770
|
constructor(frameCount, propertyIds) {
|
|
@@ -1860,7 +1922,7 @@ var spine = (() => {
|
|
|
1860
1922
|
if (!slot.bone.active)
|
|
1861
1923
|
return;
|
|
1862
1924
|
let slotAttachment = slot.getAttachment();
|
|
1863
|
-
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.
|
|
1925
|
+
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttahment != this.attachment)
|
|
1864
1926
|
return;
|
|
1865
1927
|
let deform = slot.deform;
|
|
1866
1928
|
if (deform.length == 0)
|
|
@@ -1869,7 +1931,6 @@ var spine = (() => {
|
|
|
1869
1931
|
let vertexCount = vertices[0].length;
|
|
1870
1932
|
let frames = this.frames;
|
|
1871
1933
|
if (time < frames[0]) {
|
|
1872
|
-
let vertexAttachment = slotAttachment;
|
|
1873
1934
|
switch (blend) {
|
|
1874
1935
|
case 0:
|
|
1875
1936
|
deform.length = 0;
|
|
@@ -1880,6 +1941,7 @@ var spine = (() => {
|
|
|
1880
1941
|
return;
|
|
1881
1942
|
}
|
|
1882
1943
|
deform.length = vertexCount;
|
|
1944
|
+
let vertexAttachment = slotAttachment;
|
|
1883
1945
|
if (!vertexAttachment.bones) {
|
|
1884
1946
|
let setupVertices = vertexAttachment.vertices;
|
|
1885
1947
|
for (var i = 0; i < vertexCount; i++)
|
|
@@ -2404,6 +2466,81 @@ var spine = (() => {
|
|
|
2404
2466
|
}
|
|
2405
2467
|
}
|
|
2406
2468
|
};
|
|
2469
|
+
var _SequenceTimeline = class extends Timeline {
|
|
2470
|
+
constructor(frameCount, slotIndex, attachment) {
|
|
2471
|
+
super(frameCount, [
|
|
2472
|
+
Property.sequence + "|" + slotIndex + "|" + attachment.sequence.id
|
|
2473
|
+
]);
|
|
2474
|
+
this.slotIndex = slotIndex;
|
|
2475
|
+
this.attachment = attachment;
|
|
2476
|
+
}
|
|
2477
|
+
getFrameEntries() {
|
|
2478
|
+
return _SequenceTimeline.ENTRIES;
|
|
2479
|
+
}
|
|
2480
|
+
getSlotIndex() {
|
|
2481
|
+
return this.slotIndex;
|
|
2482
|
+
}
|
|
2483
|
+
getAttachment() {
|
|
2484
|
+
return this.attachment;
|
|
2485
|
+
}
|
|
2486
|
+
setFrame(frame, time, mode, index, delay) {
|
|
2487
|
+
let frames = this.frames;
|
|
2488
|
+
frame *= _SequenceTimeline.ENTRIES;
|
|
2489
|
+
frames[frame] = time;
|
|
2490
|
+
frames[frame + _SequenceTimeline.MODE] = mode | index << 4;
|
|
2491
|
+
frames[frame + _SequenceTimeline.DELAY] = delay;
|
|
2492
|
+
}
|
|
2493
|
+
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
2494
|
+
let slot = skeleton.slots[this.slotIndex];
|
|
2495
|
+
if (!slot.bone.active)
|
|
2496
|
+
return;
|
|
2497
|
+
let slotAttachment = slot.attachment;
|
|
2498
|
+
let attachment = this.attachment;
|
|
2499
|
+
if (slotAttachment != attachment) {
|
|
2500
|
+
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttahment != attachment)
|
|
2501
|
+
return;
|
|
2502
|
+
}
|
|
2503
|
+
let frames = this.frames;
|
|
2504
|
+
if (time < frames[0]) {
|
|
2505
|
+
if (blend == 0 || blend == 1)
|
|
2506
|
+
slot.sequenceIndex = -1;
|
|
2507
|
+
return;
|
|
2508
|
+
}
|
|
2509
|
+
let i = Timeline.search(frames, time, _SequenceTimeline.ENTRIES);
|
|
2510
|
+
let before = frames[i];
|
|
2511
|
+
let modeAndIndex = frames[i + _SequenceTimeline.MODE];
|
|
2512
|
+
let delay = frames[i + _SequenceTimeline.DELAY];
|
|
2513
|
+
let index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length;
|
|
2514
|
+
let mode = SequenceModeValues[modeAndIndex & 15];
|
|
2515
|
+
if (mode != SequenceMode.hold) {
|
|
2516
|
+
index += (time - before) / delay + 1e-5 | 0;
|
|
2517
|
+
switch (mode) {
|
|
2518
|
+
case SequenceMode.once:
|
|
2519
|
+
index = Math.min(count - 1, index);
|
|
2520
|
+
break;
|
|
2521
|
+
case SequenceMode.loop:
|
|
2522
|
+
index %= count;
|
|
2523
|
+
break;
|
|
2524
|
+
case SequenceMode.pingpong:
|
|
2525
|
+
let n = (count << 1) - 2;
|
|
2526
|
+
index %= n;
|
|
2527
|
+
if (index >= count)
|
|
2528
|
+
index = n - index;
|
|
2529
|
+
break;
|
|
2530
|
+
case SequenceMode.onceReverse:
|
|
2531
|
+
index = Math.max(count - 1 - index, 0);
|
|
2532
|
+
break;
|
|
2533
|
+
case SequenceMode.loopReverse:
|
|
2534
|
+
index = count - 1 - index % count;
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
slot.sequenceIndex = index;
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
var SequenceTimeline = _SequenceTimeline;
|
|
2541
|
+
SequenceTimeline.ENTRIES = 3;
|
|
2542
|
+
SequenceTimeline.MODE = 1;
|
|
2543
|
+
SequenceTimeline.DELAY = 2;
|
|
2407
2544
|
|
|
2408
2545
|
// spine-core/src/AnimationState.ts
|
|
2409
2546
|
var AnimationState = class {
|
|
@@ -3497,7 +3634,7 @@ var spine = (() => {
|
|
|
3497
3634
|
this.color = new Color(1, 1, 1, 1);
|
|
3498
3635
|
this.tempColor = new Color(0, 0, 0, 0);
|
|
3499
3636
|
}
|
|
3500
|
-
|
|
3637
|
+
updateRegion() {
|
|
3501
3638
|
let regionUVs = this.regionUVs;
|
|
3502
3639
|
if (!this.uvs || this.uvs.length != regionUVs.length)
|
|
3503
3640
|
this.uvs = Utils.newFloatArray(regionUVs.length);
|
|
@@ -3585,6 +3722,7 @@ var spine = (() => {
|
|
|
3585
3722
|
copy.triangles = new Array(this.triangles.length);
|
|
3586
3723
|
Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);
|
|
3587
3724
|
copy.hullLength = this.hullLength;
|
|
3725
|
+
copy.sequence = this.sequence.copy();
|
|
3588
3726
|
if (this.edges) {
|
|
3589
3727
|
copy.edges = new Array(this.edges.length);
|
|
3590
3728
|
Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);
|
|
@@ -3593,14 +3731,20 @@ var spine = (() => {
|
|
|
3593
3731
|
copy.height = this.height;
|
|
3594
3732
|
return copy;
|
|
3595
3733
|
}
|
|
3734
|
+
computeWorldVertices(slot, start, count, worldVertices, offset, stride) {
|
|
3735
|
+
if (this.sequence != null)
|
|
3736
|
+
this.sequence.apply(slot, this);
|
|
3737
|
+
super.computeWorldVertices(slot, start, count, worldVertices, offset, stride);
|
|
3738
|
+
}
|
|
3596
3739
|
newLinkedMesh() {
|
|
3597
3740
|
let copy = new MeshAttachment(this.name);
|
|
3598
3741
|
copy.region = this.region;
|
|
3599
3742
|
copy.path = this.path;
|
|
3600
3743
|
copy.color.setFromColor(this.color);
|
|
3601
|
-
copy.
|
|
3744
|
+
copy.timelineAttahment = this.timelineAttahment;
|
|
3602
3745
|
copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
|
|
3603
|
-
copy.
|
|
3746
|
+
if (copy.region != null)
|
|
3747
|
+
copy.updateRegion();
|
|
3604
3748
|
return copy;
|
|
3605
3749
|
}
|
|
3606
3750
|
};
|
|
@@ -3668,7 +3812,7 @@ var spine = (() => {
|
|
|
3668
3812
|
this.uvs = Utils.newFloatArray(8);
|
|
3669
3813
|
this.tempColor = new Color(1, 1, 1, 1);
|
|
3670
3814
|
}
|
|
3671
|
-
|
|
3815
|
+
updateRegion() {
|
|
3672
3816
|
let region = this.region;
|
|
3673
3817
|
let regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
|
3674
3818
|
let regionScaleY = this.height / this.region.originalHeight * this.scaleY;
|
|
@@ -3697,9 +3841,6 @@ var spine = (() => {
|
|
|
3697
3841
|
offset[5] = localY2Cos + localX2Sin;
|
|
3698
3842
|
offset[6] = localX2Cos - localYSin;
|
|
3699
3843
|
offset[7] = localYCos + localX2Sin;
|
|
3700
|
-
}
|
|
3701
|
-
setRegion(region) {
|
|
3702
|
-
this.region = region;
|
|
3703
3844
|
let uvs = this.uvs;
|
|
3704
3845
|
if (region.degrees == 90) {
|
|
3705
3846
|
uvs[2] = region.u;
|
|
@@ -3721,7 +3862,10 @@ var spine = (() => {
|
|
|
3721
3862
|
uvs[7] = region.v2;
|
|
3722
3863
|
}
|
|
3723
3864
|
}
|
|
3724
|
-
computeWorldVertices(
|
|
3865
|
+
computeWorldVertices(slot, worldVertices, offset, stride) {
|
|
3866
|
+
if (this.sequence != null)
|
|
3867
|
+
this.sequence.apply(slot, this);
|
|
3868
|
+
let bone = slot.bone;
|
|
3725
3869
|
let vertexOffset = this.offset;
|
|
3726
3870
|
let x = bone.worldX, y = bone.worldY;
|
|
3727
3871
|
let a = bone.a, b = bone.b, c = bone.c, d = bone.d;
|
|
@@ -3761,6 +3905,7 @@ var spine = (() => {
|
|
|
3761
3905
|
Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);
|
|
3762
3906
|
Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);
|
|
3763
3907
|
copy.color.setFromColor(this.color);
|
|
3908
|
+
copy.sequence = this.sequence.copy();
|
|
3764
3909
|
return copy;
|
|
3765
3910
|
}
|
|
3766
3911
|
};
|
|
@@ -3803,22 +3948,40 @@ var spine = (() => {
|
|
|
3803
3948
|
constructor(atlas) {
|
|
3804
3949
|
this.atlas = atlas;
|
|
3805
3950
|
}
|
|
3806
|
-
|
|
3807
|
-
let
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3951
|
+
loadSequence(name, basePath, sequence) {
|
|
3952
|
+
let regions = sequence.regions;
|
|
3953
|
+
for (let i = 0, n = regions.length; i < n; i++) {
|
|
3954
|
+
let path = sequence.getPath(basePath, i);
|
|
3955
|
+
regions[i] = this.atlas.findRegion(path);
|
|
3956
|
+
regions[i].renderObject = regions[i];
|
|
3957
|
+
if (regions[i] == null)
|
|
3958
|
+
throw new Error("Region not found in atlas: " + path + " (sequence: " + name + ")");
|
|
3959
|
+
}
|
|
3960
|
+
}
|
|
3961
|
+
newRegionAttachment(skin, name, path, sequence) {
|
|
3811
3962
|
let attachment = new RegionAttachment(name);
|
|
3812
|
-
|
|
3963
|
+
if (sequence != null) {
|
|
3964
|
+
this.loadSequence(name, path, sequence);
|
|
3965
|
+
} else {
|
|
3966
|
+
let region = this.atlas.findRegion(path);
|
|
3967
|
+
if (!region)
|
|
3968
|
+
throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
|
|
3969
|
+
region.renderObject = region;
|
|
3970
|
+
attachment.region = region;
|
|
3971
|
+
}
|
|
3813
3972
|
return attachment;
|
|
3814
3973
|
}
|
|
3815
|
-
newMeshAttachment(skin, name, path) {
|
|
3816
|
-
let region = this.atlas.findRegion(path);
|
|
3817
|
-
if (!region)
|
|
3818
|
-
throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
|
|
3819
|
-
region.renderObject = region;
|
|
3974
|
+
newMeshAttachment(skin, name, path, sequence) {
|
|
3820
3975
|
let attachment = new MeshAttachment(name);
|
|
3821
|
-
|
|
3976
|
+
if (sequence != null) {
|
|
3977
|
+
this.loadSequence(name, path, sequence);
|
|
3978
|
+
} else {
|
|
3979
|
+
let region = this.atlas.findRegion(path);
|
|
3980
|
+
if (!region)
|
|
3981
|
+
throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
|
|
3982
|
+
region.renderObject = region;
|
|
3983
|
+
attachment.region = region;
|
|
3984
|
+
}
|
|
3822
3985
|
return attachment;
|
|
3823
3986
|
}
|
|
3824
3987
|
newBoundingBoxAttachment(skin, name) {
|
|
@@ -5125,17 +5288,11 @@ var spine = (() => {
|
|
|
5125
5288
|
setAttachment(attachment) {
|
|
5126
5289
|
if (this.attachment == attachment)
|
|
5127
5290
|
return;
|
|
5128
|
-
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.
|
|
5291
|
+
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttahment != this.attachment.timelineAttahment) {
|
|
5129
5292
|
this.deform.length = 0;
|
|
5130
5293
|
}
|
|
5131
5294
|
this.attachment = attachment;
|
|
5132
|
-
this.
|
|
5133
|
-
}
|
|
5134
|
-
setAttachmentTime(time) {
|
|
5135
|
-
this.attachmentTime = this.bone.skeleton.time - time;
|
|
5136
|
-
}
|
|
5137
|
-
getAttachmentTime() {
|
|
5138
|
-
return this.bone.skeleton.time - this.attachmentTime;
|
|
5295
|
+
this.sequenceIndex = -1;
|
|
5139
5296
|
}
|
|
5140
5297
|
setToSetupPose() {
|
|
5141
5298
|
this.color.setFromColor(this.data.color);
|
|
@@ -5361,7 +5518,6 @@ var spine = (() => {
|
|
|
5361
5518
|
var Skeleton = class {
|
|
5362
5519
|
constructor(data) {
|
|
5363
5520
|
this._updateCache = new Array();
|
|
5364
|
-
this.time = 0;
|
|
5365
5521
|
this.scaleX = 1;
|
|
5366
5522
|
this.scaleY = 1;
|
|
5367
5523
|
this.x = 0;
|
|
@@ -5795,7 +5951,7 @@ var spine = (() => {
|
|
|
5795
5951
|
if (attachment instanceof RegionAttachment) {
|
|
5796
5952
|
verticesLength = 8;
|
|
5797
5953
|
vertices = Utils.setArraySize(temp, verticesLength, 0);
|
|
5798
|
-
attachment.computeWorldVertices(slot
|
|
5954
|
+
attachment.computeWorldVertices(slot, vertices, 0, 2);
|
|
5799
5955
|
} else if (attachment instanceof MeshAttachment) {
|
|
5800
5956
|
let mesh = attachment;
|
|
5801
5957
|
verticesLength = mesh.worldVerticesLength;
|
|
@@ -5815,9 +5971,6 @@ var spine = (() => {
|
|
|
5815
5971
|
offset.set(minX, minY);
|
|
5816
5972
|
size.set(maxX - minX, maxY - minY);
|
|
5817
5973
|
}
|
|
5818
|
-
update(delta) {
|
|
5819
|
-
this.time += delta;
|
|
5820
|
-
}
|
|
5821
5974
|
};
|
|
5822
5975
|
|
|
5823
5976
|
// spine-core/src/SkeletonData.ts
|
|
@@ -6269,9 +6422,10 @@ var spine = (() => {
|
|
|
6269
6422
|
let linkedMesh = this.linkedMeshes[i];
|
|
6270
6423
|
let skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);
|
|
6271
6424
|
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
|
|
6272
|
-
linkedMesh.mesh.
|
|
6425
|
+
linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
|
|
6273
6426
|
linkedMesh.mesh.setParentMesh(parent);
|
|
6274
|
-
linkedMesh.mesh.
|
|
6427
|
+
if (linkedMesh.mesh.region != null)
|
|
6428
|
+
linkedMesh.mesh.updateRegion();
|
|
6275
6429
|
}
|
|
6276
6430
|
this.linkedMeshes.length = 0;
|
|
6277
6431
|
n = input.readInt(true);
|
|
@@ -6340,9 +6494,10 @@ var spine = (() => {
|
|
|
6340
6494
|
let width = input.readFloat();
|
|
6341
6495
|
let height = input.readFloat();
|
|
6342
6496
|
let color = input.readInt32();
|
|
6497
|
+
let sequence = this.readSequence(input);
|
|
6343
6498
|
if (!path)
|
|
6344
6499
|
path = name;
|
|
6345
|
-
let region = this.attachmentLoader.newRegionAttachment(skin, name, path);
|
|
6500
|
+
let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);
|
|
6346
6501
|
if (!region)
|
|
6347
6502
|
return null;
|
|
6348
6503
|
region.path = path;
|
|
@@ -6354,7 +6509,9 @@ var spine = (() => {
|
|
|
6354
6509
|
region.width = width * scale;
|
|
6355
6510
|
region.height = height * scale;
|
|
6356
6511
|
Color.rgba8888ToColor(region.color, color);
|
|
6357
|
-
region.
|
|
6512
|
+
region.sequence = sequence;
|
|
6513
|
+
if (sequence == null)
|
|
6514
|
+
region.updateRegion();
|
|
6358
6515
|
return region;
|
|
6359
6516
|
}
|
|
6360
6517
|
case AttachmentType.BoundingBox: {
|
|
@@ -6379,6 +6536,7 @@ var spine = (() => {
|
|
|
6379
6536
|
let triangles = this.readShortArray(input);
|
|
6380
6537
|
let vertices = this.readVertices(input, vertexCount);
|
|
6381
6538
|
let hullLength = input.readInt(true);
|
|
6539
|
+
let sequence = this.readSequence(input);
|
|
6382
6540
|
let edges = null;
|
|
6383
6541
|
let width = 0, height = 0;
|
|
6384
6542
|
if (nonessential) {
|
|
@@ -6388,7 +6546,7 @@ var spine = (() => {
|
|
|
6388
6546
|
}
|
|
6389
6547
|
if (!path)
|
|
6390
6548
|
path = name;
|
|
6391
|
-
let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);
|
|
6549
|
+
let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);
|
|
6392
6550
|
if (!mesh)
|
|
6393
6551
|
return null;
|
|
6394
6552
|
mesh.path = path;
|
|
@@ -6398,8 +6556,10 @@ var spine = (() => {
|
|
|
6398
6556
|
mesh.worldVerticesLength = vertexCount << 1;
|
|
6399
6557
|
mesh.triangles = triangles;
|
|
6400
6558
|
mesh.regionUVs = uvs;
|
|
6401
|
-
|
|
6559
|
+
if (sequence == null)
|
|
6560
|
+
mesh.updateRegion();
|
|
6402
6561
|
mesh.hullLength = hullLength << 1;
|
|
6562
|
+
mesh.sequence = sequence;
|
|
6403
6563
|
if (nonessential) {
|
|
6404
6564
|
mesh.edges = edges;
|
|
6405
6565
|
mesh.width = width * scale;
|
|
@@ -6412,7 +6572,8 @@ var spine = (() => {
|
|
|
6412
6572
|
let color = input.readInt32();
|
|
6413
6573
|
let skinName = input.readStringRef();
|
|
6414
6574
|
let parent = input.readStringRef();
|
|
6415
|
-
let
|
|
6575
|
+
let inheritTimelines = input.readBoolean();
|
|
6576
|
+
let sequence = this.readSequence(input);
|
|
6416
6577
|
let width = 0, height = 0;
|
|
6417
6578
|
if (nonessential) {
|
|
6418
6579
|
width = input.readFloat();
|
|
@@ -6420,16 +6581,17 @@ var spine = (() => {
|
|
|
6420
6581
|
}
|
|
6421
6582
|
if (!path)
|
|
6422
6583
|
path = name;
|
|
6423
|
-
let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);
|
|
6584
|
+
let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);
|
|
6424
6585
|
if (!mesh)
|
|
6425
6586
|
return null;
|
|
6426
6587
|
mesh.path = path;
|
|
6427
6588
|
Color.rgba8888ToColor(mesh.color, color);
|
|
6589
|
+
mesh.sequence = sequence;
|
|
6428
6590
|
if (nonessential) {
|
|
6429
6591
|
mesh.width = width * scale;
|
|
6430
6592
|
mesh.height = height * scale;
|
|
6431
6593
|
}
|
|
6432
|
-
this.linkedMeshes.push(new LinkedMesh(mesh, skinName, slotIndex, parent,
|
|
6594
|
+
this.linkedMeshes.push(new LinkedMesh(mesh, skinName, slotIndex, parent, inheritTimelines));
|
|
6433
6595
|
return mesh;
|
|
6434
6596
|
}
|
|
6435
6597
|
case AttachmentType.Path: {
|
|
@@ -6488,6 +6650,15 @@ var spine = (() => {
|
|
|
6488
6650
|
}
|
|
6489
6651
|
return null;
|
|
6490
6652
|
}
|
|
6653
|
+
readSequence(input) {
|
|
6654
|
+
if (!input.readBoolean())
|
|
6655
|
+
return null;
|
|
6656
|
+
let sequence = new Sequence(input.readInt(true));
|
|
6657
|
+
sequence.start = input.readInt(true);
|
|
6658
|
+
sequence.digits = input.readInt(true);
|
|
6659
|
+
sequence.setupIndex = input.readInt(true);
|
|
6660
|
+
return sequence;
|
|
6661
|
+
}
|
|
6491
6662
|
readVertices(input, vertexCount) {
|
|
6492
6663
|
let scale = this.scale;
|
|
6493
6664
|
let verticesLength = vertexCount << 1;
|
|
@@ -6730,7 +6901,6 @@ var spine = (() => {
|
|
|
6730
6901
|
a = a2;
|
|
6731
6902
|
}
|
|
6732
6903
|
timelines.push(timeline);
|
|
6733
|
-
break;
|
|
6734
6904
|
}
|
|
6735
6905
|
}
|
|
6736
6906
|
}
|
|
@@ -6870,49 +7040,66 @@ var spine = (() => {
|
|
|
6870
7040
|
for (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {
|
|
6871
7041
|
let attachmentName = input.readStringRef();
|
|
6872
7042
|
let attachment = skin.getAttachment(slotIndex, attachmentName);
|
|
6873
|
-
let
|
|
6874
|
-
let vertices = attachment.vertices;
|
|
6875
|
-
let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;
|
|
7043
|
+
let timelineType = input.readByte();
|
|
6876
7044
|
let frameCount = input.readInt(true);
|
|
6877
7045
|
let frameLast = frameCount - 1;
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
7046
|
+
switch (timelineType) {
|
|
7047
|
+
case ATTACHMENT_DEFORM: {
|
|
7048
|
+
let vertexAttachment = attachment;
|
|
7049
|
+
let weighted = vertexAttachment.bones;
|
|
7050
|
+
let vertices = vertexAttachment.vertices;
|
|
7051
|
+
let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;
|
|
7052
|
+
let bezierCount = input.readInt(true);
|
|
7053
|
+
let timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);
|
|
7054
|
+
let time = input.readFloat();
|
|
7055
|
+
for (let frame = 0, bezier = 0; ; frame++) {
|
|
7056
|
+
let deform;
|
|
7057
|
+
let end = input.readInt(true);
|
|
7058
|
+
if (end == 0)
|
|
7059
|
+
deform = weighted ? Utils.newFloatArray(deformLength) : vertices;
|
|
7060
|
+
else {
|
|
7061
|
+
deform = Utils.newFloatArray(deformLength);
|
|
7062
|
+
let start = input.readInt(true);
|
|
7063
|
+
end += start;
|
|
7064
|
+
if (scale == 1) {
|
|
7065
|
+
for (let v = start; v < end; v++)
|
|
7066
|
+
deform[v] = input.readFloat();
|
|
7067
|
+
} else {
|
|
7068
|
+
for (let v = start; v < end; v++)
|
|
7069
|
+
deform[v] = input.readFloat() * scale;
|
|
7070
|
+
}
|
|
7071
|
+
if (!weighted) {
|
|
7072
|
+
for (let v = 0, vn = deform.length; v < vn; v++)
|
|
7073
|
+
deform[v] += vertices[v];
|
|
7074
|
+
}
|
|
7075
|
+
}
|
|
7076
|
+
timeline.setFrame(frame, time, deform);
|
|
7077
|
+
if (frame == frameLast)
|
|
7078
|
+
break;
|
|
7079
|
+
let time2 = input.readFloat();
|
|
7080
|
+
switch (input.readByte()) {
|
|
7081
|
+
case CURVE_STEPPED:
|
|
7082
|
+
timeline.setStepped(frame);
|
|
7083
|
+
break;
|
|
7084
|
+
case CURVE_BEZIER:
|
|
7085
|
+
setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);
|
|
7086
|
+
}
|
|
7087
|
+
time = time2;
|
|
6900
7088
|
}
|
|
7089
|
+
timelines.push(timeline);
|
|
7090
|
+
break;
|
|
6901
7091
|
}
|
|
6902
|
-
|
|
6903
|
-
|
|
7092
|
+
case ATTACHMENT_SEQUENCE: {
|
|
7093
|
+
let timeline = new SequenceTimeline(frameCount, slotIndex, attachment);
|
|
7094
|
+
for (let frame = 0; frame < frameCount; frame++) {
|
|
7095
|
+
let time = input.readFloat();
|
|
7096
|
+
let modeAndIndex = input.readInt32();
|
|
7097
|
+
timeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 15], modeAndIndex >> 4, input.readFloat());
|
|
7098
|
+
}
|
|
7099
|
+
timelines.push(timeline);
|
|
6904
7100
|
break;
|
|
6905
|
-
let time2 = input.readFloat();
|
|
6906
|
-
switch (input.readByte()) {
|
|
6907
|
-
case CURVE_STEPPED:
|
|
6908
|
-
timeline.setStepped(frame);
|
|
6909
|
-
break;
|
|
6910
|
-
case CURVE_BEZIER:
|
|
6911
|
-
setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);
|
|
6912
7101
|
}
|
|
6913
|
-
time = time2;
|
|
6914
7102
|
}
|
|
6915
|
-
timelines.push(timeline);
|
|
6916
7103
|
}
|
|
6917
7104
|
}
|
|
6918
7105
|
}
|
|
@@ -7059,7 +7246,7 @@ var spine = (() => {
|
|
|
7059
7246
|
this.skin = skin;
|
|
7060
7247
|
this.slotIndex = slotIndex;
|
|
7061
7248
|
this.parent = parent;
|
|
7062
|
-
this.
|
|
7249
|
+
this.inheritTimeline = inheritDeform;
|
|
7063
7250
|
}
|
|
7064
7251
|
};
|
|
7065
7252
|
var Vertices = class {
|
|
@@ -7137,6 +7324,8 @@ var spine = (() => {
|
|
|
7137
7324
|
var SLOT_RGBA2 = 3;
|
|
7138
7325
|
var SLOT_RGB2 = 4;
|
|
7139
7326
|
var SLOT_ALPHA = 5;
|
|
7327
|
+
var ATTACHMENT_DEFORM = 0;
|
|
7328
|
+
var ATTACHMENT_SEQUENCE = 1;
|
|
7140
7329
|
var PATH_POSITION = 0;
|
|
7141
7330
|
var PATH_SPACING = 1;
|
|
7142
7331
|
var PATH_MIX = 2;
|
|
@@ -7972,9 +8161,10 @@ var spine = (() => {
|
|
|
7972
8161
|
let linkedMesh = this.linkedMeshes[i];
|
|
7973
8162
|
let skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);
|
|
7974
8163
|
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
|
|
7975
|
-
linkedMesh.mesh.
|
|
8164
|
+
linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
|
|
7976
8165
|
linkedMesh.mesh.setParentMesh(parent);
|
|
7977
|
-
linkedMesh.mesh.
|
|
8166
|
+
if (linkedMesh.mesh.region != null)
|
|
8167
|
+
linkedMesh.mesh.updateRegion();
|
|
7978
8168
|
}
|
|
7979
8169
|
this.linkedMeshes.length = 0;
|
|
7980
8170
|
if (root.events) {
|
|
@@ -8006,7 +8196,8 @@ var spine = (() => {
|
|
|
8006
8196
|
switch (getValue(map, "type", "region")) {
|
|
8007
8197
|
case "region": {
|
|
8008
8198
|
let path = getValue(map, "path", name);
|
|
8009
|
-
let
|
|
8199
|
+
let sequence = this.readSequence(getValue(map, "sequence", null));
|
|
8200
|
+
let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);
|
|
8010
8201
|
if (!region)
|
|
8011
8202
|
return null;
|
|
8012
8203
|
region.path = path;
|
|
@@ -8017,10 +8208,12 @@ var spine = (() => {
|
|
|
8017
8208
|
region.rotation = getValue(map, "rotation", 0);
|
|
8018
8209
|
region.width = map.width * scale;
|
|
8019
8210
|
region.height = map.height * scale;
|
|
8211
|
+
region.sequence = sequence;
|
|
8020
8212
|
let color = getValue(map, "color", null);
|
|
8021
8213
|
if (color)
|
|
8022
8214
|
region.color.setFromString(color);
|
|
8023
|
-
region.
|
|
8215
|
+
if (region.region != null)
|
|
8216
|
+
region.updateRegion();
|
|
8024
8217
|
return region;
|
|
8025
8218
|
}
|
|
8026
8219
|
case "boundingbox": {
|
|
@@ -8036,7 +8229,8 @@ var spine = (() => {
|
|
|
8036
8229
|
case "mesh":
|
|
8037
8230
|
case "linkedmesh": {
|
|
8038
8231
|
let path = getValue(map, "path", name);
|
|
8039
|
-
let
|
|
8232
|
+
let sequence = this.readSequence(getValue(map, "sequence", null));
|
|
8233
|
+
let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);
|
|
8040
8234
|
if (!mesh)
|
|
8041
8235
|
return null;
|
|
8042
8236
|
mesh.path = path;
|
|
@@ -8045,16 +8239,18 @@ var spine = (() => {
|
|
|
8045
8239
|
mesh.color.setFromString(color);
|
|
8046
8240
|
mesh.width = getValue(map, "width", 0) * scale;
|
|
8047
8241
|
mesh.height = getValue(map, "height", 0) * scale;
|
|
8242
|
+
mesh.sequence = sequence;
|
|
8048
8243
|
let parent = getValue(map, "parent", null);
|
|
8049
8244
|
if (parent) {
|
|
8050
|
-
this.linkedMeshes.push(new LinkedMesh2(mesh, getValue(map, "skin", null), slotIndex, parent, getValue(map, "
|
|
8245
|
+
this.linkedMeshes.push(new LinkedMesh2(mesh, getValue(map, "skin", null), slotIndex, parent, getValue(map, "timelines", true)));
|
|
8051
8246
|
return mesh;
|
|
8052
8247
|
}
|
|
8053
8248
|
let uvs = map.uvs;
|
|
8054
8249
|
this.readVertices(map, mesh, uvs.length);
|
|
8055
8250
|
mesh.triangles = map.triangles;
|
|
8056
8251
|
mesh.regionUVs = uvs;
|
|
8057
|
-
mesh.
|
|
8252
|
+
if (mesh.region != null)
|
|
8253
|
+
mesh.updateRegion();
|
|
8058
8254
|
mesh.edges = getValue(map, "edges", null);
|
|
8059
8255
|
mesh.hullLength = getValue(map, "hull", 0) * 2;
|
|
8060
8256
|
return mesh;
|
|
@@ -8105,6 +8301,15 @@ var spine = (() => {
|
|
|
8105
8301
|
}
|
|
8106
8302
|
return null;
|
|
8107
8303
|
}
|
|
8304
|
+
readSequence(map) {
|
|
8305
|
+
if (map == null)
|
|
8306
|
+
return null;
|
|
8307
|
+
let sequence = new Sequence(getValue(map, "count", 0));
|
|
8308
|
+
sequence.start = getValue(map, "start", 1);
|
|
8309
|
+
sequence.digits = getValue(map, "digits", 0);
|
|
8310
|
+
sequence.setupIndex = getValue(map, "setup", 0);
|
|
8311
|
+
return sequence;
|
|
8312
|
+
}
|
|
8108
8313
|
readVertices(map, attachment, verticesLength) {
|
|
8109
8314
|
let scale = this.scale;
|
|
8110
8315
|
attachment.worldVerticesLength = verticesLength;
|
|
@@ -8149,7 +8354,7 @@ var spine = (() => {
|
|
|
8149
8354
|
let timeline = new AttachmentTimeline(frames, slotIndex);
|
|
8150
8355
|
for (let frame = 0; frame < frames; frame++) {
|
|
8151
8356
|
let keyMap = timelineMap[frame];
|
|
8152
|
-
timeline.setFrame(frame, getValue(keyMap, "time", 0), keyMap
|
|
8357
|
+
timeline.setFrame(frame, getValue(keyMap, "time", 0), getValue(keyMap, "name", null));
|
|
8153
8358
|
}
|
|
8154
8359
|
timelines.push(timeline);
|
|
8155
8360
|
} else if (timelineName == "rgba") {
|
|
@@ -8451,56 +8656,74 @@ var spine = (() => {
|
|
|
8451
8656
|
}
|
|
8452
8657
|
}
|
|
8453
8658
|
}
|
|
8454
|
-
if (map.
|
|
8455
|
-
for (let
|
|
8456
|
-
let
|
|
8457
|
-
let skin = skeletonData.findSkin(
|
|
8458
|
-
for (let
|
|
8459
|
-
let slotMap =
|
|
8460
|
-
let slotIndex = skeletonData.findSlot(
|
|
8461
|
-
for (let
|
|
8462
|
-
let
|
|
8463
|
-
let
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
deform
|
|
8659
|
+
if (map.attachments) {
|
|
8660
|
+
for (let attachmentsName in map.attachments) {
|
|
8661
|
+
let attachmentsMap = map.attachments[attachmentsName];
|
|
8662
|
+
let skin = skeletonData.findSkin(attachmentsName);
|
|
8663
|
+
for (let slotMapName in attachmentsMap) {
|
|
8664
|
+
let slotMap = attachmentsMap[slotMapName];
|
|
8665
|
+
let slotIndex = skeletonData.findSlot(slotMapName).index;
|
|
8666
|
+
for (let attachmentMapName in slotMap) {
|
|
8667
|
+
let attachmentMap = slotMap[attachmentMapName];
|
|
8668
|
+
let attachment = skin.getAttachment(slotIndex, attachmentMapName);
|
|
8669
|
+
for (let timelineMapName in attachmentMap) {
|
|
8670
|
+
let timelineMap = attachmentMap[timelineMapName];
|
|
8671
|
+
let keyMap = timelineMap[0];
|
|
8672
|
+
if (!keyMap)
|
|
8673
|
+
continue;
|
|
8674
|
+
if (timelineMapName == "deform") {
|
|
8675
|
+
let weighted = attachment.bones;
|
|
8676
|
+
let vertices = attachment.vertices;
|
|
8677
|
+
let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;
|
|
8678
|
+
let timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);
|
|
8679
|
+
let time = getValue(keyMap, "time", 0);
|
|
8680
|
+
for (let frame = 0, bezier = 0; ; frame++) {
|
|
8681
|
+
let deform;
|
|
8682
|
+
let verticesValue = getValue(keyMap, "vertices", null);
|
|
8683
|
+
if (!verticesValue)
|
|
8684
|
+
deform = weighted ? Utils.newFloatArray(deformLength) : vertices;
|
|
8685
|
+
else {
|
|
8686
|
+
deform = Utils.newFloatArray(deformLength);
|
|
8687
|
+
let start = getValue(keyMap, "offset", 0);
|
|
8688
|
+
Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);
|
|
8689
|
+
if (scale != 1) {
|
|
8690
|
+
for (let i = start, n = i + verticesValue.length; i < n; i++)
|
|
8691
|
+
deform[i] *= scale;
|
|
8692
|
+
}
|
|
8693
|
+
if (!weighted) {
|
|
8694
|
+
for (let i = 0; i < deformLength; i++)
|
|
8695
|
+
deform[i] += vertices[i];
|
|
8696
|
+
}
|
|
8697
|
+
}
|
|
8698
|
+
timeline.setFrame(frame, time, deform);
|
|
8699
|
+
let nextMap = timelineMap[frame + 1];
|
|
8700
|
+
if (!nextMap) {
|
|
8701
|
+
timeline.shrink(bezier);
|
|
8702
|
+
break;
|
|
8703
|
+
}
|
|
8704
|
+
let time2 = getValue(nextMap, "time", 0);
|
|
8705
|
+
let curve = keyMap.curve;
|
|
8706
|
+
if (curve)
|
|
8707
|
+
bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);
|
|
8708
|
+
time = time2;
|
|
8709
|
+
keyMap = nextMap;
|
|
8484
8710
|
}
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8711
|
+
timelines.push(timeline);
|
|
8712
|
+
} else if (timelineMapName == "sequence") {
|
|
8713
|
+
let timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment);
|
|
8714
|
+
let lastDelay = 0;
|
|
8715
|
+
for (let frame = 0; frame < timelineMap.length; frame++) {
|
|
8716
|
+
let delay = getValue(keyMap, "delay", lastDelay);
|
|
8717
|
+
let time = getValue(keyMap, "time", 0);
|
|
8718
|
+
let mode = SequenceMode[getValue(keyMap, "mode", "hold")];
|
|
8719
|
+
let index = getValue(keyMap, "index", 0);
|
|
8720
|
+
timeline.setFrame(frame, time, mode, index, delay);
|
|
8721
|
+
lastDelay = delay;
|
|
8722
|
+
keyMap = timelineMap[frame + 1];
|
|
8488
8723
|
}
|
|
8724
|
+
timelines.push(timeline);
|
|
8489
8725
|
}
|
|
8490
|
-
timeline.setFrame(frame, time, deform);
|
|
8491
|
-
let nextMap = timelineMap[frame + 1];
|
|
8492
|
-
if (!nextMap) {
|
|
8493
|
-
timeline.shrink(bezier);
|
|
8494
|
-
break;
|
|
8495
|
-
}
|
|
8496
|
-
let time2 = getValue(nextMap, "time", 0);
|
|
8497
|
-
let curve = keyMap.curve;
|
|
8498
|
-
if (curve)
|
|
8499
|
-
bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);
|
|
8500
|
-
time = time2;
|
|
8501
|
-
keyMap = nextMap;
|
|
8502
8726
|
}
|
|
8503
|
-
timelines.push(timeline);
|
|
8504
8727
|
}
|
|
8505
8728
|
}
|
|
8506
8729
|
}
|
|
@@ -8564,7 +8787,7 @@ var spine = (() => {
|
|
|
8564
8787
|
this.skin = skin;
|
|
8565
8788
|
this.slotIndex = slotIndex;
|
|
8566
8789
|
this.parent = parent;
|
|
8567
|
-
this.
|
|
8790
|
+
this.inheritTimeline = inheritDeform;
|
|
8568
8791
|
}
|
|
8569
8792
|
};
|
|
8570
8793
|
function readTimeline12(keys, timeline, defaultValue, scale) {
|
|
@@ -9972,6 +10195,8 @@ var spine = (() => {
|
|
|
9972
10195
|
gl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);
|
|
9973
10196
|
}
|
|
9974
10197
|
setBlendMode(srcColorBlend, srcAlphaBlend, dstBlend) {
|
|
10198
|
+
if (this.srcColorBlend == srcColorBlend && this.srcAlphaBlend == srcAlphaBlend && this.dstBlend == dstBlend)
|
|
10199
|
+
return;
|
|
9975
10200
|
this.srcColorBlend = srcColorBlend;
|
|
9976
10201
|
this.srcAlphaBlend = srcAlphaBlend;
|
|
9977
10202
|
this.dstBlend = dstBlend;
|
|
@@ -10369,9 +10594,9 @@ var spine = (() => {
|
|
|
10369
10594
|
continue;
|
|
10370
10595
|
if (!bone.parent)
|
|
10371
10596
|
continue;
|
|
10372
|
-
let x =
|
|
10373
|
-
let y =
|
|
10374
|
-
shapes.rectLine(true,
|
|
10597
|
+
let x = bone.data.length * bone.a + bone.worldX;
|
|
10598
|
+
let y = bone.data.length * bone.c + bone.worldY;
|
|
10599
|
+
shapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale);
|
|
10375
10600
|
}
|
|
10376
10601
|
if (this.drawSkeletonXY)
|
|
10377
10602
|
shapes.x(skeletonX, skeletonY, 4 * this.scale);
|
|
@@ -10385,7 +10610,7 @@ var spine = (() => {
|
|
|
10385
10610
|
if (attachment instanceof RegionAttachment) {
|
|
10386
10611
|
let regionAttachment = attachment;
|
|
10387
10612
|
let vertices = this.vertices;
|
|
10388
|
-
regionAttachment.computeWorldVertices(slot
|
|
10613
|
+
regionAttachment.computeWorldVertices(slot, vertices, 0, 2);
|
|
10389
10614
|
shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);
|
|
10390
10615
|
shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);
|
|
10391
10616
|
shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);
|
|
@@ -10486,7 +10711,7 @@ var spine = (() => {
|
|
|
10486
10711
|
let bone = bones[i];
|
|
10487
10712
|
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)
|
|
10488
10713
|
continue;
|
|
10489
|
-
shapes.circle(true,
|
|
10714
|
+
shapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, _SkeletonDebugRenderer.GREEN, 8);
|
|
10490
10715
|
}
|
|
10491
10716
|
}
|
|
10492
10717
|
if (this.drawClipping) {
|
|
@@ -10590,7 +10815,7 @@ var spine = (() => {
|
|
|
10590
10815
|
renderable.vertices = this.vertices;
|
|
10591
10816
|
renderable.numVertices = 4;
|
|
10592
10817
|
renderable.numFloats = clippedVertexSize << 2;
|
|
10593
|
-
region.computeWorldVertices(slot
|
|
10818
|
+
region.computeWorldVertices(slot, renderable.vertices, 0, clippedVertexSize);
|
|
10594
10819
|
triangles = _SkeletonRenderer.QUAD_TRIANGLES;
|
|
10595
10820
|
uvs = region.uvs;
|
|
10596
10821
|
texture = region.region.renderObject.page.texture;
|