mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-11 17:10:24 -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() {
|
private final void configureTargetFPS() {
|
||||||
int refreshRate = getCurrentDevice().getDisplayMode().getRefreshRate();
|
int targetFps = 0;
|
||||||
if (refreshRate == java.awt.DisplayMode.REFRESH_RATE_UNKNOWN) {
|
String clientFps = System.getProperty("clientFps");
|
||||||
refreshRate = 60; //just assume 60hz and call it a day.
|
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")
|
@OriginalMember(owner = "client!rc", name = "windowOpened", descriptor = "(Ljava/awt/event/WindowEvent;)V")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue