diff --git a/src/java/com/threerings/media/tile/BaseSizableTileSet.java b/src/java/com/threerings/media/tile/BaseSizableTileSet.java new file mode 100644 index 00000000..5c9fb171 --- /dev/null +++ b/src/java/com/threerings/media/tile/BaseSizableTileSet.java @@ -0,0 +1,35 @@ +// +// Nenya library - tools for developing networked games +// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/nenya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.media.tile; + +public interface BaseSizableTileSet +{ + + /** + * Returns the base width for the specified object index. + */ + public abstract int getBaseWidth (int tileIdx); + + /** + * Returns the base height for the specified object index. + */ + public abstract int getBaseHeight (int tileIdx); + +} \ No newline at end of file diff --git a/src/java/com/threerings/media/tile/ObjectTileSet.java b/src/java/com/threerings/media/tile/ObjectTileSet.java index 9138d6e8..89e0fee9 100644 --- a/src/java/com/threerings/media/tile/ObjectTileSet.java +++ b/src/java/com/threerings/media/tile/ObjectTileSet.java @@ -33,7 +33,7 @@ import com.threerings.media.image.Colorization; * @see ObjectTile */ public class ObjectTileSet extends SwissArmyTileSet - implements RecolorableTileSet + implements RecolorableTileSet, BaseSizableTileSet { /** A constraint prefix indicating that the object must have empty space in * the suffixed direction (N, E, S, or W). */ @@ -193,16 +193,16 @@ public class ObjectTileSet extends SwissArmyTileSet return _zations; } - /** - * Returns the base width for the specified object index. + /* (non-Javadoc) + * @see com.threerings.media.tile.BaseSizableTileSet#getBaseWidth(int) */ public int getBaseWidth (int tileIdx) { return _owidths[tileIdx]; } - /** - * Returns the base height for the specified object index. + /* (non-Javadoc) + * @see com.threerings.media.tile.BaseSizableTileSet#getBaseHeight(int) */ public int getBaseHeight (int tileIdx) { diff --git a/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java b/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java index a61507e5..ccc2f053 100644 --- a/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java +++ b/src/java/com/threerings/media/tile/TrimmedObjectTileSet.java @@ -43,7 +43,7 @@ import com.threerings.media.tile.util.TileSetTrimmer; * memory efficient). */ public class TrimmedObjectTileSet extends TileSet - implements RecolorableTileSet + implements RecolorableTileSet, BaseSizableTileSet { @Override public int getTileCount ()