From 80ac8a280f01af5f83b33e5f8fea86292ddfe574 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 17 Sep 2002 21:17:15 +0000 Subject: [PATCH] Whoops, need to be a bit more careful with the tile cache. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1701 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/tile/TileSet.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/media/tile/TileSet.java b/src/java/com/threerings/media/tile/TileSet.java index ac2914136..b5a2743ab 100644 --- a/src/java/com/threerings/media/tile/TileSet.java +++ b/src/java/com/threerings/media/tile/TileSet.java @@ -1,5 +1,5 @@ // -// $Id: TileSet.java,v 1.30 2002/09/17 20:38:42 mdb Exp $ +// $Id: TileSet.java,v 1.31 2002/09/17 21:17:15 mdb Exp $ package com.threerings.media.tile; @@ -71,8 +71,9 @@ public abstract class TileSet { _imagePath = imagePath; - // clear out any reference to a loaded image + // clear out any reference to a loaded image and cached tiles _tilesetImg = null; + _tiles = null; } /** @@ -127,6 +128,16 @@ public abstract class TileSet return tset; } + // documentation inherited + public Object clone () + throws CloneNotSupportedException + { + TileSet dup = (TileSet)clone(); + // clear out the tileset cache + dup._tiles = null; + return dup; + } + /** * Returns a new tileset that is a clone of this tileset with the * image path updated to reference the given path. Useful for @@ -296,7 +307,7 @@ public abstract class TileSet /** A sparse array containing the tiles that have been requested from * this tileset. */ - protected Tile[] _tiles; + protected transient Tile[] _tiles; /** The entity from which we obtain our tile image. */ protected transient ImageProvider _improv;