MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / RunFixedFrame

Method RunFixedFrame

src/openrct2/Context.cpp:1293–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 7

SleepFunction · 0.85
ContextHandleInputFunction · 0.85
WindowUpdateAllFunction · 0.85
DrawFunction · 0.85
ProcessMessagesMethod · 0.80
dispatchCompletedMethod · 0.80
TickFunction · 0.50

Tested by

no test coverage detected