diff --git a/src/java/com/threerings/media/tile/TileLayer.java b/src/java/com/threerings/media/tile/TileLayer.java deleted file mode 100644 index ec619ba68..000000000 --- a/src/java/com/threerings/media/tile/TileLayer.java +++ /dev/null @@ -1,80 +0,0 @@ -// -// $Id: TileLayer.java,v 1.1 2001/11/18 04:09:21 mdb Exp $ - -package com.threerings.media.tile; - -/** - * The tile layer class is a convenience class provided to simplify the - * management of a two-dimensional array of tiles. It takes care of - * dereferencing the tile array efficiently with methods that the Java - * compiler should inline, and prevents the caller from having to do the - * indexing multiplication by hand every time. - */ -public final class TileLayer -{ - /** - * Constructs a tile layer instance with the supplied tiles, width and - * height. The tiles should exist in row-major format (the first row - * of tiles followed by the second and so on). - * - * @exception IllegalArgumentException thrown if the size of the tiles - * array does not match the specified width and height. - */ - public TileLayer (Tile[] tiles, int width, int height) - { - // sanity check - if (tiles.length != width*height) { - String errmsg = "tiles.length != width*height"; - throw new IllegalArgumentException(errmsg); - } - - _tiles = tiles; - _width = width; - _height = height; - } - - /** - * Returns the width of the layer in tiles. - */ - public int getWidth () - { - return _width; - } - - /** - * Returns the height of the layer in tiles. - */ - public int getHeight () - { - return _height; - } - - /** - * Fetches the tile at the specified row and column. Bounds checking - * is not done. Note that the parameters are column first, followed by - * row (x, y order rather than row, column order). - */ - public Tile getTile (int column, int row) - { - return _tiles[row*_width+column]; - } - - /** - * Sets the tile at the specified row and column. Bounds checking is - * not done. Note that the parameters are column first, followed by - * row (x, y order rather than row, column order). - */ - public void setTile (int column, int row, Tile tile) - { - _tiles[row*_width+column] = tile; - } - - /** Our tiles array. */ - private Tile[] _tiles; - - /** The number of tiles in a row. */ - private int _width; - - /** The number of rows. */ - private int _height; -} diff --git a/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java b/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java index 00f8986af..f9943d10f 100644 --- a/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java +++ b/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java @@ -1,5 +1,5 @@ // -// $Id: TrimmedObjectTileSet.java,v 1.7 2003/02/06 06:23:05 mdb Exp $ +// $Id: TrimmedObjectTileSet.java,v 1.8 2003/02/12 05:33:47 mdb Exp $ package com.threerings.media.tile; @@ -50,11 +50,12 @@ public class TrimmedObjectTileSet extends TileSet /** * Returns the orientation of the spot associated with the specified - * tile index. + * tile index, or -1 if the object has no associated + * spot. */ public int getSpotOrient (int tileIdx) { - return (_bits == null) ? 0 : _bits[tileIdx].sorient; + return (_bits == null) ? -1 : _bits[tileIdx].sorient; } // documentation inherited @@ -72,7 +73,7 @@ public class TrimmedObjectTileSet extends TileSet if (_bits != null) { Bits bits = _bits[tileIndex]; tile.setPriority(bits.priority); - if (bits.xspot != 0 || bits.yspot != 0 || bits.sorient != 0) { + if (bits.sorient != -1) { tile.setSpot(bits.xspot, bits.yspot, bits.sorient); } } @@ -181,7 +182,7 @@ public class TrimmedObjectTileSet extends TileSet public short yspot; /** The orientation of the "spot" associated with this object. */ - public byte sorient; + public byte sorient = -1; /** Generates a string representation of this instance. */ public String toString ()