[client] improve fps target accuracy

This commit is contained in:
Geoffrey McRae 2018-12-12 23:33:35 +11:00
parent 42fa0e1d1f
commit 4d7e1054bd

View File

@ -224,7 +224,7 @@ int renderThread(void * unused)
{
usleep(state.fpsSleep - total);
int64_t delta = (1000000 / params.fpsLimit) - (microtime() - start);
state.fpsSleep += delta / 16;
state.fpsSleep += delta;
if (state.fpsSleep < 0)
state.fpsSleep = 0;
}