mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- disabled the game side frame limiter.
The backend has its own one, and unlike the one on the game side, it actually suspends execution when waiting.
This commit is contained in:
parent
1311db9ac9
commit
65ddb6cb59
4 changed files with 3 additions and 39 deletions
|
@ -78,7 +78,7 @@ CUSTOM_CVAR(Int, vid_maxfps, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|||
{
|
||||
self = GameTicRate;
|
||||
}
|
||||
else if (vid_maxfps > 1000)
|
||||
else if (self > 1000)
|
||||
{
|
||||
self = 1000;
|
||||
}
|
||||
|
|
|
@ -358,42 +358,6 @@ CVARD(Bool, r_shadows, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable spr
|
|||
CVARD(Bool, r_rotatespritenowidescreen, false, CVAR_NOSET, "pass bit 1024 to all CON rotatesprite calls")
|
||||
CVARD(Bool, r_precache, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable the pre-level caching routine")
|
||||
|
||||
CUSTOM_CVARD(Int, r_maxfps, 200, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "limit the frame rate")
|
||||
{
|
||||
if (self < 0) self = 0;
|
||||
else if (self > 0 && self < 30) self = 30;
|
||||
else if (self > 1000) self = 1000;
|
||||
}
|
||||
|
||||
int G_FPSLimit(void)
|
||||
{
|
||||
if (r_maxfps <= 0)
|
||||
return 1;
|
||||
|
||||
auto frameDelay = timerGetFreqU64()/(double)r_maxfps;
|
||||
|
||||
static double nextPageDelay;
|
||||
static uint64_t lastFrameTicks;
|
||||
|
||||
nextPageDelay = clamp(nextPageDelay, 0.0, frameDelay);
|
||||
|
||||
uint64_t const frameTicks = timerGetTicksU64();
|
||||
uint64_t const elapsedTime = frameTicks - lastFrameTicks;
|
||||
double const dElapsedTime = elapsedTime;
|
||||
|
||||
if (dElapsedTime >= nextPageDelay)
|
||||
{
|
||||
if (dElapsedTime <= nextPageDelay+frameDelay)
|
||||
nextPageDelay += frameDelay-dElapsedTime;
|
||||
|
||||
lastFrameTicks = frameTicks;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CUSTOM_CVARD(String, wchoice, "3457860291", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_FRONTEND_DUKELIKE, "sets weapon autoselection order")
|
||||
{
|
||||
char dest[11];
|
||||
|
|
|
@ -119,5 +119,5 @@ extern float r_ambientlightrecip;
|
|||
extern int hud_statusbarrange; // will be set by the game's configuration setup.
|
||||
bool G_ChangeHudLayout(int direction);
|
||||
bool G_CheckAutorun(bool button);
|
||||
int G_FPSLimit(void);
|
||||
inline int G_FPSLimit(void) { return 1; }
|
||||
bool G_AllowAutoload();
|
||||
|
|
|
@ -1596,7 +1596,7 @@ OptionMenu VideoModeMenu //protected
|
|||
|
||||
StaticText " "
|
||||
Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff"
|
||||
Option "$VIDMNU_MAXFPS", "r_maxfps", "MaxFps"
|
||||
Option "$VIDMNU_MAXFPS", "vid_maxfps", "MaxFps"
|
||||
|
||||
StaticText ""
|
||||
StaticText "$VIDMNU_CUSTOMRES"
|
||||
|
|
Loading…
Reference in a new issue