From 5d5a0e8173dcebcd613f6dcf2d7bafb08e6e4497 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 24 Apr 2003 21:27:23 +0000 Subject: [PATCH] Allow base tiles to be cleared out; clear out the fringe when a base tile is updated because the caller will need to recompute it. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2453 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/miso/client/SceneBlock.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/miso/client/SceneBlock.java b/src/java/com/threerings/miso/client/SceneBlock.java index 05f976ffc..df3aa445d 100644 --- a/src/java/com/threerings/miso/client/SceneBlock.java +++ b/src/java/com/threerings/miso/client/SceneBlock.java @@ -1,5 +1,5 @@ // -// $Id: SceneBlock.java,v 1.8 2003/04/23 00:45:24 mdb Exp $ +// $Id: SceneBlock.java,v 1.9 2003/04/24 21:27:23 mdb Exp $ package com.threerings.miso.client; @@ -148,6 +148,7 @@ public class SceneBlock public void updateBaseTile (int fqTileId, int tx, int ty) { String errmsg = null; + int tidx = index(tx, ty); // this is a bit magical: we pass the fully qualified tile id to // the tile manager which loads up from the configured tileset @@ -155,8 +156,15 @@ public class SceneBlock // BaseTileSet) and then extracts the appropriate base tile (the // index of which is also in the fqTileId) try { - _base[index(tx, ty)] = (BaseTile) - _panel.getTileManager().getTile(fqTileId); + if (fqTileId <= 0) { + _base[tidx] = null; + } else { + _base[tidx] = (BaseTile) + _panel.getTileManager().getTile(fqTileId); + } + // clear out the fringe (it must be recomputed by the caller) + _fringe[tidx] = null; + } catch (ClassCastException cce) { errmsg = "Scene contains non-base tile in base layer"; } catch (NoSuchTileSetException nste) {