Skip to content

Commit

Permalink
Better resetting of pooled TrackEntrys.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Oct 3, 2013
1 parent bc259b3 commit edb5011
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ public TrackEntry setAnimation (int trackIndex, Animation animation, boolean loo
TrackEntry entry = Pools.obtain(TrackEntry.class);
entry.animation = animation;
entry.loop = loop;
entry.time = 0;
entry.lastTime = 0;
entry.endTime = animation.getDuration();
setCurrent(trackIndex, entry);
return entry;
Expand All @@ -223,8 +221,6 @@ public TrackEntry addAnimation (int trackIndex, Animation animation, boolean loo
TrackEntry entry = Pools.obtain(TrackEntry.class);
entry.animation = animation;
entry.loop = loop;
entry.time = 0;
entry.lastTime = 0;
entry.endTime = animation.getDuration();

TrackEntry last = expandToIndex(trackIndex);
Expand Down Expand Up @@ -296,10 +292,13 @@ static public class TrackEntry implements Poolable {
AnimationStateListener listener;

public void reset () {
next = null;
previous = null;
animation = null;
listener = null;
next = null;
timeScale = 1;
lastTime = 0;
time = 0;
}

public Animation getAnimation () {
Expand Down

0 comments on commit edb5011

Please sign in to comment.