mirror of https://github.com/sm64pc/sm64pc.git
actually use the sys_sleep function
This commit is contained in:
parent
191db465fc
commit
70b281405f
|
@ -347,7 +347,7 @@ static inline void sync_framerate_with_timer(void) {
|
||||||
const double elapsed = last_sec ? (now - last_sec) : (now - last_time);
|
const double elapsed = last_sec ? (now - last_sec) : (now - last_time);
|
||||||
if ((elapsed < frame_time && !last_sec) || (elapsed < frames_since_last_sec * frame_time && last_sec)) {
|
if ((elapsed < frame_time && !last_sec) || (elapsed < frames_since_last_sec * frame_time && last_sec)) {
|
||||||
const double delay = last_sec ? frames_since_last_sec * frame_time - elapsed : frame_time - elapsed;
|
const double delay = last_sec ? frames_since_last_sec * frame_time - elapsed : frame_time - elapsed;
|
||||||
usleep(delay / perf_freq * 1000000.0);
|
sys_sleep(delay / perf_freq * 1000000.0);
|
||||||
last_time = now + delay;
|
last_time = now + delay;
|
||||||
} else {
|
} else {
|
||||||
last_time = now;
|
last_time = now;
|
||||||
|
|
Loading…
Reference in New Issue