project(internal): Move a couple methods to mixins
This commit is contained in:
@@ -41,21 +41,18 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.BufferProvider;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.MainBufferProvider;
|
||||
import net.runelite.api.RenderOverview;
|
||||
import net.runelite.api.Renderable;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.WorldMapManager;
|
||||
import net.runelite.api.events.BeforeMenuRender;
|
||||
import net.runelite.api.events.BeforeRender;
|
||||
import net.runelite.api.events.FakeXpDrop;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.hooks.Callbacks;
|
||||
import net.runelite.api.hooks.DrawCallbacks;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import static net.runelite.api.widgets.WidgetInfo.WORLD_MAP_VIEW;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
@@ -124,6 +121,7 @@ public class Hooks implements Callbacks
|
||||
/**
|
||||
* Get the Graphics2D for the MainBufferProvider image
|
||||
* This caches the Graphics2D instance so it can be reused
|
||||
*
|
||||
* @param mainBufferProvider
|
||||
* @return
|
||||
*/
|
||||
@@ -422,6 +420,7 @@ public class Hooks implements Callbacks
|
||||
|
||||
/**
|
||||
* Copy an image
|
||||
*
|
||||
* @param src
|
||||
* @return
|
||||
*/
|
||||
@@ -568,45 +567,6 @@ public class Hooks implements Callbacks
|
||||
renderableDrawListeners.remove(listener);
|
||||
}
|
||||
|
||||
public static void clearColorBuffer(int x, int y, int width, int height, int color)
|
||||
{
|
||||
BufferProvider bp = client.getBufferProvider();
|
||||
int canvasWidth = bp.getWidth();
|
||||
int[] pixels = bp.getPixels();
|
||||
|
||||
int pixelPos = y * canvasWidth + x;
|
||||
int pixelJump = canvasWidth - width;
|
||||
|
||||
for (int cy = y; cy < y + height; cy++)
|
||||
{
|
||||
for (int cx = x; cx < x + width; cx++)
|
||||
{
|
||||
pixels[pixelPos++] = 0;
|
||||
}
|
||||
pixelPos += pixelJump;
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderDraw(Renderable renderable, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash)
|
||||
{
|
||||
DrawCallbacks drawCallbacks = client.getDrawCallbacks();
|
||||
if (drawCallbacks != null)
|
||||
{
|
||||
drawCallbacks.draw(renderable, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderable.draw(orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean drawMenu()
|
||||
{
|
||||
BeforeMenuRender event = new BeforeMenuRender();
|
||||
client.getCallbacks().post(event);
|
||||
return event.isConsumed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean draw(Renderable renderable, boolean drawingUi)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user