Add hooks so that other fringers can muck around with tiles to

do art swapish stuff.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@93 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2006-12-13 21:53:10 +00:00
parent 23f305aa81
commit 11f82ff097
@@ -61,6 +61,13 @@ public class AutoFringer
_tmgr = tmgr; _tmgr = tmgr;
} }
/**
* Returns the fringe configuration used by this fringer.
*/
public FringeConfiguration getFringeConf () {
return _fringeconf;
}
/** /**
* Compute and return the fringe tile to be inserted at the specified * Compute and return the fringe tile to be inserted at the specified
* location. * location.
@@ -69,7 +76,7 @@ public class AutoFringer
HashMap masks) HashMap masks)
{ {
// get the tileset id of the base tile we are considering // get the tileset id of the base tile we are considering
int underset = scene.getBaseTileId(col, row) >> 16; int underset = adjustTileSetId(scene.getBaseTileId(col, row) >> 16);
// start with a clean temporary fringer map // start with a clean temporary fringer map
_fringers.clear(); _fringers.clear();
@@ -85,8 +92,8 @@ public class AutoFringer
// determine the tileset for this tile // determine the tileset for this tile
int btid = scene.getBaseTileId(x, y); int btid = scene.getBaseTileId(x, y);
int baseset = (btid <= 0) ? int baseset = adjustTileSetId((btid <= 0) ?
scene.getDefaultBaseTileSet() : (btid >> 16); scene.getDefaultBaseTileSet() : (btid >> 16));
// determine if it fringes on our tile // determine if it fringes on our tile
int pri = _fringeconf.fringesOn(baseset, underset); int pri = _fringeconf.fringesOn(baseset, underset);
@@ -280,6 +287,15 @@ public class AutoFringer
return ret; return ret;
} }
/**
* Allow subclasses to apply arbitrary modifications to tileset ids for
* whatever nefarious purposes they may have.
*/
protected int adjustTileSetId (int tileSetId) {
// by default, nothing.
return tileSetId;
}
/** /**
* A record for holding information about a particular fringe as we're * A record for holding information about a particular fringe as we're
* computing what it will look like. * computing what it will look like.