mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
idle fps configurable via config file
This commit is contained in:
@@ -360,10 +360,12 @@ public class App implements ApplicationListener {
|
||||
appConfig.useVsync(getConfigBoolean("usevsync"));
|
||||
appConfig.setResizable(false);
|
||||
appConfig.setWindowedMode(width, height);
|
||||
int fps = Math.min(GLOBAL_FRAMERATE_LIMIT, getConfigInt("displayfps"));
|
||||
if (fps <= 0) fps = GLOBAL_FRAMERATE_LIMIT;
|
||||
appConfig.setIdleFPS(fps);
|
||||
appConfig.setForegroundFPS(fps);
|
||||
int fpsActive = Math.min(GLOBAL_FRAMERATE_LIMIT, getConfigInt("displayfps"));
|
||||
if (fpsActive <= 0) fpsActive = GLOBAL_FRAMERATE_LIMIT;
|
||||
int fpsBack = Math.min(GLOBAL_FRAMERATE_LIMIT, getConfigInt("displayfpsidle"));
|
||||
if (fpsBack <= 0) fpsBack = GLOBAL_FRAMERATE_LIMIT;
|
||||
appConfig.setIdleFPS(fpsBack);
|
||||
appConfig.setForegroundFPS(fpsActive);
|
||||
appConfig.setTitle(GAME_NAME);
|
||||
//appConfig.forceExit = true; // it seems KDE 5 likes this one better...
|
||||
// (Plasma freezes upon app exit. with forceExit = true, it's only frozen for a minute; with forceExit = false, it's indefinite)
|
||||
|
||||
@@ -11,6 +11,7 @@ object DefaultConfig {
|
||||
|
||||
val hashMap = hashMapOf<String, Any>(
|
||||
"displayfps" to 0, // 0: no limit, non-zero: limit
|
||||
"displayfpsidle" to 0, // 0: no limit, non-zero: limit
|
||||
"displaycolourdepth" to 8,
|
||||
"usevsync" to false,
|
||||
"screenwidth" to TerrarumScreenSize.defaultW,
|
||||
|
||||
Reference in New Issue
Block a user