Ensure that we always eventually claim to be resolved.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2467 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: MisoScenePanel.java,v 1.15 2003/04/25 22:13:14 mdb Exp $
|
||||
// $Id: MisoScenePanel.java,v 1.16 2003/04/26 02:16:18 mdb Exp $
|
||||
|
||||
package com.threerings.miso.client;
|
||||
|
||||
@@ -661,7 +661,7 @@ public class MisoScenePanel extends VirtualMediaPanel
|
||||
// if this block has objects that intersect our visible bounds
|
||||
// (zoiks!) then repaint
|
||||
Rectangle sbounds = block.getScreenBounds();
|
||||
if (sbounds.intersects(_vbounds)) {
|
||||
if (sbounds != null && sbounds.intersects(_vbounds)) {
|
||||
// Log.info("Eek, block came into view during resolution " +
|
||||
// block + ".");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SceneBlock.java,v 1.11 2003/04/25 22:13:14 mdb Exp $
|
||||
// $Id: SceneBlock.java,v 1.12 2003/04/26 02:16:18 mdb Exp $
|
||||
|
||||
package com.threerings.miso.client;
|
||||
|
||||
@@ -48,9 +48,6 @@ public class SceneBlock
|
||||
_footprint = MisoUtil.getFootprintPolygon(
|
||||
panel.getSceneMetrics(), tx, ty, width, height);
|
||||
|
||||
// start with the bounds of the footprint polygon
|
||||
_sbounds = new Rectangle(_footprint.getBounds());
|
||||
|
||||
// the rest of our resolution will happen in resolve()
|
||||
}
|
||||
|
||||
@@ -59,7 +56,7 @@ public class SceneBlock
|
||||
* block resolution thread to allow us to load up our image data
|
||||
* without blocking the AWT thread.
|
||||
*/
|
||||
protected synchronized boolean resolve ()
|
||||
protected boolean resolve ()
|
||||
{
|
||||
// if we got canned before we were resolved, go ahead and bail now
|
||||
if (_panel.getBlock(_bounds.x, _bounds.y) != this) {
|
||||
@@ -67,6 +64,9 @@ public class SceneBlock
|
||||
return false;
|
||||
}
|
||||
|
||||
// start with the bounds of the footprint polygon
|
||||
Rectangle sbounds = new Rectangle(_footprint.getBounds());
|
||||
|
||||
// resolve our base tiles
|
||||
MisoSceneModel model = _panel.getSceneModel();
|
||||
for (int yy = 0; yy < _bounds.height; yy++) {
|
||||
@@ -97,7 +97,7 @@ public class SceneBlock
|
||||
_objects = new SceneObject[set.size()];
|
||||
for (int ii = 0; ii < _objects.length; ii++) {
|
||||
_objects[ii] = new SceneObject(_panel, set.get(ii));
|
||||
_sbounds.add(_objects[ii].bounds);
|
||||
sbounds.add(_objects[ii].bounds);
|
||||
}
|
||||
|
||||
// resolve our default tileset
|
||||
@@ -111,6 +111,12 @@ public class SceneBlock
|
||||
", error=" + e + "].");
|
||||
}
|
||||
|
||||
// this both marks us as resolved and makes all our other updated
|
||||
// fields visible
|
||||
synchronized (this) {
|
||||
_sbounds = sbounds;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -126,9 +132,9 @@ public class SceneBlock
|
||||
/**
|
||||
* Returns true if this block has been resolved, false if not.
|
||||
*/
|
||||
protected boolean isResolved ()
|
||||
protected synchronized boolean isResolved ()
|
||||
{
|
||||
return (_defset != null);
|
||||
return _sbounds != null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user