- set proper minimal FPS rate for all games.

This commit is contained in:
Christoph Oelckers 2020-06-20 10:46:51 +02:00
parent e29eb5bbed
commit 76311cfcc9
2 changed files with 8 additions and 3 deletions

View file

@ -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)
{

View file

@ -441,9 +441,11 @@ namespace Powerslave
}
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)