Renamed the methods that return raw tile images and added fat warnings not
to use these unless you're doing low-level image processing and will eventually stuff the data into a prepared image. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2530 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: TileSet.java,v 1.49 2003/04/28 17:38:06 mdb Exp $
|
||||
// $Id: TileSet.java,v 1.50 2003/05/02 23:32:10 mdb Exp $
|
||||
|
||||
package com.threerings.media.tile;
|
||||
|
||||
@@ -200,40 +200,6 @@ public abstract class TileSet
|
||||
return tile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns colorizations for the specified tile image. The default is
|
||||
* to return any colorizations associated with the tileset via a call
|
||||
* to {@link #clone(Colorization[])}, however derived classes may have
|
||||
* dynamic colorization policies that look up colorization assignments
|
||||
* from the supplied colorizer.
|
||||
*/
|
||||
protected Colorization[] getColorizations (int tileIndex, Colorizer rizer)
|
||||
{
|
||||
return _zations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the entire, raw, uncut, unprepared tileset source image.
|
||||
*/
|
||||
public BufferedImage getTileSetImage ()
|
||||
{
|
||||
return _improv.getTileSetImage(_imagePath, _zations);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw (unprepared) image that would be used by the tile
|
||||
* at the specified index.
|
||||
*/
|
||||
public BufferedImage getTileImage (int tileIndex)
|
||||
throws NoSuchTileException
|
||||
{
|
||||
checkTileIndex(tileIndex);
|
||||
Rectangle bounds = computeTileBounds(tileIndex);
|
||||
BufferedImage timg = getTileSetImage();
|
||||
return timg.getSubimage(bounds.x, bounds.y,
|
||||
bounds.width, bounds.height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a prepared version of the image that would be used by the
|
||||
* tile at the specified index. Because tilesets are often used simply
|
||||
@@ -266,6 +232,47 @@ public abstract class TileSet
|
||||
return _improv.getTileImage(_imagePath, bounds, zations);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the entire, raw, uncut, unprepared tileset source image.
|
||||
* Don't use this method unless you know what you're doing! This image
|
||||
* should not be rendered directly to the screen, you should obtain a
|
||||
* tile ({@link #getTile}), or a tile mirage ({@link #getTileMirage}).
|
||||
*/
|
||||
public BufferedImage getRawTileSetImage ()
|
||||
{
|
||||
return _improv.getTileSetImage(_imagePath, _zations);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw (unprepared) image that would be used by the tile
|
||||
* at the specified index. Don't use this method unless you know what
|
||||
* you're doing! If you're going to be painting this image onto the
|
||||
* screen directly, use {@link #getTileMirage} because that prepares
|
||||
* the image for display. Only use this if you're going to do further
|
||||
* processing and prepare the subsequent image for display onscreen.
|
||||
*/
|
||||
public BufferedImage getRawTileImage (int tileIndex)
|
||||
throws NoSuchTileException
|
||||
{
|
||||
checkTileIndex(tileIndex);
|
||||
Rectangle bounds = computeTileBounds(tileIndex);
|
||||
BufferedImage timg = getRawTileSetImage();
|
||||
return timg.getSubimage(bounds.x, bounds.y,
|
||||
bounds.width, bounds.height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns colorizations for the specified tile image. The default is
|
||||
* to return any colorizations associated with the tileset via a call
|
||||
* to {@link #clone(Colorization[])}, however derived classes may have
|
||||
* dynamic colorization policies that look up colorization assignments
|
||||
* from the supplied colorizer.
|
||||
*/
|
||||
protected Colorization[] getColorizations (int tileIndex, Colorizer rizer)
|
||||
{
|
||||
return _zations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to ensure that the specified tile index is valid.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user