Added code to enable bounds checking of calls to index. Not enabled by

default because we can generally figure it out from the NPE and this gets
called a crapload so we don't want to negatively impact performance.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2422 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-04-18 23:18:30 +00:00
parent 6e967c699c
commit ffb9e3b4e4
@@ -1,5 +1,5 @@
//
// $Id: SceneBlock.java,v 1.2 2003/04/18 18:33:31 mdb Exp $
// $Id: SceneBlock.java,v 1.3 2003/04/18 23:18:30 mdb Exp $
package com.threerings.miso.client;
@@ -221,6 +221,11 @@ public class SceneBlock
*/
protected final int index (int tx, int ty)
{
// if (!_bounds.contains(tx, ty)) {
// String errmsg = "Coordinates out of bounds: +" + tx + "+" + ty +
// " not in " + StringUtil.toString(_bounds);
// throw new IllegalArgumentException(errmsg);
// }
return (ty-_bounds.y)*_bounds.width + (tx-_bounds.x);
}