diff --git a/spine-haxe/spine-haxe/spine/SkeletonBinary.hx b/spine-haxe/spine-haxe/spine/SkeletonBinary.hx index ef47b15a6..ac8f142f1 100644 --- a/spine-haxe/spine-haxe/spine/SkeletonBinary.hx +++ b/spine-haxe/spine-haxe/spine/SkeletonBinary.hx @@ -1005,7 +1005,7 @@ class SkeletonBinary { slotIndex = input.readInt(true); for (iii in 0...input.readInt(true)) { var attachmentName:String = input.readStringRef(); - var attachment:VertexAttachment = cast(skin.getAttachment(slotIndex, attachmentName), VertexAttachment); + var attachment = skin.getAttachment(slotIndex, attachmentName); if (attachment == null) throw new SpineException("Vertex attachment not found: " + attachmentName); var timelineType = input.readByte(); @@ -1014,12 +1014,13 @@ class SkeletonBinary { switch (timelineType) { case ATTACHMENT_DEFORM: - var weighted:Bool = attachment.bones != null; - var vertices:Vector = attachment.vertices; + var vertexAttachment = cast(attachment, VertexAttachment); + var weighted:Bool = vertexAttachment.bones != null; + var vertices:Vector = vertexAttachment.vertices; var deformLength:Int = weighted ? Std.int(vertices.length / 3 * 2) : vertices.length; bezierCount = input.readInt(true); - var deformTimeline:DeformTimeline = new DeformTimeline(frameCount, bezierCount, slotIndex, attachment); + var deformTimeline:DeformTimeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment); time = input.readFloat(); frame = 0; diff --git a/spine-haxe/spine-haxe/spine/attachments/RegionAttachment.hx b/spine-haxe/spine-haxe/spine/attachments/RegionAttachment.hx index f3b4ff6a1..1c26299a1 100644 --- a/spine-haxe/spine-haxe/spine/attachments/RegionAttachment.hx +++ b/spine-haxe/spine-haxe/spine/attachments/RegionAttachment.hx @@ -99,28 +99,6 @@ class RegionAttachment extends Attachment implements HasTextureRegion { } } - public function setUVs(u:Float, v:Float, u2:Float, v2:Float, degrees:Int):Void { - if (degrees == 90) { - uvs[4] = u; - uvs[5] = v2; - uvs[6] = u; - uvs[7] = v; - uvs[0] = u2; - uvs[1] = v; - uvs[2] = u2; - uvs[3] = v2; - } else { - uvs[2] = u; - uvs[3] = v2; - uvs[4] = u; - uvs[5] = v; - uvs[6] = u2; - uvs[7] = v; - uvs[0] = u2; - uvs[1] = v2; - } - } - public function computeWorldVertices(slot:Slot, worldVertices:Vector, offset:Int, stride:Int):Void { if (sequence != null) sequence.apply(slot, this); diff --git a/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx b/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx index e95d595d6..f1f34a974 100644 --- a/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx +++ b/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx @@ -91,6 +91,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable { mesh = null; if (Std.isOfType(region.rendererObject, SkeletonMesh)) { mesh = cast(region.rendererObject, SkeletonMesh); + mesh.texture = region.region.texture; indices = QUAD_INDICES; } else { mesh = region.rendererObject = new SkeletonMesh(cast(region.region.texture, Texture)); @@ -118,6 +119,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable { mesh = null; if (Std.isOfType(meshAttachment.rendererObject, SkeletonMesh)) { mesh = cast(meshAttachment.rendererObject, SkeletonMesh); + mesh.texture = meshAttachment.region.texture; indices = meshAttachment.triangles; } else { mesh = meshAttachment.rendererObject = new SkeletonMesh(cast(meshAttachment.region.texture, Texture));