@esotericsoftware/spine-canvaskit 4.2.53 → 4.2.55
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.
|
@@ -11760,7 +11760,7 @@ var spine = (() => {
|
|
|
11760
11760
|
case 1 /* Additive */:
|
|
11761
11761
|
return ck.BlendMode.Plus;
|
|
11762
11762
|
case 2 /* Multiply */:
|
|
11763
|
-
return ck.BlendMode.
|
|
11763
|
+
return ck.BlendMode.SrcOver;
|
|
11764
11764
|
case 3 /* Screen */:
|
|
11765
11765
|
return ck.BlendMode.Screen;
|
|
11766
11766
|
default:
|
|
@@ -11828,7 +11828,11 @@ var spine = (() => {
|
|
|
11828
11828
|
async function loadSkeletonData(skeletonFile, atlas, readFile) {
|
|
11829
11829
|
const attachmentLoader = new AtlasAttachmentLoader(atlas);
|
|
11830
11830
|
const loader = skeletonFile.endsWith(".json") ? new SkeletonJson(attachmentLoader) : new SkeletonBinary(attachmentLoader);
|
|
11831
|
-
|
|
11831
|
+
let data = await readFile(skeletonFile);
|
|
11832
|
+
if (skeletonFile.endsWith(".json")) {
|
|
11833
|
+
data = bufferToUtf8String(data);
|
|
11834
|
+
}
|
|
11835
|
+
const skeletonData = loader.readSkeletonData(data);
|
|
11832
11836
|
return skeletonData;
|
|
11833
11837
|
}
|
|
11834
11838
|
var SkeletonDrawable = class {
|
|
@@ -11868,6 +11872,7 @@ var spine = (() => {
|
|
|
11868
11872
|
tempColor2 = new Color();
|
|
11869
11873
|
scratchPositions = Utils.newFloatArray(100);
|
|
11870
11874
|
scratchColors = Utils.newFloatArray(100);
|
|
11875
|
+
scratchUVs = Utils.newFloatArray(100);
|
|
11871
11876
|
/**
|
|
11872
11877
|
* Renders a skeleton or skeleton drawable in its current pose to the canvas.
|
|
11873
11878
|
* @param canvas the canvas to render to.
|
|
@@ -11940,7 +11945,7 @@ var spine = (() => {
|
|
|
11940
11945
|
colors[i2 + 2] = finalColor.b;
|
|
11941
11946
|
colors[i2 + 3] = finalColor.a;
|
|
11942
11947
|
}
|
|
11943
|
-
const scaledUvs =
|
|
11948
|
+
const scaledUvs = this.scratchUVs.length < uvs.length ? Utils.newFloatArray(uvs.length) : this.scratchUVs;
|
|
11944
11949
|
const width = texture.getImage().image.width();
|
|
11945
11950
|
const height = texture.getImage().image.height();
|
|
11946
11951
|
for (let i2 = 0; i2 < uvs.length; i2 += 2) {
|
|
@@ -11950,6 +11955,7 @@ var spine = (() => {
|
|
|
11950
11955
|
const blendMode = slot.data.blendMode;
|
|
11951
11956
|
const vertices = this.ck.MakeVertices(this.ck.VertexMode.Triangles, positions, scaledUvs, colors, triangles, false);
|
|
11952
11957
|
canvas.drawVertices(vertices, this.ck.BlendMode.Modulate, texture.getImage().paintPerBlendMode.get(blendMode));
|
|
11958
|
+
vertices.delete();
|
|
11953
11959
|
}
|
|
11954
11960
|
clipper.clipEndWithSlot(slot);
|
|
11955
11961
|
}
|