Better resetting of pooled TrackEntrys.

This commit is contained in:
NathanSweet 2013-10-03 20:05:27 +02:00
parent bc259b390e
commit edb50113ea

View File

@ -203,8 +203,6 @@ public class AnimationState {
TrackEntry entry = Pools.obtain(TrackEntry.class); TrackEntry entry = Pools.obtain(TrackEntry.class);
entry.animation = animation; entry.animation = animation;
entry.loop = loop; entry.loop = loop;
entry.time = 0;
entry.lastTime = 0;
entry.endTime = animation.getDuration(); entry.endTime = animation.getDuration();
setCurrent(trackIndex, entry); setCurrent(trackIndex, entry);
return entry; return entry;
@ -223,8 +221,6 @@ public class AnimationState {
TrackEntry entry = Pools.obtain(TrackEntry.class); TrackEntry entry = Pools.obtain(TrackEntry.class);
entry.animation = animation; entry.animation = animation;
entry.loop = loop; entry.loop = loop;
entry.time = 0;
entry.lastTime = 0;
entry.endTime = animation.getDuration(); entry.endTime = animation.getDuration();
TrackEntry last = expandToIndex(trackIndex); TrackEntry last = expandToIndex(trackIndex);
@ -296,10 +292,13 @@ public class AnimationState {
AnimationStateListener listener; AnimationStateListener listener;
public void reset () { public void reset () {
next = null;
previous = null;
animation = null; animation = null;
listener = null; listener = null;
next = null;
timeScale = 1; timeScale = 1;
lastTime = 0;
time = 0;
} }
public Animation getAnimation () { public Animation getAnimation () {