From: Holger Schemel Date: Sat, 7 Oct 2017 22:32:55 +0000 (+0200) Subject: added setup debug option for displaying frames per second (FPS) X-Git-Tag: 4.0.1.1~38 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a6a203764b16840a0f5ae3d776f2d881f270d71b;p=rocksndiamonds.git added setup debug option for displaying frames per second (FPS) --- diff --git a/src/files.c b/src/files.c index 8ccd97d9..3468df64 100644 --- a/src/files.c +++ b/src/files.c @@ -8103,8 +8103,9 @@ void SaveScore(int nr) #define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_9 19 #define SETUP_TOKEN_DEBUG_FRAME_DELAY_USE_MOD_KEY 20 #define SETUP_TOKEN_DEBUG_FRAME_DELAY_GAME_ONLY 21 +#define SETUP_TOKEN_DEBUG_SHOW_FRAMES_PER_SECOND 22 -#define NUM_DEBUG_SETUP_TOKENS 22 +#define NUM_DEBUG_SETUP_TOKENS 23 /* options setup */ #define SETUP_TOKEN_OPTIONS_VERBOSE 0 @@ -8296,6 +8297,7 @@ static struct TokenInfo debug_setup_tokens[] = { TYPE_KEY_X11, &sdi.frame_delay_key[9], "debug.key.frame_delay_9" }, { TYPE_BOOLEAN, &sdi.frame_delay_use_mod_key,"debug.frame_delay.use_mod_key"}, { TYPE_BOOLEAN, &sdi.frame_delay_game_only, "debug.frame_delay.game_only" }, + { TYPE_BOOLEAN, &sdi.show_frames_per_second, "debug.show_frames_per_second" }, }; static struct TokenInfo options_setup_tokens[] = @@ -8493,6 +8495,8 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->debug.frame_delay_use_mod_key = DEFAULT_FRAME_DELAY_USE_MOD_KEY; si->debug.frame_delay_game_only = DEFAULT_FRAME_DELAY_GAME_ONLY; + si->debug.show_frames_per_second = FALSE; + si->options.verbose = FALSE; #if defined(PLATFORM_ANDROID) diff --git a/src/init.c b/src/init.c index 33f97e45..2a5807a4 100644 --- a/src/init.c +++ b/src/init.c @@ -5055,6 +5055,9 @@ static void InitSetup() if (setup.options.verbose) options.verbose = TRUE; + + if (setup.debug.show_frames_per_second) + global.show_frames_per_second = TRUE; } static void InitGameInfo() diff --git a/src/libgame/system.h b/src/libgame/system.h index bec40973..7de14d61 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1095,6 +1095,7 @@ struct SetupDebugInfo Key frame_delay_key[10]; boolean frame_delay_use_mod_key; boolean frame_delay_game_only; + boolean show_frames_per_second; }; struct SetupInfo