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:
@@ -1,10 +1,8 @@
|
||||
//
|
||||
// $Id: TileUtil.java,v 1.2 2001/11/18 04:09:21 mdb Exp $
|
||||
// $Id: TileUtil.java,v 1.3 2002/05/06 18:08:32 mdb Exp $
|
||||
|
||||
package com.threerings.media.tile;
|
||||
|
||||
import java.awt.Image;
|
||||
|
||||
import com.threerings.media.Log;
|
||||
|
||||
/**
|
||||
@@ -23,15 +21,16 @@ public class TileUtil
|
||||
* tile.
|
||||
* @param tileIndex the index of the tile to be fetched.
|
||||
*/
|
||||
public static Image getTileImage (
|
||||
public static Tile getTile (
|
||||
TileManager tilemgr, int tileSetId, int tileIndex)
|
||||
{
|
||||
try {
|
||||
TileSet set = tilemgr.getTileSet(tileSetId);
|
||||
return set.getTileImage(tileIndex);
|
||||
return set.getTile(tileIndex);
|
||||
|
||||
} catch (TileException te) {
|
||||
Log.warning("Error retrieving tile image [error=" + te + "].");
|
||||
Log.warning("Error retrieving tile [tsid=" + tileSetId +
|
||||
", tidx=" + tileIndex + ", error=" + te + "].");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user