Not to freak out if we have no frames.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1083 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: CharacterSprite.java,v 1.21 2002/02/19 22:09:08 mdb Exp $
|
// $Id: CharacterSprite.java,v 1.22 2002/03/04 22:47:06 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.cast;
|
package com.threerings.cast;
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public class CharacterSprite
|
|||||||
setFrames(_frames[_orient]);
|
setFrames(_frames[_orient]);
|
||||||
|
|
||||||
} catch (NoSuchComponentException nsce) {
|
} catch (NoSuchComponentException nsce) {
|
||||||
Log.warning("Character sprite referneces non-existent " +
|
Log.warning("Character sprite references non-existent " +
|
||||||
"component [sprite=" + this + ", err=" + nsce + "].");
|
"component [sprite=" + this + ", err=" + nsce + "].");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,9 @@ public class CharacterSprite
|
|||||||
super.setOrientation(orient);
|
super.setOrientation(orient);
|
||||||
|
|
||||||
// update the sprite frames to reflect the direction
|
// update the sprite frames to reflect the direction
|
||||||
setFrames(_frames[orient]);
|
if (_frames != null) {
|
||||||
|
setFrames(_frames[orient]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: Sprite.java,v 1.37 2002/02/20 03:13:57 mdb Exp $
|
// $Id: Sprite.java,v 1.38 2002/03/04 22:47:06 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.media.sprite;
|
package com.threerings.media.sprite;
|
||||||
|
|
||||||
@@ -198,7 +198,11 @@ public class Sprite implements DirectionCodes
|
|||||||
*/
|
*/
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
gfx.drawImage(_frame, _bounds.x, _bounds.y, null);
|
if (_frame != null) {
|
||||||
|
gfx.drawImage(_frame, _bounds.x, _bounds.y, null);
|
||||||
|
} else {
|
||||||
|
gfx.draw(_bounds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -435,6 +439,11 @@ public class Sprite implements DirectionCodes
|
|||||||
*/
|
*/
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
|
// if we have no frames, we're hosulated (to use a Greenwell term)
|
||||||
|
if (_frames == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int fcount = _frames.getFrameCount();
|
int fcount = _frames.getFrameCount();
|
||||||
boolean moved = false;
|
boolean moved = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user