From 5dec4736ce8bd3db79c604c3262d934c65e1810e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 23 Oct 2019 01:04:07 +0200 Subject: [PATCH] - r_drawweapon, r_showfps, r_showfpsperiod --- source/blood/src/config.cpp | 1 - source/blood/src/messages.cpp | 2 +- source/blood/src/view.cpp | 12 ++++------ source/blood/src/view.h | 1 - source/common/gamecvars.cpp | 36 +++++++++++++++------------- source/common/gamecvars.h | 3 +++ source/duke3d/src/cheats.cpp | 5 ++-- source/duke3d/src/config.cpp | 9 +++---- source/duke3d/src/game.h | 6 ++--- source/duke3d/src/gamestructures.cpp | 8 +++---- source/duke3d/src/player.cpp | 4 ++-- source/duke3d/src/screens.cpp | 10 ++++---- source/rr/src/cheats.cpp | 5 ++-- source/rr/src/config.cpp | 10 ++------ source/rr/src/game.h | 6 ++--- source/rr/src/player.cpp | 4 ++-- source/rr/src/screens.cpp | 10 ++++---- 17 files changed, 63 insertions(+), 69 deletions(-) diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 1755acb23..668a7e52e 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -286,7 +286,6 @@ void CONFIG_SetDefaults(void) //ud.default_skill = 1; gUpscaleFactor = 0; //ud.display_bonus_screen = 1; - //ud.drawweapon = 1; //ud.hudontop = 0; = 1; gPowerupDuration = 1; //ud.lockout = 0; diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index 000aa5304..20e73b3d2 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -744,7 +744,7 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs) if (gDemo.at0) return; if (nCheatCode == kCheatRate) { - gShowFps = !gShowFps; + r_showfps = !r_showfps; return; } if (gGameOptions.nGameType != 0) diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 908fc32ea..014571089 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -3738,8 +3738,6 @@ void viewResetCrosshairToDefault(void) #define FPS_COLOR(x) ((x) ? COLOR_RED : COLOR_WHITE) -int32_t gShowFps, gFramePeriod; - void viewPrintFPS(void) { char tempbuf[128]; @@ -3757,7 +3755,7 @@ void viewPrintFPS(void) { int32_t x = (xdim <= 640); - if (gShowFps) + if (r_showfps) { int32_t chars = Bsprintf(tempbuf, "%.1f ms, %5.1f fps", frameDelay, lastFPS); @@ -3765,7 +3763,7 @@ void viewPrintFPS(void) printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+1+FPS_YOFFSET, FPS_COLOR(lastFPS < LOW_FPS), -1, tempbuf, x); - if (gShowFps > 1) + if (r_showfps > 1) { chars = Bsprintf(tempbuf, "max: %5.1f fps", maxFPS); @@ -3779,7 +3777,7 @@ void viewPrintFPS(void) printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+20+FPS_YOFFSET, FPS_COLOR(minFPS < LOW_FPS), -1, tempbuf, x); } - if (gShowFps > 2) + if (r_showfps > 2) { if (g_gameUpdateTime > maxGameUpdate) maxGameUpdate = g_gameUpdateTime; if (g_gameUpdateTime < minGameUpdate) minGameUpdate = g_gameUpdateTime; @@ -3835,14 +3833,14 @@ void viewPrintFPS(void) frameCount = 0; cumulativeFrameDelay = 0.0; - if (gShowFps > 1) + if (r_showfps > 1) { if (lastFPS > maxFPS) maxFPS = lastFPS; if (lastFPS < minFPS) minFPS = lastFPS; static int secondCounter; - if (++secondCounter >= gFramePeriod) + if (++secondCounter >= r_showfpsperiod) { maxFPS = (lastFPS + maxFPS) * .5f; minFPS = (lastFPS + minFPS) * .5f; diff --git a/source/blood/src/view.h b/source/blood/src/view.h index cf33cf7af..6640b7819 100644 --- a/source/blood/src/view.h +++ b/source/blood/src/view.h @@ -103,7 +103,6 @@ extern int32_t r_maxfpsoffset; extern double g_frameDelay; extern float r_ambientlight, r_ambientlightrecip; extern int gLastPal; -extern int32_t gShowFps, gFramePeriod; static inline double calcFrameDelay(int maxFPS) { return maxFPS ? ((double)timerGetFreqU64() / (double)(maxFPS)) : 0.0; } diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index 8c3789ff8..2e2400819 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -250,20 +250,27 @@ CUSTOM_CVARD(Bool, in_mousesmoothing, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "en CONTROL_SmoothMouse = self; } +CUSTOM_CVARD(Int, r_drawweapon, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable weapon drawing") +{ + if (self < 0 || self > 2) self = 1; +} + +CUSTOM_CVARD(Int, r_showfps, 0, 0, "show the frame rate counter") +{ + if (self < 0 || self > 3) self = 1; +} + +CUSTOM_CVARD(Int, r_showfpsperiod, 0, 0, "time in seconds before averaging min and max stats for r_showfps 2+") +{ + if (self < 0 || self > 5) self = 1; +} + #if 0 -{ "in_mousesmoothing", , (void *)&in_mousesmoothing.Value, CVAR_BOOL, 0, 1 }, - -{ "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&in_mousesmoothing.Value, CVAR_BOOL, 0, 1 }, - // DN3D static osdcvardata_t cvars_game[] = { - { "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_rotatespritenowidescreen", "pass bit 1024 to all CON rotatesprite calls", (void *)&g_rotatespriteNoWidescreen, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, { "r_precache", "enable/disable the pre-level caching routine", (void *)&ud.config.useprecache, CVAR_BOOL, 0, 1 }, @@ -301,10 +308,6 @@ CUSTOM_CVARD(Bool, in_mousesmoothing, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "en static osdcvardata_t cvars_game[] = { - { "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_rotatespritenowidescreen", "pass bit 1024 to all CON rotatesprite calls", (void *)&g_rotatespriteNoWidescreen, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, { "r_precache", "enable/disable the pre-level caching routine", (void *)&ud.config.useprecache, CVAR_BOOL, 0, 1 }, @@ -345,11 +348,7 @@ int32_t registerosdcommands(void) char buffer[256]; static osdcvardata_t cvars_game[] = { -// -// { "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 *)&gShowFps, CVAR_INT, 0, 3 }, - { "r_showfpsperiod", "time in seconds before averaging min and max stats for r_showfps 2+", (void *)&gFramePeriod, CVAR_INT, 0, 5 }, + // { "r_shadows", "enable/disable sprite and model shadows", (void *)&ud.shadows, CVAR_BOOL, 0, 1 }, // { "r_rotatespritenowidescreen", "pass bit 1024 to all CON rotatesprite calls", (void *)&g_rotatespriteNoWidescreen, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, }, @@ -412,5 +411,8 @@ int32_t registerosdcommands(void) { "in_mousemode", "toggles vertical mouse view", (void *)&in_mousemode.Value, CVAR_BOOL, 0, 1 }, { "in_mousemode", "toggles vertical mouse view", (void *)&gMouseAim, CVAR_BOOL, 0, 1 }, + // This option is not really useful anymore + { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, + */ #endif diff --git a/source/common/gamecvars.h b/source/common/gamecvars.h index ed44ea5bd..075454280 100644 --- a/source/common/gamecvars.h +++ b/source/common/gamecvars.h @@ -57,6 +57,9 @@ EXTERN_CVAR(Bool, hud_showmapname) EXTERN_CVAR(Int, r_fov) EXTERN_CVAR(Bool, r_horizcenter) +EXTERN_CVAR(Int, r_drawweapon) +EXTERN_CVAR(Int, r_showfps) +EXTERN_CVAR(Int, r_showfpsperiod) EXTERN_CVAR(Bool, in_joystick) EXTERN_CVAR(Bool, in_mouse) diff --git a/source/duke3d/src/cheats.cpp b/source/duke3d/src/cheats.cpp index cbc912908..b8691c39f 100644 --- a/source/duke3d/src/cheats.cpp +++ b/source/duke3d/src/cheats.cpp @@ -666,8 +666,9 @@ void G_DoCheats(void) return; case CHEAT_RATE: - if (++ud.showfps > 3) - ud.showfps = 0; + r_showfps = r_showfps+1; + if (ud.showfps > 3) + r_showfps = 0; end_cheat(pPlayer); return; diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 988438e4b..167d4b168 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -224,11 +224,8 @@ void CONFIG_SetDefaults(void) ud.setup.bpp = 8; #endif -#if defined GEKKO || defined __OPENDINGUX__ - ud.camera_time = 11; -#else - ud.camera_time = 4; -#endif + + ud.camera_time = 0;//4; g_myAimMode = 1; g_player[0].ps->aim_mode = 1; @@ -250,7 +247,7 @@ void CONFIG_SetDefaults(void) ud.default_skill = 1; ud.detail = 0; ud.display_bonus_screen = 1; - ud.drawweapon = 1; + ud.hudontop = 0; ud.lockout = 0; ud.m_marker = 1; diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 775cf383e..1483d52f6 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -175,7 +175,7 @@ typedef struct { int32_t camera_time,folfvel,folavel,folx,foly,fola; int32_t reccnt; - int32_t runkey_mode,statusbarscale,weaponswitch,drawweapon; // JBF 20031125 + int32_t runkey_mode,statusbarscale,weaponswitch; // JBF 20031125 int32_t color,msgdisptime,statusbarmode; int32_t m_noexits,noexits; int32_t team, althud, weaponscale, textscale; @@ -185,7 +185,7 @@ typedef struct { int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz; int32_t entered_name,screen_tilting,shadows,fta_on,executions; - int32_t showfps,m_coop,coop,screen_size,lockout; + int32_t m_coop,coop,screen_size,lockout; int32_t playerai,angleinterpolation; int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness; @@ -196,7 +196,7 @@ typedef struct { int32_t playerbest; - int32_t configversion, bgstretch, frameperiod; + int32_t configversion, bgstretch; int32_t default_volume, default_skill; diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index 932934ceb..8a32154c4 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -1413,7 +1413,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_EXECUTIONS: labelNum = ud.executions; break; case USERDEFS_AUTO_RUN: labelNum = cl_autorun; break; case USERDEFS_COORDS: labelNum = cl_showcoords; break; - case USERDEFS_TICKRATE: labelNum = ud.showfps; break; + case USERDEFS_TICKRATE: labelNum = r_showfps; break; case USERDEFS_M_COOP: labelNum = ud.m_coop; break; case USERDEFS_COOP: labelNum = ud.coop; break; case USERDEFS_SCREEN_SIZE: labelNum = ud.screen_size; break; @@ -1447,7 +1447,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_MARKER: labelNum = ud.marker; break; case USERDEFS_MOUSEFLIP: labelNum = !in_mouseflip; break; case USERDEFS_STATUSBARSCALE: labelNum = ud.statusbarscale; break; - case USERDEFS_DRAWWEAPON: labelNum = ud.drawweapon; break; + case USERDEFS_DRAWWEAPON: labelNum = r_drawweapon; break; case USERDEFS_MOUSEAIMING: labelNum = in_aimmode; break; case USERDEFS_WEAPONSWITCH: labelNum = cl_weaponswitch; break; case USERDEFS_DEMOCAMS: labelNum = cl_democams; break; @@ -1609,7 +1609,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_EXECUTIONS: ud.executions = iSet; break; case USERDEFS_AUTO_RUN: cl_autorun = iSet; break; //!!! case USERDEFS_COORDS: cl_showcoords = iSet; break; //!!! - case USERDEFS_TICKRATE: ud.showfps = iSet; break; + case USERDEFS_TICKRATE: r_showfps = iSet; break; case USERDEFS_M_COOP: ud.m_coop = iSet; break; case USERDEFS_COOP: ud.coop = iSet; break; case USERDEFS_SCREEN_SIZE: @@ -1648,7 +1648,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_MARKER: ud.marker = iSet; break; case USERDEFS_MOUSEFLIP: in_mouseflip = !iSet; break;//!!! case USERDEFS_STATUSBARSCALE: ud.statusbarscale = iSet; break; - case USERDEFS_DRAWWEAPON: ud.drawweapon = iSet; break; + case USERDEFS_DRAWWEAPON: r_drawweapon = iSet; break;//!!! case USERDEFS_MOUSEAIMING: in_aoimmode = iSet; break;//!!! case USERDEFS_WEAPONSWITCH: cl_weaponswitch = iSet; break; //!!! case USERDEFS_DEMOCAMS: cl_democams = iSet; break; diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index d9b38c672..911c7aefa 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2190,7 +2190,7 @@ void P_DisplayWeapon(void) #ifndef EDUKE32_STANDALONE int const quickKickFrame = 14 - pPlayer->quick_kick; - if (!FURY && (quickKickFrame != 14 || pPlayer->last_quick_kick) && ud.drawweapon == 1) + if (!FURY && (quickKickFrame != 14 || pPlayer->last_quick_kick) && r_drawweapon == 1) { int const weaponPal = P_GetKneePal(pPlayer); @@ -2229,7 +2229,7 @@ void P_DisplayWeapon(void) else #endif { - switch (ud.drawweapon) + switch (r_drawweapon) { case 1: break; #ifndef EDUKE32_STANDALONE diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index a950de006..8cd5d0ed2 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -734,7 +734,7 @@ static void G_PrintFPS(void) { int32_t x = (xdim <= 640); - if (ud.showfps) + if (r_showfps) { int32_t chars = Bsprintf(tempbuf, "%.1f ms, %5.1f fps", frameDelay, lastFPS); @@ -742,7 +742,7 @@ static void G_PrintFPS(void) printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+1+FPS_YOFFSET, FPS_COLOR(lastFPS < LOW_FPS), -1, tempbuf, x); - if (ud.showfps > 1) + if (r_showfps > 1) { chars = Bsprintf(tempbuf, "max: %5.1f fps", maxFPS); @@ -756,7 +756,7 @@ static void G_PrintFPS(void) printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+20+FPS_YOFFSET, FPS_COLOR(minFPS < LOW_FPS), -1, tempbuf, x); } - if (ud.showfps > 2) + if (r_showfps > 2) { if (g_gameUpdateTime > maxGameUpdate) maxGameUpdate = g_gameUpdateTime; if (g_gameUpdateTime < minGameUpdate) minGameUpdate = g_gameUpdateTime; @@ -804,14 +804,14 @@ static void G_PrintFPS(void) frameCount = 0; cumulativeFrameDelay = 0.0; - if (ud.showfps > 1) + if (r_showfps > 1) { if (lastFPS > maxFPS) maxFPS = lastFPS; if (lastFPS < minFPS) minFPS = lastFPS; static int secondCounter; - if (++secondCounter >= ud.frameperiod) + if (++secondCounter >= r_showfpsperiod) { maxFPS = (lastFPS + maxFPS) * .5f; minFPS = (lastFPS + minFPS) * .5f; diff --git a/source/rr/src/cheats.cpp b/source/rr/src/cheats.cpp index b359fb49b..430b2af09 100644 --- a/source/rr/src/cheats.cpp +++ b/source/rr/src/cheats.cpp @@ -673,8 +673,9 @@ void G_DoCheats(void) return; case CHEAT_RATE: - if (++ud.showfps > 3) - ud.showfps = 0; + r_showfps = r_showfps+1; + if (r_showfps > 3) + r_showfps = 0; end_cheat(pPlayer); return; diff --git a/source/rr/src/config.cpp b/source/rr/src/config.cpp index e6018c4cd..55856a015 100644 --- a/source/rr/src/config.cpp +++ b/source/rr/src/config.cpp @@ -220,17 +220,11 @@ void CONFIG_SetDefaults(void) ud.brightness = 8; ud.camerasprite = -1; -#if defined GEKKO || defined __OPENDINGUX__ - ud.camera_time = 11; -#elif defined(__ANDROID__) - ud.camera_time = 7; -#else - ud.camera_time = 4; -#endif + ud.camera_time = 0;//4; ud.color = 0; ud.detail = 0; - ud.drawweapon = 1; + r_drawweapon = 1; ud.lockout = 0; ud.m_ffire = 1; ud.m_marker = 1; diff --git a/source/rr/src/game.h b/source/rr/src/game.h index a48f473a3..54e49a172 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -154,7 +154,7 @@ typedef struct { int32_t camera_time,folfvel,folavel,folx,foly,fola; int32_t reccnt; - int32_t runkey_mode,statusbarscale,weaponswitch,drawweapon; // JBF 20031125 + int32_t runkey_mode,statusbarscale,weaponswitch; // JBF 20031125 int32_t color,msgdisptime,statusbarmode; int32_t m_noexits,noexits,automsg; int32_t team, althud, weaponscale, textscale; @@ -164,7 +164,7 @@ typedef struct { int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz; int32_t entered_name,screen_tilting,shadows,fta_on,executions; - int32_t showfps,m_coop,coop,screen_size,lockout,crosshair; + int32_t m_coop,coop,screen_size,lockout,crosshair; int32_t playerai,angleinterpolation; int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness; @@ -175,7 +175,7 @@ typedef struct { int32_t playerbest; - int32_t configversion, bgstretch, frameperiod; + int32_t configversion, bgstretch; int32_t default_volume, default_skill; diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index 307130328..756e8951f 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -1761,7 +1761,7 @@ void P_DisplayWeapon(void) quickKickFrame = 14 - pPlayer->quick_kick; - if (!RR && (quickKickFrame != 14 || pPlayer->last_quick_kick) && ud.drawweapon == 1) + if (!RR && (quickKickFrame != 14 || pPlayer->last_quick_kick) && r_drawweapon == 1) { int const weaponPal = P_GetKneePal(pPlayer); @@ -1910,7 +1910,7 @@ void P_DisplayWeapon(void) } else { - switch (ud.drawweapon) + switch (r_drawweapon) { case 1: break; case 2: diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index 3bd328a7d..c3b933418 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -731,7 +731,7 @@ static void G_PrintFPS(void) { int32_t x = (xdim <= 640); - if (ud.showfps) + if (r_showfps) { int32_t chars = Bsprintf(tempbuf, "%.1f ms, %5.1f fps", frameDelay, lastFPS); @@ -739,7 +739,7 @@ static void G_PrintFPS(void) printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+1+FPS_YOFFSET, FPS_COLOR(lastFPS < LOW_FPS), -1, tempbuf, x); - if (ud.showfps > 1) + if (r_showfps > 1) { chars = Bsprintf(tempbuf, "max: %5.1f fps", maxFPS); @@ -753,7 +753,7 @@ static void G_PrintFPS(void) printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+20+FPS_YOFFSET, FPS_COLOR(minFPS < LOW_FPS), -1, tempbuf, x); } - if (ud.showfps > 2) + if (r_showfps > 2) { if (g_gameUpdateTime > maxGameUpdate) maxGameUpdate = g_gameUpdateTime; if (g_gameUpdateTime < minGameUpdate) minGameUpdate = g_gameUpdateTime; @@ -801,14 +801,14 @@ static void G_PrintFPS(void) frameCount = 0; cumulativeFrameDelay = 0.0; - if (ud.showfps > 1) + if (r_showfps > 1) { if (lastFPS > maxFPS) maxFPS = lastFPS; if (lastFPS < minFPS) minFPS = lastFPS; static int secondCounter; - if (++secondCounter >= ud.frameperiod) + if (++secondCounter >= r_showfpsperiod) { maxFPS = (lastFPS + maxFPS) * .5f; minFPS = (lastFPS + minFPS) * .5f;