1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Matthias Urlichs
21efa4da12 Merge bac9bf93bc into 7eb042feac 2025-07-24 04:46:47 +00:00
Matthias Urlichs
bac9bf93bc Codefix: Null video driver: take the game lock
The game loop must run with the game lock held.
2025-02-05 06:40:50 +01:00
Matthias Urlichs
abdea49d24 Codechange: Null video driver: End on game exit
The Null driver now exits when the game ends.

It also gains the ability to run for an unlimited number of
ticks (using '-v null:ticks=0').
2025-02-04 20:47:51 +01:00

View File

@@ -50,8 +50,11 @@ void VideoDriver_Null::MainLoop()
{ {
uint i; uint i;
for (i = 0; i < this->ticks; i++) { for (i = 0; i < this->ticks && ! _exit_game; i++) {
{
std::lock_guard<std::mutex> lock(this->game_state_mutex);
::GameLoop(); ::GameLoop();
}
::InputLoop(); ::InputLoop();
::UpdateWindows(); ::UpdateWindows();
} }