diff options
-rw-r--r-- | src/openttd.cpp | 4 | ||||
-rw-r--r-- | src/saveload/saveload.cpp | 1 | ||||
-rw-r--r-- | src/saveload/saveload.h | 1 | ||||
-rw-r--r-- | src/statusbar_gui.cpp | 2 | ||||
-rw-r--r-- | src/variables.h | 5 | ||||
-rw-r--r-- | src/video/dedicated_v.cpp | 6 |
6 files changed, 9 insertions, 10 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 78cd3d6e2..808f8a3e7 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -90,6 +90,7 @@ void CallWindowTickEvent(); extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt); extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY); extern void ShowOSErrorBox(const char *buf, bool system); +extern bool _dedicated_forks; /** * Error handling for fatal user errors. @@ -567,8 +568,7 @@ int ttd_main(int argc, char *argv[]) #if defined(UNIX) && !defined(__MORPHOS__) /* We must fork here, or we'll end up without some resources we need (like sockets) */ - if (_dedicated_forks) - DedicatedFork(); + if (_dedicated_forks) DedicatedFork(); #endif AI::Initialize(); diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index a9d1e9f1e..ac84dd9a2 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -55,6 +55,7 @@ uint32 _ttdp_version; ///< version of TTDP savegame (if applicable) uint16 _sl_version; ///< the major savegame version identifier byte _sl_minor_version; ///< the minor savegame version, DO NOT USE! char _savegame_format[8]; ///< how to compress savegames +bool _do_autosave; ///< are we doing an autosave at the moment? typedef void WriterProc(size_t len); typedef size_t ReaderProc(); diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index d3cb32dfc..32a9429e3 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -342,5 +342,6 @@ bool SlObjectMember(void *object, const SaveLoad *sld); bool SaveloadCrashWithMissingNewGRFs(); extern char _savegame_format[8]; +extern bool _do_autosave; #endif /* SAVELOAD_H */ diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 430a397c6..debfdb7e9 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -22,7 +22,7 @@ #include "news_gui.h" #include "company_gui.h" #include "window_gui.h" -#include "variables.h" +#include "saveload/saveload.h" #include "window_func.h" #include "statusbar_gui.h" #include "core/geometry_func.hpp" diff --git a/src/variables.h b/src/variables.h index 77670620c..438d3b903 100644 --- a/src/variables.h +++ b/src/variables.h @@ -30,8 +30,6 @@ VARDEF int _palette_animation_counter; VARDEF uint32 _realtime_tick; -VARDEF bool _do_autosave; - VARDEF byte _display_opt; VARDEF bool _rightclick_emulate; @@ -46,7 +44,4 @@ VARDEF char *_log_file; /* landscape.cpp */ extern const byte _tileh_to_sprite[32]; -/* Forking stuff */ -VARDEF bool _dedicated_forks; - #endif /* VARIABLES_H */ diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index 2ce43f4c1..48e65c747 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -132,6 +132,9 @@ static void CloseWindowsConsoleThread() static void *_dedicated_video_mem; +/* Whether a fork has been done. */ +bool _dedicated_forks; + extern bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory subdir); extern void SwitchToMode(SwitchMode new_mode); @@ -295,8 +298,7 @@ void VideoDriver_Dedicated::MainLoop() uint32 prev_cur_ticks = cur_ticks; // to check for wrapping InteractiveRandom(); // randomness - if (!_dedicated_forks) - DedicatedHandleKeyInput(); + if (!_dedicated_forks) DedicatedHandleKeyInput(); cur_ticks = GetTime(); _realtime_tick += cur_ticks - prev_cur_ticks; |