mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Use nearbyintf() to when calculating g_frameDelay (when r_maxfps is changed) to get closer to the target framerate by bypassing float -> int truncation
git-svn-id: https://svn.eduke32.com/eduke32@3441 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
9bd041cb9d
commit
aac7d22f96
1 changed files with 1 additions and 1 deletions
|
@ -1337,7 +1337,7 @@ static int32_t osdcmd_cvar_set_game(const osdfuncparm_t *parm)
|
||||||
}
|
}
|
||||||
else if (!Bstrcasecmp(parm->name, "r_maxfps"))
|
else if (!Bstrcasecmp(parm->name, "r_maxfps"))
|
||||||
{
|
{
|
||||||
if (r_maxfps) g_frameDelay = (1000/r_maxfps);
|
if (r_maxfps) g_frameDelay = (int32_t)nearbyintf(1000.f/(float)r_maxfps);
|
||||||
else g_frameDelay = 0;
|
else g_frameDelay = 0;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in a new issue