git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1704 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-09-17 21:58:25 +00:00
parent 2d93950835
commit 6a64d45eed
@@ -1,5 +1,5 @@
// //
// $Id: FrameSequencer.java,v 1.1 2002/09/17 20:07:28 mdb Exp $ // $Id: FrameSequencer.java,v 1.2 2002/09/17 21:58:25 ray Exp $
package com.threerings.media.util; package com.threerings.media.util;
@@ -55,7 +55,7 @@ public interface FrameSequencer
*/ */
public ConstantRate (double framesPerSecond, boolean loop) public ConstantRate (double framesPerSecond, boolean loop)
{ {
_millisPerFrame = (long)(1000d / _millisPerFrame); _millisPerFrame = (long)(1000d / framesPerSecond);
_loop = loop; _loop = loop;
} }
@@ -79,7 +79,8 @@ public interface FrameSequencer
// if we're not looping and we've exhausted our frames, we // if we're not looping and we've exhausted our frames, we
// return -1 to indicate that the animation should stop // return -1 to indicate that the animation should stop
return (!_loop && frameIdx >= _frameCount) ? -1 : frameIdx; return (_loop || frameIdx < _frameCount) ? (frameIdx % _frameCount)
: -1;
} }
// documentation inherited from interface // documentation inherited from interface