From 5962fa1e54d6c078796031557740fb4a9069b6be Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 20 Feb 2003 00:40:13 +0000 Subject: [PATCH] Made note of and implemented clearing of fringes when a base tile is set. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2287 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../miso/client/SimpleDisplayMisoSceneImpl.java | 12 +++++++++++- src/java/com/threerings/miso/data/MisoScene.java | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/miso/client/SimpleDisplayMisoSceneImpl.java b/src/java/com/threerings/miso/client/SimpleDisplayMisoSceneImpl.java index 38bfb12f8..6fdec9b4c 100644 --- a/src/java/com/threerings/miso/client/SimpleDisplayMisoSceneImpl.java +++ b/src/java/com/threerings/miso/client/SimpleDisplayMisoSceneImpl.java @@ -1,5 +1,5 @@ // -// $Id: SimpleDisplayMisoSceneImpl.java,v 1.1 2003/02/12 07:21:15 mdb Exp $ +// $Id: SimpleDisplayMisoSceneImpl.java,v 1.2 2003/02/20 00:40:13 ray Exp $ package com.threerings.miso.client; @@ -74,6 +74,16 @@ public class SimpleDisplayMisoSceneImpl extends SimpleMisoSceneImpl { super.setBaseTile(fqTileId, x, y); populateBaseTile(fqTileId, x, y); + + // setting a base tile has the side-effect of clearing out the + // surrounding fringe tiles. + for (int xx=Math.max(x - 1, 0), + xn=Math.min(x + 1, _model.width - 1); xx <= xn; xx++) { + for (int yy=Math.max(y - 1, 0), + yn=Math.min(y + 1, _model.height - 1); yy <= yn; yy++) { + _fringe[yy * _model.width + xx] = null; + } + } } // documentation inherited from interface diff --git a/src/java/com/threerings/miso/data/MisoScene.java b/src/java/com/threerings/miso/data/MisoScene.java index 5201dda85..44c6bfb77 100644 --- a/src/java/com/threerings/miso/data/MisoScene.java +++ b/src/java/com/threerings/miso/data/MisoScene.java @@ -1,5 +1,5 @@ // -// $Id: MisoScene.java,v 1.1 2003/02/12 05:39:15 mdb Exp $ +// $Id: MisoScene.java,v 1.2 2003/02/20 00:40:13 ray Exp $ package com.threerings.miso.data; @@ -32,6 +32,11 @@ public interface MisoScene * TileUtil#getFQTileId}) of the tile to set. * @param x the x-coordinate of the tile to set. * @param y the y-coordinate of the tile to set. + * + * Note that if there are fringe tiles associated with this scene, + * calling this method may result in the surrounding fringe tiles being + * cleared and subsequently recalculated. This should not be called + * on a displaying scene unless you know what you are doing. */ public void setBaseTile (int fqTileId, int x, int y);