summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-27 20:28:10 +0000
committerrubidium <rubidium@openttd.org>2009-10-27 20:28:10 +0000
commit778f6533ea9932ab79d495b08e625f1ffb6fc23e (patch)
treea8ea5a136a10e439720a277be044d7c5ffa96187 /src
parent0b5698a5b0ae79bf24ef0bcc220460cbc83e16c0 (diff)
downloadopenttd-778f6533ea9932ab79d495b08e625f1ffb6fc23e.tar.xz
(svn r17893) -Feature [FS#2633]: make it possible to disable background saving, only via the config file/in game console though
Diffstat (limited to 'src')
-rw-r--r--src/saveload/saveload.cpp2
-rw-r--r--src/settings_type.h1
-rw-r--r--src/table/settings.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 2c5eab3d0..f423d2c46 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -1852,7 +1852,7 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, boo
SlWriteFill(); // flush the save buffer
SaveFileStart();
- if (_network_server) threaded = false;
+ if (_network_server || !_settings_client.gui.threaded_saves) threaded = false;
if (!threaded || !ThreadObject::New(&SaveFileToDiskThread, NULL, &_save_thread)) {
if (threaded) DEBUG(sl, 1, "Cannot create savegame thread, reverting to single-threaded mode...");
diff --git a/src/settings_type.h b/src/settings_type.h
index fb986adf9..1ad632436 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -67,6 +67,7 @@ struct GUISettings {
uint8 window_soft_limit; ///< soft limit of maximum number of non-stickied non-vital windows (0 = no limit)
bool always_build_infrastructure; ///< always allow building of infrastructure, even when you do not have the vehicles for it
byte autosave; ///< how often should we do autosaves?
+ bool threaded_saves; ///< should we do threaded saves?
bool keep_all_autosave; ///< name the autosave in a different way
bool autosave_on_exit; ///< save an autosave when you quit the game, but do not ask "Do you really want to quit?"
uint8 date_format_in_default_names; ///< should the default savegame/screenshot name use long dates (31th Dec 2008), short dates (31-12-2008) or ISO dates (2008-12-31)
diff --git a/src/table/settings.h b/src/table/settings.h
index 0fee7ef20..38333ede3 100644
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -525,6 +525,7 @@ const SettingDesc _settings[] = {
/***************************************************************************/
/* Unsaved setting variables. */
SDTC_OMANY(gui.autosave, SLE_UINT8, S, 0, 1, 4, _autosave_interval, STR_NULL, NULL),
+ SDTC_BOOL(gui.threaded_saves, S, 0, true, STR_NULL, NULL),
SDTC_OMANY(gui.date_format_in_default_names,SLE_UINT8,S,MS, 0, 2, _savegame_date, STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES, NULL),
SDTC_BOOL(gui.vehicle_speed, S, 0, true, STR_CONFIG_SETTING_VEHICLESPEED, NULL),
SDTC_BOOL(gui.status_long_date, S, 0, true, STR_CONFIG_SETTING_LONGDATE, NULL),