Updated for new tile world order.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@464 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -18,7 +18,7 @@ import com.samskivert.swing.HGroupLayout;
|
||||
import com.samskivert.swing.VGroupLayout;
|
||||
|
||||
import com.threerings.resource.ResourceManager;
|
||||
import com.threerings.media.ImageManager;
|
||||
import com.threerings.media.tile.TileManager;
|
||||
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
import com.threerings.crowd.client.PlaceView;
|
||||
@@ -107,8 +107,8 @@ public class VenisonPanel
|
||||
public void ancestorAdded (AncestorEvent event) {
|
||||
// create our image manager
|
||||
JRootPane rpane = getRootPane();
|
||||
VenisonTile.setImageManager(
|
||||
new ImageManager(_rmgr, (Frame)rpane.getParent()));
|
||||
TileManager tmgr = new TileManager(_rmgr);
|
||||
VenisonTile.setTileManager(tmgr);
|
||||
}
|
||||
public void ancestorMoved (AncestorEvent event) {
|
||||
}
|
||||
@@ -142,10 +142,9 @@ public class VenisonPanel
|
||||
// this stuff is all a bit of a hack right now. by all rights, the
|
||||
// venison app should set up the resource manager, because it knows
|
||||
// about that sort of stuff, and make it available via the venison
|
||||
// context and we may have some better place for the image manager to
|
||||
// live and the tile set would be fetched through the tile
|
||||
// manager. but it's late and i want to get this working, so fooey.
|
||||
// context and we may have some better place for the tile manager to
|
||||
// live. but it's late and i want to get this working, so fooey.
|
||||
|
||||
/** Our resource manager. */
|
||||
protected static ResourceManager _rmgr = new ResourceManager("rsrc");
|
||||
protected static ResourceManager _rmgr = new ResourceManager(null, "rsrc");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: AtlantiTile.java,v 1.11 2001/11/08 08:00:22 mdb Exp $
|
||||
// $Id: AtlantiTile.java,v 1.12 2001/11/24 04:29:04 mdb Exp $
|
||||
|
||||
package com.threerings.venison;
|
||||
|
||||
@@ -17,9 +17,9 @@ import java.util.List;
|
||||
import com.samskivert.util.IntTuple;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.media.ImageManager;
|
||||
import com.threerings.media.tile.NoSuchTileException;
|
||||
import com.threerings.media.tile.Tile;
|
||||
import com.threerings.media.tile.TileManager;
|
||||
import com.threerings.media.tile.UniformTileSet;
|
||||
|
||||
import com.threerings.presents.dobj.DSet;
|
||||
@@ -423,9 +423,9 @@ public class VenisonTile
|
||||
* Someone needs to configure this so that we can display tiles on
|
||||
* screen.
|
||||
*/
|
||||
public static void setImageManager (ImageManager imgr)
|
||||
public static void setTileManager (TileManager tmgr)
|
||||
{
|
||||
_imgr = imgr;
|
||||
_tmgr = tmgr;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,15 +435,19 @@ public class VenisonTile
|
||||
{
|
||||
// load up the tile set if we haven't already
|
||||
if (_tset == null) {
|
||||
_tset = new UniformTileSet(
|
||||
_imgr, TILES_IMG_PATH, TILE_TYPES, TILE_WIDTH, TILE_HEIGHT);
|
||||
_tset = new UniformTileSet();
|
||||
_tset.setTileCount(TILE_TYPES);
|
||||
_tset.setWidth(TILE_WIDTH);
|
||||
_tset.setHeight(TILE_HEIGHT);
|
||||
_tset.setImagePath(TILES_IMG_PATH);
|
||||
_tset.setImageProvider(_tmgr);
|
||||
}
|
||||
|
||||
// fetch the tile
|
||||
try {
|
||||
Tile tile = _tset.getTile(type-1);
|
||||
if (tile != null) {
|
||||
return tile.img;
|
||||
return tile.getImage();
|
||||
}
|
||||
|
||||
} catch (NoSuchTileException nste) {
|
||||
@@ -457,8 +461,8 @@ public class VenisonTile
|
||||
/** The tile image that we use to render this tile. */
|
||||
protected Image _tileImage;
|
||||
|
||||
/** Our image manager. */
|
||||
protected static ImageManager _imgr;
|
||||
/** Our tile manager. */
|
||||
protected static TileManager _tmgr;
|
||||
|
||||
/** Our tileset. */
|
||||
protected static UniformTileSet _tset;
|
||||
|
||||
Reference in New Issue
Block a user