Switch to new unified direction constants.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@818 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-12-17 03:34:04 +00:00
parent f51a2e0d0c
commit 7d079a2bec
12 changed files with 87 additions and 178 deletions
@@ -1,5 +1,5 @@
//
// $Id: CharacterManager.java,v 1.10 2001/11/27 08:09:34 mdb Exp $
// $Id: CharacterManager.java,v 1.11 2001/12/17 03:33:40 mdb Exp $
package com.threerings.cast;
@@ -130,7 +130,7 @@ public class CharacterManager
CharacterDescriptor descrip, String action)
throws NoSuchComponentException
{
MultiFrameImage[] frames = new MultiFrameImage[Sprite.NUM_DIRECTIONS];
MultiFrameImage[] frames = new MultiFrameImage[Sprite.DIRECTION_COUNT];
// obtain the necessary components
int[] cids = descrip.getComponentIds();
@@ -1,5 +1,5 @@
//
// $Id: CharacterSprite.java,v 1.19 2001/11/29 20:33:44 mdb Exp $
// $Id: CharacterSprite.java,v 1.20 2001/12/17 03:33:40 mdb Exp $
package com.threerings.cast;
@@ -26,7 +26,7 @@ public class CharacterSprite
_charmgr = charmgr;
// assign an arbitrary starting orientation
_orient = DIR_NORTH;
_orient = NORTH;
}
/**
@@ -1,5 +1,5 @@
//
// $Id: SpritePanel.java,v 1.7 2001/12/13 06:35:52 mdb Exp $
// $Id: SpritePanel.java,v 1.8 2001/12/17 03:33:40 mdb Exp $
package com.threerings.cast.builder;
@@ -95,7 +95,7 @@ public class SpritePanel
protected void setSprite (CharacterSprite sprite)
{
sprite.setActionSequence(StandardActions.STANDING);
sprite.setOrientation(Sprite.DIR_WEST);
sprite.setOrientation(Sprite.WEST);
_sprite = sprite;
centerSprite();
repaint();
@@ -1,5 +1,5 @@
//
// $Id: BundledComponentRepository.java,v 1.4 2001/12/07 01:33:29 mdb Exp $
// $Id: BundledComponentRepository.java,v 1.5 2001/12/17 03:33:41 mdb Exp $
package com.threerings.cast.bundle;
@@ -233,7 +233,7 @@ public class BundledComponentRepository
// and create the necessary multiframe image instances
MultiFrameImage[] frames =
new MultiFrameImage[Sprite.NUM_DIRECTIONS];
new MultiFrameImage[Sprite.DIRECTION_COUNT];
for (int i = 0; i < frames.length; i++) {
frames[i] = new TileSetFrameImage(fset, i);
}
@@ -271,7 +271,7 @@ public class BundledComponentRepository
// documentation inherited
public int getFrameCount ()
{
return _set.getTileCount() / Sprite.NUM_DIRECTIONS;
return _set.getTileCount() / Sprite.DIRECTION_COUNT;
}
// documentation inherited
@@ -1,5 +1,5 @@
//
// $Id: TileUtil.java,v 1.5 2001/11/27 08:39:43 mdb Exp $
// $Id: TileUtil.java,v 1.6 2001/12/17 03:33:41 mdb Exp $
package com.threerings.cast.util;
@@ -29,7 +29,7 @@ public class TileUtil
public static void compositeFrames (
MultiFrameImage[] dest, MultiFrameImage[] src)
{
for (int orient = 0; orient < Sprite.NUM_DIRECTIONS; orient++) {
for (int orient = 0; orient < Sprite.DIRECTION_COUNT; orient++) {
MultiFrameImage sframes = src[orient];
MultiFrameImage dframes = dest[orient];
@@ -56,69 +56,6 @@ public class TileUtil
}
}
// /**
// * Returns a two-dimensional array of multi frame images containing
// * the frames of animation used to render the sprite while standing or
// * walking in each of the directions it may face.
// */
// public static MultiFrameImage[][] getComponentFrames (
// String imagedir, CharacterComponent c)
// {
// ActionSequence seqs[] = c.getActionSequences();
// MultiFrameImage frames[][] =
// new MultiFrameImage[seqs.length][Sprite.NUM_DIRECTIONS];
// try {
// for (int ii = 0; ii < seqs.length; ii++) {
// ActionSequence as = seqs[ii];
// // get the tile set containing the component tiles for
// // this action sequence
// String file = getImageFile(imagedir, as, c);
// TileSet tset = null;
// try {
// tset = as.tileset.clone(file);
// } catch (CloneNotSupportedException e) {
// Log.warning("Failed to clone tile set " +
// "[tset=" + as.tileset + "].");
// return null;
// }
// // get the number of frames of animation
// int frameCount = tset.getTileCount() / Sprite.NUM_DIRECTIONS;
// for (int dir = 0; dir < Sprite.NUM_DIRECTIONS; dir++) {
// // retrieve all images for the sequence and direction
// Image imgs[] = new Image[frameCount];
// for (int jj = 0; jj < frameCount; jj++) {
// int idx = (dir * frameCount) + jj;
// imgs[jj] = tset.getTileImage(idx);
// }
// // create the multi frame image
// frames[ii][dir] = new MultiFrameImageImpl(imgs);
// }
// }
// } catch (TileException te) {
// Log.warning("Exception retrieving character images " +
// "[te=" + te + "].");
// return null;
// }
// return frames;
// }
// /**
// * Returns the file path for the given action sequence and component.
// */
// protected static String getImageFile (
// String imagedir, ActionSequence as, CharacterComponent c)
// {
// return imagedir + as.fileid + "_" + c.getFileId() + IMAGE_SUFFIX;
// }
/**
* An implementation of the {@link MultiFrameImage} interface that
* initializes itself to contain a specified number of blank