added setup debug option for displaying frames per second (FPS)
authorHolger Schemel <info@artsoft.org>
Sat, 7 Oct 2017 22:32:55 +0000 (00:32 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 7 Oct 2017 22:32:55 +0000 (00:32 +0200)
src/files.c
src/init.c
src/libgame/system.h

index 8ccd97d9e08c4db80634732c107f0ae423c453b4..3468df641ff8bcc26072cf1d47f51194a3ff84d6 100644 (file)
@@ -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)
index 33f97e45e41b0193fb84b6963df54e6f0363e577..2a5807a4867de736dceaf9aece45f64b0be15eca 100644 (file)
@@ -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()
index bec4097365c6afe914b1c9a39dc0a51868787fef..7de14d613cd23ede44694e0cbe7b7e47a384d67b 100644 (file)
@@ -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