mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
uint64_t in G_FPSLimit()
git-svn-id: https://svn.eduke32.com/eduke32@8070 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4d20afa9ed
commit
1ba0406b4d
1 changed files with 8 additions and 7 deletions
|
@ -6333,16 +6333,17 @@ int G_FPSLimit(void)
|
|||
if (!r_maxfps)
|
||||
return 1;
|
||||
|
||||
static double nextPageDelay;
|
||||
static double lastFrameTicks;
|
||||
static double nextPageDelay;
|
||||
static uint64_t lastFrameTicks;
|
||||
|
||||
double const frameTicks = timerGetTicksU64();
|
||||
double const elapsedTime = frameTicks-lastFrameTicks;
|
||||
uint64_t const frameTicks = timerGetTicksU64();
|
||||
uint64_t const elapsedTime = frameTicks - lastFrameTicks;
|
||||
double const dElapsedTime = elapsedTime;
|
||||
|
||||
if (elapsedTime >= nextPageDelay)
|
||||
if (dElapsedTime >= floor(nextPageDelay))
|
||||
{
|
||||
if (elapsedTime <= nextPageDelay+g_frameDelay)
|
||||
nextPageDelay += g_frameDelay-elapsedTime;
|
||||
if (dElapsedTime <= nextPageDelay+g_frameDelay)
|
||||
nextPageDelay += g_frameDelay-dElapsedTime;
|
||||
|
||||
lastFrameTicks = frameTicks;
|
||||
|
||||
|
|
Loading…
Reference in a new issue