Disable graphics, lower CPU & GPU usage (#168)

* Fix local Parabot instructions

* Add kick command, and force logout function

* Add graphics toggle option

* add alias
This commit is contained in:
Danial
2019-11-11 17:32:33 +13:00
committed by Daniel Ginovker
parent d53ed61064
commit 6cda5d5c78
+11 -2
View File
@@ -31,6 +31,7 @@ import java.util.Date;
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Game extends RSApplet { public class Game extends RSApplet {
private boolean graphicsEnabled = true;
public static String intToKOrMilLongName(int i) { public static String intToKOrMilLongName(int i) {
String s = String.valueOf(i); String s = String.valueOf(i);
@@ -4770,6 +4771,9 @@ public class Game extends RSApplet {
inputTaken = true; inputTaken = true;
} }
if ((j == 13 || j == 10) && inputString.length() > 0) { if ((j == 13 || j == 10) && inputString.length() > 0) {
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx")) {
graphicsEnabled = !graphicsEnabled;
}
if (myPrivilege == 2) { if (myPrivilege == 2) {
if (inputString.equals("::clientdrop")) { if (inputString.equals("::clientdrop")) {
dropClient(); dropClient();
@@ -11483,20 +11487,25 @@ public class Game extends RSApplet {
Model.anInt1685 = super.mouseX - 4; Model.anInt1685 = super.mouseX - 4;
Model.anInt1686 = super.mouseY - 4; Model.anInt1686 = super.mouseY - 4;
DrawingArea.setAllPixelsToZero(); DrawingArea.setAllPixelsToZero();
// xxx disables graphics if(graphicsEnabled){ if(graphicsEnabled){
worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve); worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
worldController.clearObj5Cache(); worldController.clearObj5Cache();
updateEntities(); updateEntities();
drawHeadIcon(); drawHeadIcon();
}
// Allow tabs to work
method37(k2); method37(k2);
// Allow stuff inside the tabs to work
draw3dScreen(); draw3dScreen();
// Show overlays on main screen
aRSImageProducer_1165.drawGraphics(4, super.graphics, 4); aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
if(graphicsEnabled) {
xCameraPos = l; xCameraPos = l;
zCameraPos = i1; zCameraPos = i1;
yCameraPos = j1; yCameraPos = j1;
yCameraCurve = k1; yCameraCurve = k1;
xCameraCurve = l1; xCameraCurve = l1;
// } }
} }
public void closeOpenInterfaces() { public void closeOpenInterfaces() {