Fixed up image loading to use the now-non-static ImageManager class.
Modified TileManager to store the height of a tile in the Tile object's member data when the tile is initially created since we would like to be able to reference it speedily. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@63 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,20 +1,34 @@
|
||||
//
|
||||
// $Id: TileSetManagerImpl.java,v 1.3 2001/07/18 21:45:42 shaper Exp $
|
||||
// $Id: TileSetManagerImpl.java,v 1.4 2001/07/18 22:45:35 shaper Exp $
|
||||
|
||||
package com.threerings.miso.tile;
|
||||
|
||||
import com.threerings.media.ImageManager;
|
||||
|
||||
import com.samskivert.util.IntMap;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
|
||||
public abstract class TileSetManagerImpl implements TileSetManager
|
||||
{
|
||||
public TileSetManagerImpl (ImageManager imgr)
|
||||
{
|
||||
_imgr = imgr;
|
||||
}
|
||||
|
||||
public TileSet getTileSet (int tsid)
|
||||
{
|
||||
return (TileSet)_tilesets.get(tsid);
|
||||
}
|
||||
|
||||
public Image getTileImage (int tsid, int tid)
|
||||
{
|
||||
TileSet tset = getTileSet(tsid);
|
||||
return (tset != null) ? tset.getTileImage(_imgr, tid) : null;
|
||||
}
|
||||
|
||||
public ArrayList getTileSets ()
|
||||
{
|
||||
int size = _tilesets.size();
|
||||
@@ -35,5 +49,6 @@ public abstract class TileSetManagerImpl implements TileSetManager
|
||||
return _tilesets.size();
|
||||
}
|
||||
|
||||
protected ImageManager _imgr;
|
||||
protected IntMap _tilesets = new IntMap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user