Fix ground marker minimap overlay position

The ground marker minimap overlay gets a local point for the tile to mark from fromWorld()
and passes it to localToMinimap() - but because the adjustment of -1, when the player position
is subtracted from it to compute the minimap location it causes the computed position to be off
by a full tile.

Additionally, drawRect() width and height is inclusive so the width/height must be subtracted by 1
This commit is contained in:
Adam
2021-10-01 19:08:35 -04:00
parent e98c3da758
commit 4ca3db6358
2 changed files with 5 additions and 6 deletions

View File

@@ -115,8 +115,8 @@ public class LocalPoint
public static LocalPoint fromScene(int x, int y)
{
return new LocalPoint(
(x << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1) - 1,
(y << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1) - 1
(x << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1),
(y << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1)
);
}