AGS: Added show_fps to config

From upstream 2d6e0fca6bd310822e4f82ed95eb2bb5c116ac65
This commit is contained in:
Paul Gilbert 2022-05-05 22:59:51 -07:00
parent 02bc813aa2
commit d2547418c0
5 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,7 @@ GameSetup::GameSetup() {
clear_cache_on_room_change = false;
load_latest_save = false;
rotation = kScreenRotation_Unlocked;
show_fps = false;
Screen.Params.RefreshRate = 0;
Screen.Params.VSync = false;

View File

@ -95,6 +95,7 @@ struct GameSetup {
bool clear_cache_on_room_change; // for low-end devices: clear resource caches on room change
bool load_latest_save; // load latest saved game on launch
ScreenRotation rotation;
bool show_fps;
DisplayModeSetup Screen;
String software_render_driver;

View File

@ -316,6 +316,7 @@ void apply_config(const ConfigTree &cfg) {
_GP(usetup).load_latest_save = CfgReadBoolInt(cfg, "misc", "load_latest_save", _GP(usetup).load_latest_save);
_GP(usetup).user_data_dir = CfgReadString(cfg, "misc", "user_data_dir");
_GP(usetup).shared_data_dir = CfgReadString(cfg, "misc", "shared_data_dir");
_GP(usetup).show_fps = CfgReadBoolInt(cfg, "misc", "show_fps");
_GP(usetup).translation = CfgReadString(cfg, "language", "translation");

View File

@ -345,6 +345,8 @@ void engine_init_audio() {
}
void engine_init_debug() {
if (_GP(usetup).show_fps)
_G(display_fps) = kFPS_Forced;
if ((_G(debug_flags) & (~DBG_DEBUGMODE)) > 0) {
_G(platform)->DisplayAlert("Engine debugging enabled.\n"
"\nNOTE: You have selected to enable one or more engine debugging options.\n"

View File

@ -261,7 +261,8 @@ int main_process_cmdline(ConfigTree &cfg, int argc, const char *argv[]) {
cfg["language"]["translation"] = argv[++ee];
} else if (ags_stricmp(arg, "--no-translation") == 0) {
cfg["language"]["translation"] = "";
} else if (ags_stricmp(arg, "--fps") == 0) _G(display_fps) = kFPS_Forced;
} else if (ags_stricmp(arg, "--fps") == 0)
cfg["misc"]["show_fps"] = "1";
else if (ags_stricmp(arg, "--test") == 0) _G(debug_flags) |= DBG_DEBUGMODE;
else if (ags_stricmp(arg, "--noiface") == 0) _G(debug_flags) |= DBG_NOIFACE;
else if (ags_stricmp(arg, "--nosprdisp") == 0) _G(debug_flags) |= DBG_NODRAWSPRITES;