From 6cda5d5c7853c4d272c879c33959864afcd9743c Mon Sep 17 00:00:00 2001 From: Danial Date: Mon, 11 Nov 2019 17:32:33 +1300 Subject: [PATCH] Disable graphics, lower CPU & GPU usage (#168) * Fix local Parabot instructions * Add kick command, and force logout function * Add graphics toggle option * add alias --- 2006Redone Client/src/Game.java | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/2006Redone Client/src/Game.java b/2006Redone Client/src/Game.java index 0e912e82..f88fb3b9 100644 --- a/2006Redone Client/src/Game.java +++ b/2006Redone Client/src/Game.java @@ -31,6 +31,7 @@ import java.util.Date; */ @SuppressWarnings("serial") public class Game extends RSApplet { + private boolean graphicsEnabled = true; public static String intToKOrMilLongName(int i) { String s = String.valueOf(i); @@ -4770,6 +4771,9 @@ public class Game extends RSApplet { inputTaken = true; } if ((j == 13 || j == 10) && inputString.length() > 0) { + if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx")) { + graphicsEnabled = !graphicsEnabled; + } if (myPrivilege == 2) { if (inputString.equals("::clientdrop")) { dropClient(); @@ -11483,20 +11487,25 @@ public class Game extends RSApplet { Model.anInt1685 = super.mouseX - 4; Model.anInt1686 = super.mouseY - 4; DrawingArea.setAllPixelsToZero(); - // xxx disables graphics if(graphicsEnabled){ - worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve); - worldController.clearObj5Cache(); - updateEntities(); - drawHeadIcon(); + if(graphicsEnabled){ + worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve); + worldController.clearObj5Cache(); + updateEntities(); + drawHeadIcon(); + } + // Allow tabs to work method37(k2); + // Allow stuff inside the tabs to work draw3dScreen(); + // Show overlays on main screen aRSImageProducer_1165.drawGraphics(4, super.graphics, 4); - xCameraPos = l; - zCameraPos = i1; - yCameraPos = j1; - yCameraCurve = k1; - xCameraCurve = l1; - // } + if(graphicsEnabled) { + xCameraPos = l; + zCameraPos = i1; + yCameraPos = j1; + yCameraCurve = k1; + xCameraCurve = l1; + } } public void closeOpenInterfaces() {