A bunch of intertwingled changes:

Refactored TileSet into TileSet, UniformTileSet, SwissArmyTileSet and
ObjectTileSet.

Removed dependence on the "root" system property from the
XMLSceneRepository (things either pass in full paths now or input streams
fetched via the resource manager).

Removed MisoUtil.createImageManager() because everyone does that by hand
now (which is good because some non-Miso things were using MisoUtil for
that).

I think that's it, but if there was something else, don't blame me. Blame
the monkeys.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@608 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-11-08 03:04:45 +00:00
parent 0b5d51a80c
commit feb2a2633e
12 changed files with 563 additions and 277 deletions
@@ -1,5 +1,5 @@
//
// $Id: XMLTileSetParser.java,v 1.20 2001/11/01 01:40:42 shaper Exp $
// $Id: XMLTileSetParser.java,v 1.21 2001/11/08 03:04:44 mdb Exp $
package com.threerings.media.tile;
@@ -78,11 +78,6 @@ public class XMLTileSetParser
} else if (qName.equals("tilecount")) {
_info.tileCount = StringUtil.parseIntArray(data);
// calculate the total number of tiles in the tileset
for (int ii = 0; ii < _info.tileCount.length; ii++) {
_info.numTiles += _info.tileCount[ii];
}
} else if (qName.equals("offsetpos")) {
parsePoint(data, _info.offsetPos);
@@ -119,7 +114,13 @@ public class XMLTileSetParser
// documentation inherited
protected InputStream getInputStream (String fname) throws IOException
{
return ConfigUtil.getStream(fname);
InputStream is = ConfigUtil.getStream(fname);
if (is == null) {
String errmsg = "Can't load tileset description file from " +
"classpath [path=" + fname + "].";
throw new FileNotFoundException(errmsg);
}
return is;
}
/**
@@ -129,10 +130,18 @@ public class XMLTileSetParser
*/
protected TileSet createTileSet ()
{
return new TileSet(
_imgmgr, _info.tsid, _info.name, _info.imgFile, _info.tileCount,
_info.rowWidth, _info.rowHeight, _info.numTiles, _info.offsetPos,
_info.gapDist, _info.isObjectSet, _info.objects);
if (_info.isObjectSet) {
return new ObjectTileSet(
_imgmgr, _info.imgFile, _info.name, _info.tsid,
_info.tileCount, _info.rowWidth, _info.rowHeight,
_info.offsetPos, _info.gapDist, _info.objects);
} else {
return new SwissArmyTileSet(
_imgmgr, _info.imgFile, _info.name, _info.tsid,
_info.tileCount, _info.rowWidth, _info.rowHeight,
_info.offsetPos, _info.gapDist);
}
}
/**
@@ -160,7 +169,6 @@ public class XMLTileSetParser
public String name;
public String imgFile;
public int tileCount[], rowWidth[], rowHeight[];
public int numTiles;
public Point offsetPos = new Point();
public Point gapDist = new Point();
public boolean isObjectSet;