Make it possible to refresh our object tile if we've had our colorizations
changed. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2614 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SceneObject.java,v 1.7 2003/05/02 21:50:22 ray Exp $
|
// $Id: SceneObject.java,v 1.8 2003/05/27 18:25:19 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.miso.client;
|
package com.threerings.miso.client;
|
||||||
|
|
||||||
@@ -50,20 +50,7 @@ public class SceneObject
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
|
|
||||||
// resolve our object tile
|
// resolve our object tile
|
||||||
int tsid = TileUtil.getTileSetId(info.tileId);
|
refreshObjectTile(panel);
|
||||||
int tidx = TileUtil.getTileIndex(info.tileId);
|
|
||||||
try {
|
|
||||||
tile = (ObjectTile)panel.getTileManager().getTile(
|
|
||||||
tsid, tidx, panel.getColorizer(info));
|
|
||||||
computeInfo(panel.getSceneMetrics());
|
|
||||||
|
|
||||||
} catch (NoSuchTileException nste) {
|
|
||||||
Log.warning("Scene contains non-existent object tile " +
|
|
||||||
"[info=" + info + "].");
|
|
||||||
} catch (NoSuchTileSetException te) {
|
|
||||||
Log.warning("Scene contains non-existent object tileset " +
|
|
||||||
"[info=" + info + "].");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,6 +207,31 @@ public class SceneObject
|
|||||||
computeInfo(metrics);
|
computeInfo(metrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reloads and recolorizes our object tile. It is not intended for the
|
||||||
|
* actual object tile used by a scene object to change in its
|
||||||
|
* lifetime, only attributes of that object like its colorizations. So
|
||||||
|
* don't do anything crazy like change our {@link ObjectInfo}'s
|
||||||
|
* <code>tileId</code> and call this method or things might break.
|
||||||
|
*/
|
||||||
|
public void refreshObjectTile (MisoScenePanel panel)
|
||||||
|
{
|
||||||
|
int tsid = TileUtil.getTileSetId(info.tileId);
|
||||||
|
int tidx = TileUtil.getTileIndex(info.tileId);
|
||||||
|
try {
|
||||||
|
tile = (ObjectTile)panel.getTileManager().getTile(
|
||||||
|
tsid, tidx, panel.getColorizer(info));
|
||||||
|
computeInfo(panel.getSceneMetrics());
|
||||||
|
|
||||||
|
} catch (NoSuchTileException nste) {
|
||||||
|
Log.warning("Scene contains non-existent object tile " +
|
||||||
|
"[info=" + info + "].");
|
||||||
|
} catch (NoSuchTileSetException te) {
|
||||||
|
Log.warning("Scene contains non-existent object tileset " +
|
||||||
|
"[info=" + info + "].");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes our screen bounds, tile footprint and other useful cached
|
* Computes our screen bounds, tile footprint and other useful cached
|
||||||
* metrics.
|
* metrics.
|
||||||
|
|||||||
Reference in New Issue
Block a user