Updated comments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@230 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: CharacterSprite.java,v 1.1 2001/08/02 21:02:56 shaper Exp $
|
// $Id: CharacterSprite.java,v 1.2 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.sprite;
|
package com.threerings.miso.sprite;
|
||||||
|
|
||||||
@@ -8,16 +8,15 @@ import com.threerings.miso.tile.Tile;
|
|||||||
import com.threerings.miso.tile.TileManager;
|
import com.threerings.miso.tile.TileManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A <code>AmbulatorySprite</code> is a sprite that can face in one of
|
* An <code>AmbulatorySprite</code> is a sprite that can face in one
|
||||||
* eight compass directions and animate itself walking along any
|
* of the various compass directions and that can animate itself
|
||||||
* chosen path.
|
* walking along some chosen path.
|
||||||
*/
|
*/
|
||||||
public class AmbulatorySprite extends Sprite
|
public class AmbulatorySprite extends Sprite
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Construct a <code>AmbulatorySprite</code>, loading the tiles
|
* Construct an <code>AmbulatorySprite</code>, loading the tiles
|
||||||
* used to display the sprite from the given tileset via the given
|
* used to display the sprite from the given tileset.
|
||||||
* tile manager.
|
|
||||||
*
|
*
|
||||||
* @param x the sprite x-position in pixels.
|
* @param x the sprite x-position in pixels.
|
||||||
* @param y the sprite y-position in pixels.
|
* @param y the sprite y-position in pixels.
|
||||||
@@ -92,12 +91,6 @@ public class AmbulatorySprite extends Sprite
|
|||||||
/** The number of frames of animation for each direction. */
|
/** The number of frames of animation for each direction. */
|
||||||
protected static final int NUM_DIR_FRAMES = 8;
|
protected static final int NUM_DIR_FRAMES = 8;
|
||||||
|
|
||||||
/**
|
|
||||||
* The buffer space in pixels allowed for horizontal or vertical
|
|
||||||
* selection of movement north/south or east/west, respectively.
|
|
||||||
*/
|
|
||||||
protected static final int DIR_BUFFER = 20;
|
|
||||||
|
|
||||||
/** The animation frames for the sprite facing each direction. */
|
/** The animation frames for the sprite facing each direction. */
|
||||||
protected Tile[][] _dirTiles;
|
protected Tile[][] _dirTiles;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: TileManager.java,v 1.12 2001/07/28 01:31:51 shaper Exp $
|
// $Id: TileManager.java,v 1.13 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.tile;
|
package com.threerings.miso.tile;
|
||||||
|
|
||||||
@@ -12,13 +12,18 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a simplified interface for managing multiple tilesets and
|
* The <code>TileManager</code> class provides a simplified interface
|
||||||
* tiles.
|
* for retrieving and caching tiles.
|
||||||
|
*
|
||||||
|
* @see TileSetManager
|
||||||
*/
|
*/
|
||||||
public class TileManager
|
public class TileManager
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Initialize the tile manager with the given TileSetManager object.
|
* Initialize the tile manager with the given
|
||||||
|
* <code>TileSetManager</code> object.
|
||||||
|
*
|
||||||
|
* @param tilesetmgr the tileset manager.
|
||||||
*/
|
*/
|
||||||
public TileManager (TileSetManager tilesetmgr)
|
public TileManager (TileSetManager tilesetmgr)
|
||||||
{
|
{
|
||||||
@@ -26,7 +31,13 @@ public class TileManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the Tile object for the specified tileset and tile id.
|
* Return the <code>Tile</code> object for the specified tileset
|
||||||
|
* and tile id.
|
||||||
|
*
|
||||||
|
* @param tsid the tileset id.
|
||||||
|
* @param tid the tile id.
|
||||||
|
*
|
||||||
|
* @return the tile object.
|
||||||
*/
|
*/
|
||||||
public Tile getTile (int tsid, int tid)
|
public Tile getTile (int tsid, int tid)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: TileSetManager.java,v 1.9 2001/07/23 22:31:48 shaper Exp $
|
// $Id: TileSetManager.java,v 1.10 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.tile;
|
package com.threerings.miso.tile;
|
||||||
|
|
||||||
@@ -9,11 +9,13 @@ import java.awt.Image;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The TileSetManager provides tileset management functionality
|
* The <code>TileSetManager</code> provides tileset management
|
||||||
* intended for use by the TileManager. It provides facilities for
|
* functionality intended for use by the <code>TileManager</code>. It
|
||||||
* obtaining information about individual tilesets, retrieving an list
|
* provides facilities for obtaining information about individual
|
||||||
* of all tilesets available, and retrieving the image associated with
|
* tilesets, retrieving an list of all tilesets available, and
|
||||||
* a particular tile in a set.
|
* retrieving the image associated with a particular tile in a set.
|
||||||
|
*
|
||||||
|
* @see TileManager
|
||||||
*/
|
*/
|
||||||
public interface TileSetManager
|
public interface TileSetManager
|
||||||
{
|
{
|
||||||
@@ -27,7 +29,8 @@ public interface TileSetManager
|
|||||||
public int getNumTilesInSet (int tsid);
|
public int getNumTilesInSet (int tsid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an ArrayList containing all TileSet objects available.
|
* Return an <code>ArrayList</code> containing all
|
||||||
|
* <code>TileSet</code> objects available.
|
||||||
*
|
*
|
||||||
* @return the list of tilesets.
|
* @return the list of tilesets.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: XMLTileSetParser.java,v 1.9 2001/08/08 00:33:54 shaper Exp $
|
// $Id: XMLTileSetParser.java,v 1.10 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.tile;
|
package com.threerings.miso.tile;
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ public class XMLTileSetParser extends DefaultHandler
|
|||||||
/** The tilesets constructed thus far. */
|
/** The tilesets constructed thus far. */
|
||||||
protected ArrayList _tilesets = new ArrayList();
|
protected ArrayList _tilesets = new ArrayList();
|
||||||
|
|
||||||
// temporary storage of tileset object values
|
/** Temporary storage of tileset object values. */
|
||||||
protected StringBuffer _chars;
|
protected StringBuffer _chars;
|
||||||
protected String _tsName;
|
protected String _tsName;
|
||||||
protected int _tsTsid;
|
protected int _tsTsid;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: PerformanceMonitor.java,v 1.1 2001/08/02 00:42:02 shaper Exp $
|
// $Id: PerformanceMonitor.java,v 1.2 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.util;
|
package com.threerings.miso.util;
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ import com.threerings.miso.Log;
|
|||||||
* <p> Note that this is <em>not</em> intended to be used as an
|
* <p> Note that this is <em>not</em> intended to be used as an
|
||||||
* industrial-strength profiling or performance monitoring tool. The
|
* industrial-strength profiling or performance monitoring tool. The
|
||||||
* checkpoint time interval granularity is in milliseconds, not
|
* checkpoint time interval granularity is in milliseconds, not
|
||||||
* microseconds; and the observer's <code>checkpoint()</code> method
|
* microseconds, and the observer's <code>checkpoint()</code> method
|
||||||
* will never be called until/unless a subsequent call to
|
* will never be called until/unless a subsequent call to
|
||||||
* <code>tick()</code> is made after the requested number of
|
* <code>tick()</code> is made after the requested number of
|
||||||
* milliseconds have passed since the last checkpoint.
|
* milliseconds have passed since the last checkpoint.
|
||||||
@@ -117,6 +117,10 @@ public class PerformanceMonitor
|
|||||||
protected static HashMap _observers = new HashMap();
|
protected static HashMap _observers = new HashMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents the individual actions being tracked by the
|
||||||
|
* <code>PerformanceMonitor</code> class.
|
||||||
|
*/
|
||||||
class PerformanceAction
|
class PerformanceAction
|
||||||
{
|
{
|
||||||
public PerformanceAction (PerformanceObserver obs, String name, long delta)
|
public PerformanceAction (PerformanceObserver obs, String name, long delta)
|
||||||
@@ -155,9 +159,18 @@ class PerformanceAction
|
|||||||
return buf.append("]").toString();
|
return buf.append("]").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The performance observer. */
|
||||||
protected PerformanceObserver _obs;
|
protected PerformanceObserver _obs;
|
||||||
|
|
||||||
|
/** The action name. */
|
||||||
protected String _name;
|
protected String _name;
|
||||||
|
|
||||||
|
/** The number of milliseconds between each checkpoint. */
|
||||||
protected long _delta;
|
protected long _delta;
|
||||||
|
|
||||||
|
/** The time the last time a checkpoint was made. */
|
||||||
protected long _lastDelta;
|
protected long _lastDelta;
|
||||||
|
|
||||||
|
/** The number of ticks since the last checkpoint. */
|
||||||
protected int _numTicks;
|
protected int _numTicks;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: DisplayMisoSceneImpl.java,v 1.25 2001/08/13 05:42:36 shaper Exp $
|
// $Id: DisplayMisoSceneImpl.java,v 1.26 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene;
|
package com.threerings.miso.scene;
|
||||||
|
|
||||||
@@ -65,11 +65,12 @@ public class Scene
|
|||||||
|
|
||||||
_sid = SID_INVALID;
|
_sid = SID_INVALID;
|
||||||
_name = DEF_SCENE_NAME;
|
_name = DEF_SCENE_NAME;
|
||||||
|
|
||||||
_locations = new ArrayList();
|
_locations = new ArrayList();
|
||||||
_clusters = new ArrayList();
|
_clusters = new ArrayList();
|
||||||
_exits = new ArrayList();
|
_exits = new ArrayList();
|
||||||
|
|
||||||
tiles = new Tile[TILE_WIDTH][TILE_HEIGHT][NUM_LAYERS];
|
tiles = new Tile[TILE_WIDTH][TILE_HEIGHT][NUM_LAYERS];
|
||||||
_deftile = _tilemgr.getTile(deftsid, deftid);
|
_deftile = _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++) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: XMLSceneParser.java,v 1.9 2001/08/13 05:42:36 shaper Exp $
|
// $Id: XMLSceneParser.java,v 1.10 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene.xml;
|
package com.threerings.miso.scene.xml;
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ public class XMLSceneParser extends DefaultHandler
|
|||||||
/** The tile manager object for use in constructing scenes. */
|
/** The tile manager object for use in constructing scenes. */
|
||||||
protected TileManager _tilemgr;
|
protected TileManager _tilemgr;
|
||||||
|
|
||||||
// temporary storage of scene object values and data
|
/** Temporary storage of scene object values and data. */
|
||||||
protected StringBuffer _chars;
|
protected StringBuffer _chars;
|
||||||
protected String _scName;
|
protected String _scName;
|
||||||
protected ArrayList _scLocations, _scExits, _scClusters;
|
protected ArrayList _scLocations, _scExits, _scClusters;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: MisoUtil.java,v 1.4 2001/07/24 16:10:19 shaper Exp $
|
// $Id: MisoUtil.java,v 1.5 2001/08/13 15:00:24 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.util;
|
package com.threerings.miso.util;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public class MisoUtil
|
|||||||
/**
|
/**
|
||||||
* Populate the config object with miso configuration values.
|
* Populate the config object with miso configuration values.
|
||||||
*
|
*
|
||||||
* @param config the Config object to populate.
|
* @param config the <code>Config</code> object to populate.
|
||||||
*/
|
*/
|
||||||
public static void bindProperties (Config config) throws IOException
|
public static void bindProperties (Config config) throws IOException
|
||||||
{
|
{
|
||||||
@@ -33,12 +33,12 @@ public class MisoUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a SceneManager object, reading the class name to
|
* Create a <code>SceneManager</code> object, reading the class
|
||||||
* instantiate from the "miso.scenemgr" config value.
|
* name to instantiate from the config object.
|
||||||
*
|
*
|
||||||
* @param config the Config object.
|
* @param config the <code>Config</code> object.
|
||||||
*
|
*
|
||||||
* @return the new SceneManager object or null if an error occurred.
|
* @return the new scene manager object or null if an error occurred.
|
||||||
*/
|
*/
|
||||||
public static SceneManager
|
public static SceneManager
|
||||||
createSceneManager (Config config, TileManager tilemgr)
|
createSceneManager (Config config, TileManager tilemgr)
|
||||||
@@ -59,12 +59,12 @@ public class MisoUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a TileManager object.
|
* Create a <code>TileManager</code> object.
|
||||||
*
|
*
|
||||||
* @param config the Config object.
|
* @param config the <code>Config</code> object.
|
||||||
* @param frame the root frame to which images will be rendered.
|
* @param frame the root frame to which images will be rendered.
|
||||||
*
|
*
|
||||||
* @return the new TileManager object or null if an error occurred.
|
* @return the new tile manager object or null if an error occurred.
|
||||||
*/
|
*/
|
||||||
public static TileManager createTileManager (Config config, Frame frame)
|
public static TileManager createTileManager (Config config, Frame frame)
|
||||||
{
|
{
|
||||||
@@ -77,9 +77,9 @@ public class MisoUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a ResourceManager object.
|
* Create a <code>ResourceManager</code> object.
|
||||||
*
|
*
|
||||||
* @return the new ResourceManager object or null if an error occurred.
|
* @return the new resource manager object or null if an error occurred.
|
||||||
*/
|
*/
|
||||||
protected static ResourceManager createResourceManager ()
|
protected static ResourceManager createResourceManager ()
|
||||||
{
|
{
|
||||||
@@ -97,13 +97,14 @@ public class MisoUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a TileSetManager object, reading the class name to
|
* Create a <code>TileSetManager</code> object, reading the class
|
||||||
* instantiate from the "miso.tilesetmgr" config value.
|
* name to instantiate from the config object.
|
||||||
*
|
*
|
||||||
* @param config the Config object.
|
* @param config the <code>Config</code> object.
|
||||||
* @param imgmgr the ImageManager object from which images are obtained.
|
* @param imgmgr the <code>ImageManager</code> object from which
|
||||||
|
* images are obtained.
|
||||||
*
|
*
|
||||||
* @return the new TileSetManager object or null if an error occurred.
|
* @return the new tileset manager object or null if an error occurred.
|
||||||
*/
|
*/
|
||||||
protected static TileSetManager
|
protected static TileSetManager
|
||||||
createTileSetManager (Config config, ImageManager imgmgr)
|
createTileSetManager (Config config, ImageManager imgmgr)
|
||||||
@@ -122,11 +123,11 @@ public class MisoUtil
|
|||||||
return tilesetmgr;
|
return tilesetmgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The default SceneManager class name. */
|
/** The default scene repository class name. */
|
||||||
protected static final String DEF_SCENEREPO =
|
protected static final String DEF_SCENEREPO =
|
||||||
XMLFileSceneRepository.class.getName();
|
XMLFileSceneRepository.class.getName();
|
||||||
|
|
||||||
/** The default TileSetManager class name. */
|
/** The default tileset manager class name. */
|
||||||
protected static final String DEF_TILESETMGR =
|
protected static final String DEF_TILESETMGR =
|
||||||
EditableTileSetManager.class.getName();
|
EditableTileSetManager.class.getName();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user