Added default tileset and tile id to the editor properties. Added

more sample tiles with ingenious "daniel"-based naming scheme for
testing purposes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@139 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-08-02 01:19:47 +00:00
parent 1032b8f325
commit 343eb1b38f
5 changed files with 35 additions and 20 deletions
@@ -1,5 +1,5 @@
// //
// $Id: DisplayMisoSceneImpl.java,v 1.14 2001/07/25 01:38:08 shaper Exp $ // $Id: DisplayMisoSceneImpl.java,v 1.15 2001/08/02 01:19:47 shaper Exp $
package com.threerings.miso.scene; package com.threerings.miso.scene;
@@ -40,27 +40,30 @@ public class Scene
public static final String[] XLATE_LAYERS = { "Base", "Object" }; public static final String[] XLATE_LAYERS = { "Base", "Object" };
/** Scene id to denote an unset or otherwise invalid scene id. */ /** Scene id to denote an unset or otherwise invalid scene id. */
public static final int SID_INVALID = -1; public static final short SID_INVALID = -1;
/** The tiles comprising the scene. */ /** The tiles comprising the scene. */
public Tile tiles[][][]; public Tile tiles[][][];
/** /**
* Construct a new Scene object initialized to a default state, * Construct a new Scene object. The base layer tiles are
* specifying the tile manager from which the scene obtains tiles. * initialized to contain tiles of the specified default tileset
* and tile id.
* *
* @param tilemgr the tile manager. * @param tilemgr the tile manager.
* @param deftsid the default tileset id.
* @param deftid the default tile id.
*/ */
public Scene (TileManager tilemgr, int sid) public Scene (TileManager tilemgr, int deftsid, int deftid)
{ {
_tilemgr = tilemgr; _tilemgr = tilemgr;
_sid = (short)sid; _sid = SID_INVALID;
_name = DEF_SCENE_NAME; _name = DEF_SCENE_NAME;
_hotspots = new Point[0]; _hotspots = new Point[0];
_exits = new ExitPoint[0]; _exits = new ExitPoint[0];
tiles = new Tile[TILE_WIDTH][TILE_HEIGHT][NUM_LAYERS]; tiles = new Tile[TILE_WIDTH][TILE_HEIGHT][NUM_LAYERS];
Tile tile = _tilemgr.getTile(DEF_TSID, DEF_TID); Tile tile = _tilemgr.getTile(deftsid, deftid);
for (int xx = 0; xx < TILE_WIDTH; xx++) { for (int xx = 0; xx < TILE_WIDTH; xx++) {
for (int yy = 0; yy < TILE_HEIGHT; yy++) { for (int yy = 0; yy < TILE_HEIGHT; yy++) {
for (int ii = 0; ii < NUM_LAYERS; ii++) { for (int ii = 0; ii < NUM_LAYERS; ii++) {
@@ -77,18 +80,17 @@ public class Scene
* the tile manager from which the scene obtains tiles. * the tile manager from which the scene obtains tiles.
* *
* @param tilemgr the tile manager. * @param tilemgr the tile manager.
* @param sid the scene id.
* @param name the scene name. * @param name the scene name.
* @param hotspots the hotspot points. * @param hotspots the hotspot points.
* @param exits the exit points. * @param exits the exit points.
* @param tiles the tiles comprising the scene. * @param tiles the tiles comprising the scene.
*/ */
public Scene (TileManager tilemgr, int sid, String name, public Scene (TileManager tilemgr, String name,
Point hotspots[], ExitPoint exits[], Point hotspots[], ExitPoint exits[],
Tile tiles[][][]) Tile tiles[][][])
{ {
_tilemgr = tilemgr; _tilemgr = tilemgr;
_sid = (short)sid; _sid = SID_INVALID;
_name = name; _name = name;
_hotspots = hotspots; _hotspots = hotspots;
_exits = exits; _exits = exits;
@@ -162,12 +164,6 @@ public class Scene
/** The default scene name. */ /** The default scene name. */
protected static final String DEF_SCENE_NAME = "Untitled Scene"; protected static final String DEF_SCENE_NAME = "Untitled Scene";
/** The default tileset id. */
protected static final short DEF_TSID = 1000;
/** The default tile id. */
protected static final short DEF_TID = 1;
/** The scene name. */ /** The scene name. */
protected String _name; protected String _name;
@@ -1,5 +1,5 @@
// //
// $Id: XMLSceneParser.java,v 1.4 2001/07/27 17:52:07 shaper Exp $ // $Id: XMLSceneParser.java,v 1.5 2001/08/02 01:19:47 shaper Exp $
package com.threerings.miso.scene.xml; package com.threerings.miso.scene.xml;
@@ -83,8 +83,9 @@ public class XMLSceneParser extends DefaultHandler
} else if (qName.equals("scene")) { } else if (qName.equals("scene")) {
// construct the scene object on tag close // construct the scene object on tag close
_scene = new Scene(_tilemgr, Scene.SID_INVALID, _scName, _scene = new Scene(
_scHotspots, _scExits, _scTiles); _tilemgr, _scName, _scHotspots, _scExits, _scTiles);
Log.info("Constructed parsed scene [scene=" + _scene + "]."); Log.info("Constructed parsed scene [scene=" + _scene + "].");
} }
+19 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
<!-- $Id: tilesets.xml,v 1.4 2001/07/28 01:26:24 shaper Exp $ --> <!-- $Id: tilesets.xml,v 1.5 2001/08/02 01:19:47 shaper Exp $ -->
<!-- Initial test tileset description data. --> <!-- Initial test tileset description data. -->
@@ -44,4 +44,22 @@
<gapdist>39, 18</gapdist> <gapdist>39, 18</gapdist>
</tileset> </tileset>
<tileset>
<name>Daniel</name>
<tsid>1004</tsid>
<imagefile>media/miso/tiles-daniel.png</imagefile>
<rowheight>49, 98</rowheight>
<rowwidth>63, 63</rowwidth>
<tilecount>5, 1</tilecount>
</tileset>
<tileset>
<name>Daniel-2</name>
<tsid>1005</tsid>
<imagefile>media/miso/tiles-daniel2.png</imagefile>
<rowheight>49</rowheight>
<rowwidth>63</rowwidth>
<tilecount>14</tilecount>
</tileset>
</tilesetgroup> </tilesetgroup>
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB