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,9 +1,10 @@
//
// $Id: ObjectTileSet.java,v 1.6 2001/12/18 08:37:54 mdb Exp $
// $Id: ObjectTileSet.java,v 1.7 2002/05/06 18:08:32 mdb Exp $
package com.threerings.media.tile;
import java.awt.Image;
import java.awt.Rectangle;
import java.util.Arrays;
import com.samskivert.util.StringUtil;
@@ -68,7 +69,7 @@ public class ObjectTileSet extends SwissArmyTileSet
* Creates instances of {@link ObjectTile}, which can span more than a
* single tile's space in a display.
*/
protected Tile createTile (int tileIndex, Image image)
protected Tile createTile (int tileIndex, Image tilesetImage)
{
// default object dimensions to (1, 1)
int wid = 1, hei = 1;
@@ -79,7 +80,8 @@ public class ObjectTileSet extends SwissArmyTileSet
hei = _oheights[tileIndex];
}
ObjectTile tile = new ObjectTile(image, wid, hei);
Rectangle bounds = computeTileBounds(tileIndex, tilesetImage);
ObjectTile tile = new ObjectTile(tilesetImage, bounds, wid, hei);
if (_xorigins != null) {
tile.setOrigin(_xorigins[tileIndex], _yorigins[tileIndex]);