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:
Walter Korman
2001-07-18 22:45:35 +00:00
parent c4654e2a11
commit f91e1b41d1
11 changed files with 84 additions and 54 deletions
@@ -1,5 +1,5 @@
//
// $Id: IsoSceneView.java,v 1.6 2001/07/18 21:45:42 shaper Exp $
// $Id: IsoSceneView.java,v 1.7 2001/07/18 22:45:35 shaper Exp $
package com.threerings.miso.scene;
@@ -7,7 +7,6 @@ import com.threerings.miso.Log;
import com.threerings.miso.tile.Tile;
import com.threerings.miso.tile.TileManager;
import com.threerings.miso.util.MathUtil;
import com.threerings.media.ImageManager;
import java.awt.*;
import java.awt.image.*;
@@ -89,7 +88,7 @@ public class IsoSceneView implements SceneView
// TODO: draw layers L1+.
Tile tile = _scene.tiles[tx][ty][Scene.LAYER_BASE];
int ypos = screenY - (tile.img.getHeight() - Tile.HEIGHT);
int ypos = screenY - (tile.height - Tile.HEIGHT);
g2.drawImage(tile.img, screenX, ypos, null);
//paintCoords(g2, tx, ty, screenX, screenY);
@@ -1,13 +1,20 @@
//
// $Id: CompiledTileSetManager.java,v 1.4 2001/07/18 21:45:42 shaper Exp $
// $Id: CompiledTileSetManager.java,v 1.5 2001/07/18 22:45:35 shaper Exp $
package com.threerings.miso.tile;
import com.threerings.media.ImageManager;
import java.io.InputStream;
import java.io.IOException;
public class CompiledTileSetManager extends TileSetManagerImpl
{
public CompiledTileSetManager (ImageManager imgr)
{
super(imgr);
}
public void loadTileSets (InputStream tis) throws IOException
{
// TBD
@@ -1,9 +1,10 @@
//
// $Id: EditableTileSetManager.java,v 1.4 2001/07/18 21:45:42 shaper Exp $
// $Id: EditableTileSetManager.java,v 1.5 2001/07/18 22:45:35 shaper Exp $
package com.threerings.miso.tile;
import com.threerings.miso.Log;
import com.threerings.media.ImageManager;
import java.io.IOException;
import java.io.InputStream;
@@ -17,6 +18,11 @@ import java.util.ArrayList;
*/
public class EditableTileSetManager extends TileSetManagerImpl
{
public EditableTileSetManager (ImageManager imgr)
{
super(imgr);
}
public void loadTileSets (InputStream tis) throws IOException
{
// read all tileset descriptions from the XML input stream