mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 16:48:21 +00:00
[client] we are getting the clock anyway, just reset the time
This commit is contained in:
parent
302b988524
commit
fb9b772db0
@ -159,22 +159,12 @@ static int renderThread(void * unused)
|
|||||||
{
|
{
|
||||||
if (state.frameTime > 0)
|
if (state.frameTime > 0)
|
||||||
{
|
{
|
||||||
tsAdd(&time, state.frameTime);
|
|
||||||
|
|
||||||
// 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 (++resyncCheck == 100)
|
if (++resyncCheck == 100)
|
||||||
{
|
{
|
||||||
resyncCheck = 0;
|
resyncCheck = 0;
|
||||||
|
|
||||||
struct timespec end, diff;
|
|
||||||
clock_gettime(CLOCK_REALTIME, &end);
|
|
||||||
tsDiff(&diff, &time, &end);
|
|
||||||
if (diff.tv_sec > 0 || diff.tv_nsec > 1000000000 || // 100ms
|
|
||||||
diff.tv_sec < 0 || diff.tv_nsec < 0) // underflow
|
|
||||||
clock_gettime(CLOCK_REALTIME, &time);
|
clock_gettime(CLOCK_REALTIME, &time);
|
||||||
}
|
}
|
||||||
|
tsAdd(&time, state.frameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.lgrResize)
|
if (state.lgrResize)
|
||||||
|
Loading…
Reference in New Issue
Block a user