mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2026-08-01 14:39:16 -06:00
Fixed render loop slowing down update loop if OpenGL performance was being limited by a power target
This commit is contained in:
parent
e6aaa283ff
commit
0f5da09916
4 changed files with 30 additions and 8 deletions
|
|
@ -534,7 +534,10 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
|
||||
updateDelta = currentTime - lastUpdateTime;
|
||||
if (updateDelta >= FIXED_UPDATE_RATE * 1_000_000) {
|
||||
this.mainLoopWrapper();
|
||||
logicCycles = timer.count(minimumDelay, (int)FIXED_UPDATE_RATE);
|
||||
for (int cycle = 0; cycle < logicCycles; ++cycle) {
|
||||
this.mainLoopWrapper();
|
||||
}
|
||||
lastUpdateTime = currentTime;
|
||||
flush(signLink, canvas);
|
||||
}
|
||||
|
|
@ -544,13 +547,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
this.mainInputLoop();
|
||||
this.mainRedrawWrapper();
|
||||
lastDrawTime = currentTime;
|
||||
|
||||
if (VARIABLE_RENDER_RATE > minimumDelay) {
|
||||
timer.sleep(minimumDelay, (int) VARIABLE_RENDER_RATE);
|
||||
} else {
|
||||
// encourage thread switching
|
||||
Thread.yield();
|
||||
}
|
||||
Thread.yield();
|
||||
}
|
||||
}
|
||||
} catch (@Pc(198) Exception ex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue