Major media subsystem revamp:
- All images are loaded through the image manager - Architected to allow the use of prepared or unprepared images (and volatile images when the day comes that they support alpha) - Tunable caches for images and tiles - Resource manager caches unpacked resources on the filesystem - Various and sundry other cleanups git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,40 +1,13 @@
|
||||
//
|
||||
// $Id: TileUtil.java,v 1.3 2002/05/06 18:08:32 mdb Exp $
|
||||
// $Id: TileUtil.java,v 1.4 2003/01/13 22:49:46 mdb Exp $
|
||||
|
||||
package com.threerings.media.tile;
|
||||
|
||||
import com.threerings.media.Log;
|
||||
|
||||
/**
|
||||
* Miscellaneous utility routines for working with tiles.
|
||||
*/
|
||||
public class TileUtil
|
||||
{
|
||||
/**
|
||||
* Returns the image associated with the given tile from the given
|
||||
* tile manager, or null if an error occurred. Any exceptions that
|
||||
* occur are logged.
|
||||
*
|
||||
* @param tilemgr the tile manager via which the tile should be
|
||||
* fetched.
|
||||
* @param tileSetId the id of the tileset from which to fetch the
|
||||
* tile.
|
||||
* @param tileIndex the index of the tile to be fetched.
|
||||
*/
|
||||
public static Tile getTile (
|
||||
TileManager tilemgr, int tileSetId, int tileIndex)
|
||||
{
|
||||
try {
|
||||
TileSet set = tilemgr.getTileSet(tileSetId);
|
||||
return set.getTile(tileIndex);
|
||||
|
||||
} catch (TileException te) {
|
||||
Log.warning("Error retrieving tile [tsid=" + tileSetId +
|
||||
", tidx=" + tileIndex + ", error=" + te + "].");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a fully-qualified tileid given the supplied tileset id
|
||||
* and tile index. This fully-qualified id can be used to fetch the
|
||||
|
||||
Reference in New Issue
Block a user