Incorporate height into the GroundItems overlay

This commit is contained in:
oplosthee
2018-01-24 15:18:29 +01:00
parent 6e8c48774b
commit 300fa9c8f6
4 changed files with 16 additions and 5 deletions

View File

@@ -26,6 +26,8 @@ package net.runelite.api;
public interface ItemLayer extends TileObject
{
int getHeight();
Renderable getBottom();
Renderable getMiddle();

View File

@@ -45,6 +45,8 @@ public interface TileObject
Point getCanvasLocation();
Point getCanvasLocation(int zOffset);
Polygon getCanvasTilePoly();
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);

View File

@@ -228,7 +228,7 @@ public class GroundItemsOverlay extends Overlay
for (int i = 0; i < itemIds.size(); ++i)
{
Point point = itemLayer.getCanvasLocation();
Point point = itemLayer.getCanvasLocation(itemLayer.getHeight());
// if the item is offscreen, don't bother drawing it
if (point == null || (viewport != null && !viewport.contains(point)))
{

View File

@@ -85,16 +85,23 @@ public abstract class TileObjectMixin implements TileObject
@Inject
public Point getRegionLocation()
{
Point locaLocation = getLocalLocation();
return new Point(locaLocation.getX() >>> LOCAL_COORD_BITS, locaLocation.getY() >>> LOCAL_COORD_BITS);
Point localLocation = getLocalLocation();
return new Point(localLocation.getX() >>> LOCAL_COORD_BITS, localLocation.getY() >>> LOCAL_COORD_BITS);
}
@Override
@Inject
public Point getCanvasLocation()
{
Point locaLocation = getLocalLocation();
return Perspective.worldToCanvas(client, locaLocation.getX(), locaLocation.getY(), 0);
return getCanvasLocation(0);
}
@Override
@Inject
public Point getCanvasLocation(int zOffset)
{
Point localLocation = getLocalLocation();
return Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), 0, zOffset);
}
@Override