MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / promptTickLoop

Function promptTickLoop

src/OpenLoco/src/OpenLoco.cpp:645–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643 }
644
645 bool promptTickLoop(std::function<bool()> tickAction)
646 {
647 while (true)
648 {
649 _last_tick_time = Platform::getTime();
650 _time_since_last_tick = 31;
651 if (!Input::processMessages())
652 {
653 return false;
654 }
655 if (!tickAction())
656 {
657 break;
658 }
659 Ui::render();
660 tickWait();
661 }
662 return true;
663 }
664
665 constexpr auto MaxUpdateTime = static_cast<double>(Engine::MaxTimeDeltaMs) / 1000.0;
666 constexpr auto UpdateTime = static_cast<double>(Engine::UpdateRateInMs) / 1000.0;

Callers 2

openFunction · 0.85
openFunction · 0.85

Calls 4

processMessagesFunction · 0.85
tickWaitFunction · 0.85
renderFunction · 0.70
getTimeFunction · 0.50

Tested by

no test coverage detected