A few substantial changes:

- Tiles are initialized after being constructed which makes life simpler
  for custom tiles which no longer have to have their own constructor that
  passes Tile's stuff down to it.

- Tiles are no longer LRU cached (because we blow through that cache
  instantly on all but the smallest of scenes), and are now tracked by
  weak references so that we guarantee that only one instance of a tile is
  ever in memory.

- Added code to track and report memory usage of weak cached tiles as well
  as "stray" tiles which are created through other means than asking a
  TileSet for a tile (fringe tiles being the most prolific example).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2628 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-05-31 00:56:38 +00:00
parent 6d3d80c58e
commit 73a4a02aa1
15 changed files with 286 additions and 283 deletions
@@ -1,11 +1,11 @@
//
// $Id: BaseTileSet.java,v 1.12 2003/01/15 09:11:37 mdb Exp $
// $Id: BaseTileSet.java,v 1.13 2003/05/31 00:56:38 mdb Exp $
package com.threerings.miso.tile;
import com.samskivert.util.StringUtil;
import com.threerings.media.image.Mirage;
import com.threerings.media.image.Colorization;
import com.threerings.media.tile.SwissArmyTileSet;
import com.threerings.media.tile.Tile;
@@ -35,9 +35,16 @@ public class BaseTileSet extends SwissArmyTileSet
}
// documentation inherited
protected Tile createTile (int tileIndex, Mirage tileImage)
protected Tile createTile ()
{
return new BaseTile(tileImage, _passable[tileIndex]);
return new BaseTile();
}
// documentation inherited
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
{
super.initTile(tile, tileIndex, zations);
((BaseTile)tile).setPassable(_passable[tileIndex]);
}
// documentation inherited