From 8f209b0dc42717df34a135b6b5764726d8af3a04 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 28 Aug 2023 20:27:05 +0100 Subject: [PATCH] Mark main thread as the game thread if video driver not using threads --- src/video/video_driver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp index 8b70d53376..7b3de5c216 100644 --- a/src/video/video_driver.cpp +++ b/src/video/video_driver.cpp @@ -103,6 +103,8 @@ void VideoDriver::StartGameThread() this->is_game_threaded = StartNewThread(&this->game_thread, "ottd:game", &VideoDriver::GameThreadThunk, this); } + if (!this->is_game_threaded) SetSelfAsGameThread(); + DEBUG(driver, 1, "using %sthread for game-loop", this->is_game_threaded ? "" : "no "); }