Browse Source

Added vertex attachment IDs for DeformTimeline.

NathanSweet 8 years ago
parent
commit
45870ef028

+ 1 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java

@@ -814,7 +814,7 @@ public class Animation {
 		}
 		}
 
 
 		public int getPropertyId () {
 		public int getPropertyId () {
-			return (TimelineType.deform.ordinal() << 24) + slotIndex;
+			return (TimelineType.deform.ordinal() << 27) + ((slotIndex & 2047) << 16) + attachment.getId();
 		}
 		}
 
 
 		public void setSlotIndex (int index) {
 		public void setSlotIndex (int index) {

+ 8 - 0
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
 /** 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()}. */
  * {@link Slot#getAttachmentVertices()}. */
 public class VertexAttachment extends Attachment {
 public class VertexAttachment extends Attachment {
+	static private int nextID;
+
+	private int id = nextID++ & 65535;
 	int[] bones;
 	int[] bones;
 	float[] vertices;
 	float[] vertices;
 	int worldVerticesLength;
 	int worldVerticesLength;
@@ -152,4 +155,9 @@ public class VertexAttachment extends Attachment {
 	public void setWorldVerticesLength (int worldVerticesLength) {
 	public void setWorldVerticesLength (int worldVerticesLength) {
 		this.worldVerticesLength = worldVerticesLength;
 		this.worldVerticesLength = worldVerticesLength;
 	}
 	}
+
+	/** Returns a unique ID for this attachment. */
+	public int getId () {
+		return id;
+	}
 }
 }