mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-09 20:26:58 +08:00
Only compute timelinesLast for tracks that need it.
This commit is contained in:
parent
81d7c1daeb
commit
bae19bdf32
@ -461,23 +461,32 @@ public class AnimationState {
|
|||||||
checkTimelineUsage(entry, entry.timelinesFirst);
|
checkTimelineUsage(entry, entry.timelinesFirst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute timelinesLast. Find lowest track with mixing.
|
// Compute timelinesLast. End with lowest track that has mixingFrom.
|
||||||
propertyIDs.clear();
|
propertyIDs.clear();
|
||||||
for (i = n - 1; i >= 0; i--) {
|
int lowestMixingFrom = n;
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
TrackEntry entry = tracks.get(i);
|
TrackEntry entry = tracks.get(i);
|
||||||
if (entry == null) continue;
|
if (entry == null) continue;
|
||||||
if (entry.mixingFrom != null) {
|
if (entry.mixingFrom != null) {
|
||||||
setTimelineUsage(entry, entry.timelinesLast);
|
lowestMixingFrom = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = n - 1; i >= lowestMixingFrom; i--) {
|
||||||
|
TrackEntry entry = tracks.get(i);
|
||||||
|
if (entry == null) continue;
|
||||||
|
if (entry.mixingFrom != null) {
|
||||||
|
addTimelineUsage(entry);
|
||||||
checkTimelineUsage(entry.mixingFrom, entry.mixingFrom.timelinesLast);
|
checkTimelineUsage(entry.mixingFrom, entry.mixingFrom.timelinesLast);
|
||||||
} else
|
} else
|
||||||
setTimelineUsage(entry, entry.timelinesLast);
|
addTimelineUsage(entry);
|
||||||
i--;
|
i--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (; i >= 0; i--) {
|
for (; i >= lowestMixingFrom; i--) {
|
||||||
TrackEntry entry = tracks.get(i);
|
TrackEntry entry = tracks.get(i);
|
||||||
if (entry == null) continue;
|
if (entry == null) continue;
|
||||||
checkTimelineUsage(entry, entry.timelinesLast);
|
addTimelineUsage(entry);
|
||||||
if (entry.mixingFrom != null) checkTimelineUsage(entry.mixingFrom, entry.mixingFrom.timelinesLast);
|
if (entry.mixingFrom != null) checkTimelineUsage(entry.mixingFrom, entry.mixingFrom.timelinesLast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -497,9 +506,16 @@ public class AnimationState {
|
|||||||
IntSet propertyIDs = this.propertyIDs;
|
IntSet propertyIDs = this.propertyIDs;
|
||||||
Array<Timeline> timelines = entry.animation.timelines;
|
Array<Timeline> timelines = entry.animation.timelines;
|
||||||
int n = timelines.size;
|
int n = timelines.size;
|
||||||
boolean[] timelinesFirst = usageArray.setSize(n);
|
boolean[] usage = usageArray.setSize(n);
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
timelinesFirst[i] = propertyIDs.add(timelines.get(i).getPropertyId());
|
usage[i] = propertyIDs.add(timelines.get(i).getPropertyId());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addTimelineUsage (TrackEntry entry) {
|
||||||
|
IntSet propertyIDs = this.propertyIDs;
|
||||||
|
Array<Timeline> timelines = entry.animation.timelines;
|
||||||
|
for (int i = 0, n = timelines.size; i < n; i++)
|
||||||
|
propertyIDs.add(timelines.get(i).getPropertyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the track entry for the animation currently playing on the track, or null. */
|
/** Returns the track entry for the animation currently playing on the track, or null. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user