Notify sprites when a new path is begun. Made time-based animation
work. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@445 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Sprite.java,v 1.23 2001/09/17 23:55:45 shaper Exp $
|
||||
// $Id: Sprite.java,v 1.24 2001/10/12 00:36:03 shaper Exp $
|
||||
|
||||
package com.threerings.media.sprite;
|
||||
|
||||
@@ -327,6 +327,14 @@ public class Sprite
|
||||
_path = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the active path when it begins.
|
||||
*/
|
||||
protected void pathBeginning ()
|
||||
{
|
||||
// nothing for now
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the active path when it has completed.
|
||||
*/
|
||||
@@ -377,7 +385,6 @@ public class Sprite
|
||||
public void tick (long timestamp)
|
||||
{
|
||||
int fcount = _frames.getFrameCount();
|
||||
int nfidx = _frameIdx;
|
||||
boolean moved = false;
|
||||
|
||||
// move the sprite along toward its destination, if any
|
||||
@@ -386,13 +393,14 @@ public class Sprite
|
||||
}
|
||||
|
||||
// increment the display image if performing image animation
|
||||
int nfidx = _frameIdx;
|
||||
switch (_animMode) {
|
||||
case NO_ANIMATION:
|
||||
// nothing doing
|
||||
break;
|
||||
|
||||
case TIME_BASED:
|
||||
_frameIdx = (int)((timestamp/_frameDelay) % fcount);
|
||||
nfidx = (int)((timestamp/_frameDelay) % fcount);
|
||||
break;
|
||||
|
||||
case MOVEMENT_CUED:
|
||||
|
||||
Reference in New Issue
Block a user