Added vertex attachment IDs for DeformTimeline.

This commit is contained in:
NathanSweet 2017-06-10 18:21:15 +02:00
parent 464e9b3362
commit 45870ef028
2 changed files with 9 additions and 1 deletions

View File

@ -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) {

View File

@ -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;
}
}