mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 14:05:32 +02:00
Add "displayFPS" config option
This commit is contained in:
parent
748aff99cc
commit
23451fb6c0
4 changed files with 14 additions and 4 deletions
|
@ -34,6 +34,13 @@
|
||||||
// "rgssVersion": 1,
|
// "rgssVersion": 1,
|
||||||
|
|
||||||
|
|
||||||
|
// Continuously display average FPS in window title.
|
||||||
|
// This can always be toggled with F2 at runtime.
|
||||||
|
// (default: disabled)
|
||||||
|
//
|
||||||
|
// "displayFPS": false,
|
||||||
|
|
||||||
|
|
||||||
// Continuously print average FPS to console.
|
// Continuously print average FPS to console.
|
||||||
// This setting does not affect the window title
|
// This setting does not affect the window title
|
||||||
// FPS display toggled via F2
|
// FPS display toggled via F2
|
||||||
|
|
|
@ -129,6 +129,7 @@ void Config::read(int argc, char *argv[]) {
|
||||||
auto optsJ = json::object({
|
auto optsJ = json::object({
|
||||||
{"rgssVersion", 0},
|
{"rgssVersion", 0},
|
||||||
{"debugMode", false},
|
{"debugMode", false},
|
||||||
|
{"displayFPS", false},
|
||||||
{"printFPS", false},
|
{"printFPS", false},
|
||||||
{"winResizable", true},
|
{"winResizable", true},
|
||||||
{"fullscreen", false},
|
{"fullscreen", false},
|
||||||
|
@ -250,6 +251,7 @@ try { exp } catch (...) {}
|
||||||
// now RESUME
|
// now RESUME
|
||||||
|
|
||||||
SET_OPT(debugMode, boolean);
|
SET_OPT(debugMode, boolean);
|
||||||
|
SET_OPT(displayFPS, boolean);
|
||||||
SET_OPT(printFPS, boolean);
|
SET_OPT(printFPS, boolean);
|
||||||
SET_OPT(fullscreen, boolean);
|
SET_OPT(fullscreen, boolean);
|
||||||
SET_OPT(fixedAspectRatio, boolean);
|
SET_OPT(fixedAspectRatio, boolean);
|
||||||
|
|
|
@ -37,6 +37,7 @@ struct Config {
|
||||||
bool debugMode;
|
bool debugMode;
|
||||||
bool winConsole;
|
bool winConsole;
|
||||||
bool preferMetalRenderer;
|
bool preferMetalRenderer;
|
||||||
|
bool displayFPS;
|
||||||
bool printFPS;
|
bool printFPS;
|
||||||
|
|
||||||
bool winResizable;
|
bool winResizable;
|
||||||
|
|
|
@ -152,10 +152,10 @@ void EventThread::process(RGSSThreadData &rtData)
|
||||||
fullscreen = rtData.config.fullscreen;
|
fullscreen = rtData.config.fullscreen;
|
||||||
int toggleFSMod = rtData.config.anyAltToggleFS ? KMOD_ALT : KMOD_LALT;
|
int toggleFSMod = rtData.config.anyAltToggleFS ? KMOD_ALT : KMOD_LALT;
|
||||||
|
|
||||||
if (rtData.config.printFPS)
|
bool displayingFPS = rtData.config.displayFPS;
|
||||||
fps.sendUpdates.set();
|
|
||||||
|
|
||||||
bool displayingFPS = false;
|
if (displayingFPS || rtData.config.printFPS)
|
||||||
|
fps.sendUpdates.set();
|
||||||
|
|
||||||
bool cursorInWindow = false;
|
bool cursorInWindow = false;
|
||||||
/* Will be updated eventually */
|
/* Will be updated eventually */
|
||||||
|
|
Loading…
Add table
Reference in a new issue