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
+20 -11
View File
@@ -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() {