[libgdx] Use binarySearch method without step param.

This commit is contained in:
NathanSweet 2016-12-07 23:50:33 +01:00
parent 86cfefe30d
commit 2677eff35c
2 changed files with 5 additions and 2 deletions

View File

@ -690,7 +690,7 @@ public class Animation {
if (time >= frames[frames.length - 1]) // Time is after last frame.
frameIndex = frames.length - 1;
else
frameIndex = binarySearch(frames, time, 1) - 1;
frameIndex = binarySearch(frames, time) - 1;
String attachmentName = attachmentNames[frameIndex];
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName));

View File

@ -827,7 +827,10 @@ public class AnimationState {
this.timeScale = timeScale;
}
/** The listener for events generated by this track entry, or null. */
/** The listener for events generated by this track entry, or null.
* <p>
* A track entry returned from {@link AnimationState#setAnimation(int, Animation, boolean)} is already the current animation
* for the track, so the track entry listener {@link AnimationStateListener#start(TrackEntry)} will not be called. */
public AnimationStateListener getListener () {
return listener;
}