mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Clear timelines using known size.
This commit is contained in:
parent
ea991a6324
commit
1fbe75cd71
@ -46,13 +46,14 @@ import com.esotericsoftware.spine.attachments.VertexAttachment;
|
|||||||
public class Animation {
|
public class Animation {
|
||||||
final String name;
|
final String name;
|
||||||
Array<Timeline> timelines;
|
Array<Timeline> timelines;
|
||||||
final ObjectSet<String> timelineIds = new ObjectSet();
|
final ObjectSet<String> timelineIds;
|
||||||
float duration;
|
float duration;
|
||||||
|
|
||||||
public Animation (String name, Array<Timeline> timelines, float duration) {
|
public Animation (String name, Array<Timeline> timelines, float duration) {
|
||||||
if (name == null) throw new IllegalArgumentException("name cannot be null.");
|
if (name == null) throw new IllegalArgumentException("name cannot be null.");
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.duration = duration;
|
this.duration = duration;
|
||||||
|
timelineIds = new ObjectSet(timelines.size);
|
||||||
setTimelines(timelines);
|
setTimelines(timelines);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,9 +66,10 @@ public class Animation {
|
|||||||
if (timelines == null) throw new IllegalArgumentException("timelines cannot be null.");
|
if (timelines == null) throw new IllegalArgumentException("timelines cannot be null.");
|
||||||
this.timelines = timelines;
|
this.timelines = timelines;
|
||||||
|
|
||||||
timelineIds.clear();
|
int n = timelines.size;
|
||||||
|
timelineIds.clear(n);
|
||||||
Object[] items = timelines.items;
|
Object[] items = timelines.items;
|
||||||
for (int i = 0, n = timelines.size; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
timelineIds.addAll(((Timeline)items[i]).getPropertyIds());
|
timelineIds.addAll(((Timeline)items[i]).getPropertyIds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user