浏览代码

base: don’t wait for next frame on Emscripten builds.

legacy
Sam Hocevar sam 11 年前
父节点
当前提交
a6e65e3e0c
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      src/ticker.cpp

+ 3
- 1
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()


正在加载...
取消
保存