From f448ebe4f1789080682427177414969b45158e74 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 30 May 2002 22:21:51 +0000 Subject: [PATCH] Create the polygon cache hash with custom parameters to the constructor to optimize memory performance. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1408 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/miso/client/IsoSceneView.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/miso/client/IsoSceneView.java b/src/java/com/threerings/miso/client/IsoSceneView.java index cc4a82755..2118496a1 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.108 2002/04/27 23:07:41 mdb Exp $ +// $Id: IsoSceneView.java,v 1.109 2002/05/30 22:21:51 ray Exp $ package com.threerings.miso.scene; @@ -78,9 +78,11 @@ public class IsoSceneView implements SceneView _model = model; _remgr = remgr; - // create our polygon arrays, these will be populated with the - // tile polygons as they are requested - _polys = new HashIntMap(); + // create a cache which will be populated with the tile polygons + // as they are requested. We manually adjust the size/load factor + // to optimize memory usage (because we happen to know things + // hash weirdly because of the way we make the keys. + _polys = new HashIntMap(model.scenewid, (float) model.scenehei); // create the array used to mark dirty tiles _dirty = new boolean[model.scenewid][model.tilehei];