(svn r17893) -Feature [FS#2633]: make it possible to disable background saving, only via the config file/in game console though

This commit is contained in:
rubidium 2009-10-27 20:28:10 +00:00
parent 0b5698a5b0
commit 778f6533ea
3 changed files with 3 additions and 1 deletions

View File

@ -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...");

View File

@ -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)

View File

@ -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),