From 152344f223fc31f72d8ccc063abbedafd1a3c603 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 10 Mar 2003 09:24:04 +0000 Subject: [PATCH] Merged grabNewObjects and prepareObjectList into one method: refreshObjectList, so that we can remove objects as well as add them. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2301 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/miso/client/IsoSceneView.java | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/java/com/threerings/miso/client/IsoSceneView.java b/src/java/com/threerings/miso/client/IsoSceneView.java index ec5cd68b6..691cb426c 100644 --- a/src/java/com/threerings/miso/client/IsoSceneView.java +++ b/src/java/com/threerings/miso/client/IsoSceneView.java @@ -1,5 +1,5 @@ // -// $Id: IsoSceneView.java,v 1.133 2003/02/14 22:10:48 mdb Exp $ +// $Id: IsoSceneView.java,v 1.134 2003/03/10 09:24:04 ray Exp $ package com.threerings.miso.client; @@ -109,7 +109,7 @@ public class IsoSceneView implements SceneView // obtain a list of the objects in the scene and generate records // for each of them that contain precomputed metrics - prepareObjectList(); + refreshObjectList(); // invalidate the entire screen as there's a new scene in town; // making sure we're on the AWT thread @@ -129,12 +129,15 @@ public class IsoSceneView implements SceneView * weren't there last time around and adds info for them into the * scene. */ - public void grabNewObjects () + public void refreshObjectList () { + _objects.clear(); + // grab all available objects Rectangle rect = new Rectangle(Short.MIN_VALUE, Short.MIN_VALUE, 2*Short.MAX_VALUE, 2*Short.MAX_VALUE); _scene.getObjects(rect, _objects); + addAdditionalObjects(_objects); // and fill in the new objects' bounds int ocount = _objects.size(); @@ -483,29 +486,6 @@ public class IsoSceneView implements SceneView list.appendDirtySprite(sprite, _tcoords.x, _tcoords.y); } - /** - * Generates and stores bounding polygons for all object tiles in the - * scene for later use while rendering. - */ - protected void prepareObjectList () - { - // clear out any previously existing object data - _objects.clear(); - - // grab all available objects - Rectangle rect = new Rectangle(Short.MIN_VALUE, Short.MIN_VALUE, - 2*Short.MAX_VALUE, 2*Short.MAX_VALUE); - _scene.getObjects(rect, _objects); - addAdditionalObjects(_objects); - - // and fill in those objects' bounds - int ocount = _objects.size(); - for (int ii = 0; ii < ocount; ii++) { - DisplayObjectInfo scobj = (DisplayObjectInfo)_objects.get(ii); - scobj.bounds = IsoUtil.getObjectBounds(_model, scobj); - } - } - /** * A place for subclasses to add any additional scene objects they * may have.