From 76311cfcc9e93d93fce54cbf95a0e0e3172a483f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Jun 2020 10:46:51 +0200 Subject: [PATCH] - set proper minimal FPS rate for all games. --- source/common/rendering/v_video.cpp | 6 ++++-- source/core/gamecontrol.cpp | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/common/rendering/v_video.cpp b/source/common/rendering/v_video.cpp index 435768c98..e2f4dbb9b 100644 --- a/source/common/rendering/v_video.cpp +++ b/source/common/rendering/v_video.cpp @@ -72,11 +72,13 @@ CVAR(Int, win_w, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Int, win_h, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, win_maximized, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +int MinFPSRate = 35; + CUSTOM_CVAR(Int, vid_maxfps, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { - if (self < GameTicRate && self != 0) + if (self < MinFPSRate && self != 0) { - self = GameTicRate; + self = MinFPSRate; } else if (self > 1000) { diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index c484cac01..0d808b01c 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -440,10 +440,12 @@ namespace Powerslave ::GameInterface* CreateInterface(); } -CVAR(Bool, duke_compatibility_15, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR(Bool, duke_compatibility_15, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +extern int MinFPSRate; // this is a bit messy. void CheckFrontend(int flags) { + MinFPSRate = 30; bool duke_compat = duke_compatibility_15; // This point is too early to have cmdline CVAR checkers working so it must be with a switch. auto c = Args->CheckValue("-duke_compatibility_15"); @@ -462,6 +464,7 @@ void CheckFrontend(int flags) } else if (flags & GAMEFLAG_SW) { + MinFPSRate = 40; gi = ShadowWarrior::CreateInterface(); } else if (flags & GAMEFLAG_PSEXHUMED)