From 5f141ed8d6dd263776d0dfd924e17a011739d24f Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 12 Jan 2019 00:22:10 +0000 Subject: [PATCH] Make the time period between averaging the min and max values shown with r_showfps 2+ user configurable with r_showfpsperiod git-svn-id: https://svn.eduke32.com/eduke32@7308 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.h | 2 +- source/duke3d/src/osdcmds.cpp | 1 + source/duke3d/src/screens.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 313d18cef..4fd0f1331 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -199,7 +199,7 @@ typedef struct { int32_t playerbest; - int32_t configversion, bgstretch; + int32_t configversion, bgstretch, frameperiod; int32_t default_volume, default_skill; diff --git a/source/duke3d/src/osdcmds.cpp b/source/duke3d/src/osdcmds.cpp index b30be216f..5edcc1366 100644 --- a/source/duke3d/src/osdcmds.cpp +++ b/source/duke3d/src/osdcmds.cpp @@ -1634,6 +1634,7 @@ int32_t registerosdcommands(void) { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, { "r_drawweapon", "enable/disable weapon drawing", (void *)&ud.drawweapon, CVAR_INT, 0, 2 }, { "r_showfps", "show the frame rate counter", (void *)&ud.showfps, CVAR_INT, 0, 3 }, + { "r_showfpsperiod", "time in seconds before averaging min and max stats for r_showfps 2+", (void *)&ud.frameperiod, CVAR_INT, 0, 5 }, { "r_shadows", "enable/disable sprite and model shadows", (void *)&ud.shadows, CVAR_BOOL, 0, 1 }, { "r_size", "change size of viewable area", (void *)&ud.screen_size, CVAR_INT|CVAR_FUNCPTR, 0, 64 }, { "r_rotatespritenowidescreen", "pass bit 1024 to all CON rotatesprite calls", (void *)&g_rotatespriteNoWidescreen, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index 32af0bdef..300195d09 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -877,7 +877,7 @@ static void G_PrintFPS(void) static int secondCounter; - if (++secondCounter == 1) + if (++secondCounter >= ud.frameperiod) { maxFPS = (lastFPS + maxFPS) * .5f; minFPS = (lastFPS + minFPS) * .5f;