mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Configurable FPS
This commit is contained in:
parent
a0b7eebe78
commit
6b0f655434
1 changed files with 11 additions and 4 deletions
|
|
@ -728,11 +728,18 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
}
|
||||
|
||||
private final void configureTargetFPS() {
|
||||
int refreshRate = getCurrentDevice().getDisplayMode().getRefreshRate();
|
||||
if (refreshRate == java.awt.DisplayMode.REFRESH_RATE_UNKNOWN) {
|
||||
refreshRate = 60; //just assume 60hz and call it a day.
|
||||
int targetFps = 0;
|
||||
String clientFps = System.getProperty("clientFps");
|
||||
if (clientFps != null) {
|
||||
targetFps = Integer.parseInt(clientFps); //if invalid number, we're happy to get the exception
|
||||
}
|
||||
if (targetFps == 0) {
|
||||
targetFps = getCurrentDevice().getDisplayMode().getRefreshRate();
|
||||
if (targetFps == java.awt.DisplayMode.REFRESH_RATE_UNKNOWN) {
|
||||
targetFps = 60; //just assume 60hz and call it a day.
|
||||
}
|
||||
}
|
||||
GameShell.setFpsTarget(refreshRate);
|
||||
GameShell.setFpsTarget(targetFps);
|
||||
}
|
||||
|
||||
@OriginalMember(owner = "client!rc", name = "windowOpened", descriptor = "(Ljava/awt/event/WindowEvent;)V")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue