The vast and the sweeping. Modified the tile framework such that tiles no

longer provide access to their underlying image (they actually still do,
but not in the normal course of affairs). This will allow us to use
"trimmed" tiles which are trimmed to the smallest rectangle that contains
the non-transparent pixels in a tile image, which will shrink up our
components and other tiles a great deal.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1339 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-05-06 18:08:32 +00:00
parent 1c182d6e36
commit 99c4330646
24 changed files with 517 additions and 306 deletions
@@ -1,20 +1,22 @@
//
// $Id: BaseTileSet.java,v 1.9 2001/11/29 21:58:49 mdb Exp $
// $Id: BaseTileSet.java,v 1.10 2002/05/06 18:08:32 mdb Exp $
package com.threerings.miso.tile;
import java.awt.Image;
import java.awt.Rectangle;
import com.samskivert.util.StringUtil;
import com.threerings.media.tile.Tile;
import com.threerings.media.tile.SwissArmyTileSet;
import com.threerings.miso.scene.Traverser;
/**
* The base tileset extends the swiss army tileset to add support for tile
* passability. Passability is used to determine whether {@link
* com.threerings.miso.scene.Traverser} objects can traverse a particular
* tile in a scene.
* passability. Passability is used to determine whether {@link Traverser}
* objects can traverse a particular tile in a scene.
*/
public class BaseTileSet extends SwissArmyTileSet
{
@@ -36,9 +38,11 @@ public class BaseTileSet extends SwissArmyTileSet
}
// documentation inherited
protected Tile createTile (int tileIndex, Image image)
protected Tile createTile (int tileIndex, Image tilesetImage)
{
return new BaseTile(image, _passable[tileIndex]);
return new BaseTile(tilesetImage,
computeTileBounds(tileIndex, tilesetImage),
_passable[tileIndex]);
}
// documentation inherited