瀏覽代碼

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()


Loading…
取消
儲存