From 45870ef0280f6e1f702c9b4d87f55a1b2b7e8eff Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sat, 10 Jun 2017 18:21:15 +0200 Subject: [PATCH] Added vertex attachment IDs for DeformTimeline. --- .../src/com/esotericsoftware/spine/Animation.java | 2 +- .../spine/attachments/VertexAttachment.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index 0e50083dd..7a9d4b310 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -814,7 +814,7 @@ public class Animation { } public int getPropertyId () { - return (TimelineType.deform.ordinal() << 24) + slotIndex; + return (TimelineType.deform.ordinal() << 27) + ((slotIndex & 2047) << 16) + attachment.getId(); } public void setSlotIndex (int index) { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java index 924fc9f08..d97fd16fc 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java @@ -38,6 +38,9 @@ import com.esotericsoftware.spine.Slot; /** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's * {@link Slot#getAttachmentVertices()}. */ public class VertexAttachment extends Attachment { + static private int nextID; + + private int id = nextID++ & 65535; int[] bones; float[] vertices; int worldVerticesLength; @@ -152,4 +155,9 @@ public class VertexAttachment extends Attachment { public void setWorldVerticesLength (int worldVerticesLength) { this.worldVerticesLength = worldVerticesLength; } + + /** Returns a unique ID for this attachment. */ + public int getId () { + return id; + } }