mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +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
|
@ -6334,15 +6334,16 @@ int G_FPSLimit(void)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
static double nextPageDelay;
|
static double nextPageDelay;
|
||||||
static double lastFrameTicks;
|
static uint64_t lastFrameTicks;
|
||||||
|
|
||||||
double const frameTicks = timerGetTicksU64();
|
uint64_t const frameTicks = timerGetTicksU64();
|
||||||
double const elapsedTime = frameTicks-lastFrameTicks;
|
uint64_t const elapsedTime = frameTicks - lastFrameTicks;
|
||||||
|
double const dElapsedTime = elapsedTime;
|
||||||
|
|
||||||
if (elapsedTime >= nextPageDelay)
|
if (dElapsedTime >= floor(nextPageDelay))
|
||||||
{
|
{
|
||||||
if (elapsedTime <= nextPageDelay+g_frameDelay)
|
if (dElapsedTime <= nextPageDelay+g_frameDelay)
|
||||||
nextPageDelay += g_frameDelay-elapsedTime;
|
nextPageDelay += g_frameDelay-dElapsedTime;
|
||||||
|
|
||||||
lastFrameTicks = frameTicks;
|
lastFrameTicks = frameTicks;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue