mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +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 {
|
||||
final String name;
|
||||
Array<Timeline> timelines;
|
||||
final ObjectSet<String> timelineIds = new ObjectSet();
|
||||
final ObjectSet<String> timelineIds;
|
||||
float duration;
|
||||
|
||||
public Animation (String name, Array<Timeline> timelines, float duration) {
|
||||
if (name == null) throw new IllegalArgumentException("name cannot be null.");
|
||||
this.name = name;
|
||||
this.duration = duration;
|
||||
timelineIds = new ObjectSet(timelines.size);
|
||||
setTimelines(timelines);
|
||||
}
|
||||
|
||||
@ -65,9 +66,10 @@ public class Animation {
|
||||
if (timelines == null) throw new IllegalArgumentException("timelines cannot be null.");
|
||||
this.timelines = timelines;
|
||||
|
||||
timelineIds.clear();
|
||||
int n = timelines.size;
|
||||
timelineIds.clear(n);
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user