MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GameLoop

Method GameLoop

src/video/video_driver.cpp:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28bool _video_vsync; ///< Whether we should use vsync (only if active video driver supports HW acceleration).
29
30void VideoDriver::GameLoop()
31{
32 this->next_game_tick += this->GetGameInterval();
33
34 /* Avoid next_game_tick getting behind more and more if it cannot keep up. */
35 auto now = std::chrono::steady_clock::now();
36 if (this->next_game_tick < now - ALLOWED_DRIFT * this->GetGameInterval()) this->next_game_tick = now;
37
38 {
39 std::lock_guard<std::mutex> lock(this->game_state_mutex);
40
41 ::GameLoop();
42 }
43}
44
45void VideoDriver::GameThread()
46{

Callers 2

GameThreadMethod · 0.95
TickMethod · 0.95

Calls 3

GetGameIntervalMethod · 0.95
nowClass · 0.85
GameLoopFunction · 0.85

Tested by

no test coverage detected