From b0f640072cd25d681c7e9abdf2a276404b1a89a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 15 Sep 2012 02:46:11 +0200 Subject: [PATCH] Timeline: sleep for _the rest_ of the frame. This wasn't well tested class. --- src/Timeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 306ce4ac7..5ecc485b3 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -42,7 +42,7 @@ void Timeline::nextFrame() { _previousFrameDuration = duration/1e6f; if(_previousFrameDuration < _minimalFrameTime) { - sleep(duration/1000); + sleep(_minimalFrameTime*1000 - duration/1000); now = high_resolution_clock::now(); _previousFrameDuration = duration_cast(now-previousFrameTime).count()/1e6f; }