mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 06:29:02 +08:00
[libgdx] Draw order folder timeline property ID per slot with "all" special case.
This commit is contained in:
parent
29bf262d0a
commit
7facce33fe
@ -1859,7 +1859,8 @@ public class Animation {
|
||||
|
||||
/** Changes a skeleton's {@link Skeleton#getDrawOrder()}. */
|
||||
static public class DrawOrderTimeline extends Timeline {
|
||||
static private final String[] propertyIds = {Integer.toString(Property.drawOrder.ordinal())};
|
||||
static final String propertyID = Integer.toString(Property.drawOrder.ordinal());
|
||||
static private final String[] propertyIds = {propertyID};
|
||||
|
||||
private final int[][] drawOrders;
|
||||
|
||||
@ -1921,7 +1922,7 @@ public class Animation {
|
||||
/** @param slots {@link Skeleton#getSlots()} indices controlled by this timeline, in setup order.
|
||||
* @param slotCount The maximum number of slots in the skeleton. */
|
||||
public DrawOrderFolderTimeline (int frameCount, int[] slots, int slotCount) {
|
||||
super(frameCount, DrawOrderTimeline.propertyIds);
|
||||
super(frameCount, propertyIds(slots));
|
||||
this.slots = slots;
|
||||
drawOrders = new int[frameCount][];
|
||||
inFolder = new boolean[slotCount];
|
||||
@ -1929,6 +1930,14 @@ public class Animation {
|
||||
inFolder[i] = true;
|
||||
}
|
||||
|
||||
static private String[] propertyIds (int[] slots) {
|
||||
int n = slots.length;
|
||||
String[] ids = new String[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
ids[i] = "d" + slots[i];
|
||||
return ids;
|
||||
}
|
||||
|
||||
public int getFrameCount () {
|
||||
return frames.length;
|
||||
}
|
||||
|
||||
@ -795,8 +795,12 @@ public class AnimationState {
|
||||
ObjectSet<String> propertyIds = this.propertyIds;
|
||||
|
||||
if (to != null && to.holdPrevious) {
|
||||
for (int i = 0; i < timelinesCount; i++)
|
||||
timelineMode[i] = propertyIds.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;
|
||||
for (int i = 0; i < timelinesCount; i++) {
|
||||
boolean first = propertyIds.addAll(timelines[i].getPropertyIds());
|
||||
if (first && timelines[i] instanceof DrawOrderFolderTimeline && propertyIds.contains(DrawOrderTimeline.propertyID))
|
||||
first = false; // DrawOrderTimeline changed.
|
||||
timelineMode[i] = first ? HOLD_FIRST : HOLD_SUBSEQUENT;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -806,6 +810,8 @@ public class AnimationState {
|
||||
String[] ids = timeline.getPropertyIds();
|
||||
if (!propertyIds.addAll(ids))
|
||||
timelineMode[i] = SUBSEQUENT;
|
||||
else if (timeline instanceof DrawOrderFolderTimeline && propertyIds.contains(DrawOrderTimeline.propertyID))
|
||||
timelineMode[i] = SUBSEQUENT; // DrawOrderTimeline changed.
|
||||
else if (to == null || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline
|
||||
|| timeline instanceof DrawOrderFolderTimeline || timeline instanceof EventTimeline
|
||||
|| !to.animation.hasTimeline(ids)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user