From 4580b18b041fc6e902b0531002f545437b3239c7 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 22 May 2020 18:06:29 +1000 Subject: [PATCH] [client] fix the fps limiter --- VERSION | 2 +- client/src/main.c | 23 +---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/VERSION b/VERSION index 20b5e373..807ac98c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B2-rc1-1-g075c82b32c+1 \ No newline at end of file +B2-rc1-2-g88dad36449+1 \ No newline at end of file diff --git a/client/src/main.c b/client/src/main.c index 1cb35712..940d0f32 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -148,32 +148,11 @@ static int renderThread(void * unused) /* signal to other threads that the renderer is ready */ lgSignalEvent(e_startup); - unsigned int resyncCheck = 0; struct timespec time; - clock_gettime(CLOCK_REALTIME, &time); while(state.running) { - // if our clock is too far out of sync, resync it - // this can happen when switching to/from a TTY, or due to clock drift - // we only check this once every 100 frames - if (state.frameTime > 0 && ++resyncCheck == 100) - { - resyncCheck = 0; - - struct timespec tmp; - clock_gettime(CLOCK_REALTIME, &tmp); - if (tmp.tv_nsec - time.tv_nsec < 0) - { - tmp.tv_sec -= time.tv_sec - 1; - tmp.tv_nsec = 1000000000 + tmp.tv_nsec - time.tv_nsec; - } - else - { - tmp.tv_sec -= time.tv_sec; - tmp.tv_nsec -= time.tv_nsec; - } - } + clock_gettime(CLOCK_REALTIME, &time); if (state.lgrResize) {