| 1291 | } |
| 1292 | |
| 1293 | void RunFixedFrame(float deltaTime) |
| 1294 | { |
| 1295 | PROFILED_FUNCTION(); |
| 1296 | |
| 1297 | _uiContext->ProcessMessages(); |
| 1298 | |
| 1299 | if (_ticksAccumulator < kGameUpdateTimeMS) |
| 1300 | { |
| 1301 | const auto sleepTimeSec = std::min(kNetworkUpdateTimeMS, kGameUpdateTimeMS - _ticksAccumulator); |
| 1302 | Platform::Sleep(static_cast<uint32_t>(sleepTimeSec * 1000.f)); |
| 1303 | return; |
| 1304 | } |
| 1305 | |
| 1306 | while (_ticksAccumulator >= kGameUpdateTimeMS) |
| 1307 | { |
| 1308 | Tick(); |
| 1309 | |
| 1310 | _ticksAccumulator -= kGameUpdateTimeMS; |
| 1311 | } |
| 1312 | |
| 1313 | _backgroundWorker.dispatchCompleted(); |
| 1314 | |
| 1315 | ContextHandleInput(); |
| 1316 | WindowUpdateAll(); |
| 1317 | |
| 1318 | if (ShouldDraw()) |
| 1319 | { |
| 1320 | Draw(); |
| 1321 | } |
| 1322 | } |
| 1323 | |
| 1324 | void RunVariableFrame(float deltaTime) |
| 1325 | { |
nothing calls this directly
no test coverage detected