mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-30 10:36:27 +00:00
[client] we are getting the clock anyway, just reset the time
This commit is contained in:
parent
302b988524
commit
fb9b772db0
2
VERSION
2
VERSION
@ -1 +1 @@
|
|||||||
B2-rc2-28-g19c2fe9b5e+1
|
B2-rc2-29-g302b988524+1
|
@ -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;
|
||||||
|
clock_gettime(CLOCK_REALTIME, &time);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
tsAdd(&time, state.frameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.lgrResize)
|
if (state.lgrResize)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user