From a6e65e3e0cafe3e09eec5c5fc6d7801e53b1fe2d Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 9 Apr 2013 07:24:34 +0000 Subject: [PATCH] =?UTF-8?q?base:=20don=E2=80=99t=20wait=20for=20next=20fra?= =?UTF-8?q?me=20on=20Emscripten=20builds.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ticker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ticker.cpp b/src/ticker.cpp index c6a16627..f03a86b8 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -472,18 +472,20 @@ void Ticker::TickDraw() /* Clamp FPS */ Profiler::Stop(Profiler::STAT_TICK_BLIT); +#if !EMSCRIPTEN /* If framerate is fixed, force wait time to 1/FPS. Otherwise, set wait * time to 0. */ float frametime = data->fps ? 1.f / data->fps : 0.f; if (frametime > data->bias + .2f) - frametime = data->bias + .2f; // Don't go below 5 fps + frametime = data->bias + .2f; /* Don't go below 5 fps */ if (frametime > data->bias) data->timer.Wait(frametime - data->bias); /* If recording, do not try to compensate for lag. */ if (!data->recording) data->bias -= frametime; +#endif } void Ticker::StartRecording()