[client] more fps limiter fixes

This commit is contained in:
Geoffrey McRae 2020-05-22 18:28:16 +10:00
parent 9b6174793a
commit 60f665a65c
3 changed files with 14 additions and 11 deletions

View File

@ -1 +1 @@
B2-rc1-4-gdedab38b99+1 B2-rc1-5-g9b6174793a+1

View File

@ -175,7 +175,7 @@ static struct Option options[] =
}, },
{ {
.module = "win", .module = "win",
.name = "fpsMinimum", .name = "fpsMin",
.description = "Frame rate minimum (0 = disable - not recommended, -1 = auto detect)", .description = "Frame rate minimum (0 = disable - not recommended, -1 = auto detect)",
.shortopt = 'K', .shortopt = 'K',
.type = OPTION_TYPE_INT, .type = OPTION_TYPE_INT,

View File

@ -191,6 +191,8 @@ static int renderThread(void * unused)
state.resizeDone = true; state.resizeDone = true;
} }
if (state.frameTime > 0)
{
clock_gettime(CLOCK_REALTIME, &time); clock_gettime(CLOCK_REALTIME, &time);
uint64_t nsec = time.tv_nsec + state.frameTime; uint64_t nsec = time.tv_nsec + state.frameTime;
if(nsec > 1e9) if(nsec > 1e9)
@ -203,6 +205,7 @@ static int renderThread(void * unused)
lgWaitEventAbs(e_frame, &time); lgWaitEventAbs(e_frame, &time);
} }
}
state.running = false; state.running = false;