| 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 | { |
nothing calls this directly
no test coverage detected