diff --git a/src/gfx.cpp b/src/gfx.cpp index fc9d1455cd..7c5982e3e8 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -48,7 +48,7 @@ bool _right_button_clicked; ///< Is right mouse button clicked? DrawPixelInfo _screen; bool _screen_disable_anim = false; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot) bool _check_special_modes; -bool _exit_game; +std::atomic _exit_game; GameMode _game_mode; SwitchMode _switch_mode; ///< The next mainloop command. PauseMode _pause_mode; diff --git a/src/openttd.h b/src/openttd.h index c183bcf7e8..dc03efd1f8 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -10,6 +10,7 @@ #ifndef OPENTTD_H #define OPENTTD_H +#include #include "core/enum_type.hpp" /** Mode which defines the state of the game. */ @@ -57,7 +58,7 @@ enum ExtraDisplayOptions { extern GameMode _game_mode; extern SwitchMode _switch_mode; extern bool _check_special_modes; -extern bool _exit_game; +extern std::atomic _exit_game; extern bool _save_config; /** Modes of pausing we've got */ diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index 754b3c0ef0..bec6f6a9e1 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -15,12 +15,14 @@ #include "../thread.h" #include "null_v.h" +#include + #include "../safeguards.h" /** Factory for the null video driver. */ static FVideoDriver_Null iFVideoDriver_Null; -extern bool _exit_game; +extern std::atomic _exit_game; const char *VideoDriver_Null::Start(const StringList &parm) {