mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2026-08-01 14:39:16 -06:00
These changes fix the HD-Mode lag and crashes that happen when the client is launched into HD-Mode or when changing into HD-Mode..
In Windows, on first launch into HD-Mode or at launch going from SD-Mods to HD-Mode, the CPU maxes out and music issues, and is unable to enter into HD-Mode without lag or multiple crashes. This is because when the code that is supposed to execute GLProfile.initSingleton() waits for its turn on syncronized function queue and then a while loop keeps sleeping the thread until a status code of 1 is returned. Additionally, starting with jogl version 2.0 GLProfile.initSingleton() is not even necessary as its automatically done. The code commented out has no purpose other than just to execute GLProfile.initSingleton(). Commented out the code and made comments to preserve the original code.
This commit is contained in:
parent
ae7723b0d2
commit
51b15b32d5
2 changed files with 23 additions and 8 deletions
|
|
@ -178,13 +178,28 @@ public final class DisplayMode {
|
|||
} else {
|
||||
SoftwareRaster.frameBuffer = null;
|
||||
}
|
||||
@Pc(300) PrivilegedRequest local300 = GameShell.signLink.loadGlNatives(client.instance.getClass());
|
||||
while (local300.status == 0) {
|
||||
ThreadUtils.sleep(100L);
|
||||
}
|
||||
if (local300.status == 1) {
|
||||
aBoolean73 = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code below tries to trigger GLProfile.initSingleton() through a queue in PrivilegedRequest where it waits
|
||||
* for its turn. This along with the while loop waits to return status code 1 which causes
|
||||
* lag and delay when switching to HD Mode.
|
||||
* GLProfile.initSingleton() is automatically run starting with jogl 2.0 and later. So no need to execute it.
|
||||
* After it returns status code 1, it also sets an important variable aBoolean73 to true
|
||||
* when the queue executes successfully.
|
||||
* This triggers the needed GLRenderer.init() function which we can control to be true manually.
|
||||
**/
|
||||
|
||||
/**
|
||||
@Pc(300) PrivilegedRequest local300 = GameShell.signLink.loadGlNatives(client.instance.getClass());
|
||||
while (local300.status == 0) {
|
||||
ThreadUtils.sleep(100L);
|
||||
}
|
||||
if (local300.status == 1) {
|
||||
aBoolean73 = true;
|
||||
}
|
||||
*/
|
||||
|
||||
aBoolean73 = true; // Manually set here to allow GLRenderer.init() to execute.
|
||||
}
|
||||
if (aBoolean73) {
|
||||
GlRenderer.init(GameShell.canvas, Preferences.antiAliasingMode * 2);
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ public final class SignLink implements Runnable {
|
|||
}
|
||||
request.result = ((Class) args[0]).getDeclaredField((String) args[1]);
|
||||
} else if (type == 10) {
|
||||
GLProfile.initSingleton();
|
||||
//GLProfile.initSingleton(); //this is no longer necessary with jogl versions 2.0+.
|
||||
} else if (type == 11) {
|
||||
GLProfile.shutdown();
|
||||
} else if (type == 12) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue