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

Method RunVariableFrame

src/openrct2/Context.cpp:1324–1360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1322 }
1323
1324 void RunVariableFrame(float deltaTime)
1325 {
1326 PROFILED_FUNCTION();
1327
1328 const bool shouldDraw = ShouldDraw();
1329 auto& tweener = EntityTweener::Get();
1330
1331 _uiContext->ProcessMessages();
1332
1333 while (_ticksAccumulator >= kGameUpdateTimeMS)
1334 {
1335 // Get the original position of each sprite
1336 if (shouldDraw)
1337 tweener.PreTick();
1338
1339 Tick();
1340
1341 _ticksAccumulator -= kGameUpdateTimeMS;
1342
1343 // Get the next position of each sprite
1344 if (shouldDraw)
1345 tweener.PostTick();
1346 }
1347
1348 _backgroundWorker.dispatchCompleted();
1349
1350 ContextHandleInput();
1351 WindowUpdateAll();
1352
1353 if (shouldDraw)
1354 {
1355 const float alpha = std::min(_ticksAccumulator / kGameUpdateTimeMS, 1.0f);
1356 tweener.Tween(alpha);
1357
1358 Draw();
1359 }
1360 }
1361
1362 void Draw()
1363 {

Callers

nothing calls this directly

Calls 9

ContextHandleInputFunction · 0.85
WindowUpdateAllFunction · 0.85
DrawFunction · 0.85
ProcessMessagesMethod · 0.80
dispatchCompletedMethod · 0.80
TweenMethod · 0.80
TickFunction · 0.50
PreTickMethod · 0.45
PostTickMethod · 0.45

Tested by

no test coverage detected