From ea3adbb530360de014e989dcdba098a47ed8f036 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 23 Apr 2003 00:45:24 +0000 Subject: [PATCH] Use the compose() method which properly handles negative y values. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2448 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/miso/client/SceneBlock.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/miso/client/SceneBlock.java b/src/java/com/threerings/miso/client/SceneBlock.java index dad3c647f..05f976ffc 100644 --- a/src/java/com/threerings/miso/client/SceneBlock.java +++ b/src/java/com/threerings/miso/client/SceneBlock.java @@ -1,5 +1,5 @@ // -// $Id: SceneBlock.java,v 1.7 2003/04/23 00:37:46 mdb Exp $ +// $Id: SceneBlock.java,v 1.8 2003/04/23 00:45:24 mdb Exp $ package com.threerings.miso.client; @@ -301,15 +301,17 @@ public class SceneBlock /** Computes the key of our neighbor. */ protected final int neighborKey (int dx, int dy) { - return ((short)(MathUtil.floorDiv(_bounds.x, _bounds.width)+dx) << 16 | - (short)(MathUtil.floorDiv(_bounds.y, _bounds.height)+dy)); + int nx = MathUtil.floorDiv(_bounds.x, _bounds.width)+dx; + int ny = MathUtil.floorDiv(_bounds.y, _bounds.height)+dy; + return MisoScenePanel.compose(nx, ny); } /** Computes the key for the block that holds the specified tile. */ protected final int blockKey (int tx, int ty) { - return ((short)MathUtil.floorDiv(tx, _bounds.width) << 16 | - (short)MathUtil.floorDiv(ty, _bounds.height)); + int bx = MathUtil.floorDiv(tx, _bounds.width); + int by = MathUtil.floorDiv(ty, _bounds.height); + return MisoScenePanel.compose(bx, by); } /**