mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Make FPS detection aware of unhappy paths
This commit is contained in:
parent
ed4cae15e7
commit
ff3d6e7cdb
1 changed files with 9 additions and 1 deletions
|
|
@ -688,7 +688,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
frame.toFront();
|
||||
@Pc(44) Insets insets = frame.getInsets();
|
||||
frame.setSize(insets.left + frameWidth + insets.right, insets.top + frameHeight + insets.bottom);
|
||||
GameShell.setFpsTarget(getCurrentDevice().getDisplayMode().getRefreshRate());
|
||||
configureTargetFPS();
|
||||
signLink2 = signLink = new SignLink(null, cacheId, cacheSubDir, 28);
|
||||
@Pc(76) PrivilegedRequest request = signLink.startThread(1, this);
|
||||
while (request.status == 0) {
|
||||
|
|
@ -700,6 +700,14 @@ 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.
|
||||
}
|
||||
GameShell.setFpsTarget(refreshRate);
|
||||
}
|
||||
|
||||
@OriginalMember(owner = "client!rc", name = "windowOpened", descriptor = "(Ljava/awt/event/WindowEvent;)V")
|
||||
@Override
|
||||
public final void windowOpened(@OriginalArg(0) WindowEvent event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue