More useful debugging information.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2605 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-05-23 19:35:11 +00:00
parent 328f4786ba
commit 3bacbbe803
3 changed files with 29 additions and 10 deletions
@@ -1,5 +1,5 @@
//
// $Id: MisoScenePanel.java,v 1.37 2003/05/22 16:10:54 mdb Exp $
// $Id: MisoScenePanel.java,v 1.38 2003/05/23 19:35:11 mdb Exp $
package com.threerings.miso.client;
@@ -606,7 +606,8 @@ public class MisoScenePanel extends VirtualMediaPanel
_delayRepaint = mightDelayPaint;
Log.info("Delaying repaint... " +
"[need=" + _visiBlocks.size() +
", of=" + _pendingBlocks + "].");
", of=" + _pendingBlocks +
", view=" + StringUtil.toString(_vbounds) + "].");
}
}
}
@@ -695,6 +696,7 @@ public class MisoScenePanel extends VirtualMediaPanel
_metrics.blockwid, _metrics.blockhei);
boolean visible =
block.getFootprint().getBounds().intersects(_vibounds);
block.setVisiBlock(visible);
_blocks.put(bkey, block);
// queue the block up to be resolved
@@ -742,8 +744,9 @@ public class MisoScenePanel extends VirtualMediaPanel
// we go extra on the height because objects
// below can influence fairly high up
_vbounds.height+3*infbory);
_vibounds.setBounds(_vbounds.x, _vbounds.y,
_vbounds.width, _vbounds.height+infbory);
_vibounds.setBounds(_vbounds.x-_vbounds.width/4, _vbounds.y,
_vbounds.width+_vbounds.width/2,
_vbounds.height+infbory);
}
/**
@@ -799,14 +802,16 @@ public class MisoScenePanel extends VirtualMediaPanel
}
--_pendingBlocks;
if (_pendingBlocks == 0) {
Log.info("Finished resolving pending blocks.");
Log.info("Finished resolving pending blocks " +
"[view=" + StringUtil.toString(_vbounds) + "].");
}
// once all the visible pending blocks have completed their
// resolution, recompute our visible object set and show ourselves
if (_visiBlocks.remove(block) && _visiBlocks.size() == 0) {
recomputeVisible();
Log.info("Restoring repaint... [left=" + _pendingBlocks + "].");
Log.info("Restoring repaint... [left=" + _pendingBlocks +
", view=" + StringUtil.toString(_vbounds) + "].");
_delayRepaint = false;
_remgr.invalidateRegion(_vbounds);
}
@@ -1,5 +1,5 @@
//
// $Id: SceneBlock.java,v 1.15 2003/05/12 02:03:31 mdb Exp $
// $Id: SceneBlock.java,v 1.16 2003/05/23 19:35:11 mdb Exp $
package com.threerings.miso.client;
@@ -52,6 +52,15 @@ public class SceneBlock
// the rest of our resolution will happen in resolve()
}
/**
* Makes a note that this block was considered to be visible at the
* time it was created. This is purely for debugging purposes.
*/
public void setVisiBlock (boolean visi)
{
_visi = visi;
}
/**
* This method is called by the {@link SceneBlockResolver} on the
* block resolution thread to allow us to load up our image data
@@ -337,7 +346,8 @@ public class SceneBlock
int by = MathUtil.floorDiv(_bounds.y, _bounds.height);
return StringUtil.coordsToString(bx, by) + ":" +
StringUtil.toString(_bounds) + ":" +
((_objects == null) ? 0 : _objects.length);
((_objects == null) ? 0 : _objects.length) +
(_visi ? ":v" : ":i");
}
/**
@@ -460,6 +470,9 @@ public class SceneBlock
/** Our neighbors in the eight cardinal directions. */
protected SceneBlock[] _neighbors = new SceneBlock[DX.length];
/** A debug flag indicating whether we were visible at creation. */
protected boolean _visi;
// used to link up to our neighbors
protected static final int[] DX = { -1, -1, 0, 1, 1, 1, 0, -1 };
protected static final int[] DY = { 0, -1, -1, -1, 0, 1, 1, 1 };
@@ -1,5 +1,5 @@
//
// $Id: SceneBlockResolver.java,v 1.7 2003/05/22 22:18:27 mdb Exp $
// $Id: SceneBlockResolver.java,v 1.8 2003/05/23 19:35:11 mdb Exp $
package com.threerings.miso.client;
@@ -87,12 +87,13 @@ public class SceneBlockResolver extends LoopingThread
}
// queue it up on the AWT thread to complete its resolution
final boolean report = (_queue.size() == 0);
EventQueue.invokeLater(new Runnable() {
public void run () {
// let the block's panel know that it is resolved
block.wasResolved();
// report statistics
if (_queue.size() == 0) {
if (report) {
Log.info("Resolution histogram " +
_histo.summarize() + ".");
}