diff options
author | frosch <frosch@openttd.org> | 2011-12-04 13:21:51 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-12-04 13:21:51 +0000 |
commit | 34f9c4d00fc32a6690cdd91f39db603f299976ec (patch) | |
tree | dff42d02817e65ca98cebe582ed688832abd1488 /src | |
parent | 40186486dedb3f161c03baf3874c335b8758a647 (diff) | |
download | openttd-34f9c4d00fc32a6690cdd91f39db603f299976ec.tar.xz |
(svn r23427) -Fix: Do not load screen resolution and other basic stuff after bootstrap is finished. It was already loaded before, and might got changed already.
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index a72bf5874..d8067574b 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1502,24 +1502,26 @@ static void GRFSaveConfig(IniFile *ini, const char *grpname, const GRFConfig *li } /* Common handler for saving/loading variables to the configuration file */ -static void HandleSettingDescs(IniFile *ini, SettingDescProc *proc, SettingDescProcList *proc_list, bool minimal = false) +static void HandleSettingDescs(IniFile *ini, SettingDescProc *proc, SettingDescProcList *proc_list, bool basic_settings = true, bool other_settings = true) { - proc(ini, (const SettingDesc*)_misc_settings, "misc", NULL); + if (basic_settings) { + proc(ini, (const SettingDesc*)_misc_settings, "misc", NULL); #if defined(WIN32) && !defined(DEDICATED) - proc(ini, (const SettingDesc*)_win32_settings, "win32", NULL); + proc(ini, (const SettingDesc*)_win32_settings, "win32", NULL); #endif /* WIN32 */ + } - if (minimal) return; - - proc(ini, _settings, "patches", &_settings_newgame); - proc(ini, _currency_settings,"currency", &_custom_currency); - proc(ini, _company_settings, "company", &_settings_client.company); + if (other_settings) { + proc(ini, _settings, "patches", &_settings_newgame); + proc(ini, _currency_settings,"currency", &_custom_currency); + proc(ini, _company_settings, "company", &_settings_client.company); #ifdef ENABLE_NETWORK - proc_list(ini, "server_bind_addresses", &_network_bind_list); - proc_list(ini, "servers", &_network_host_list); - proc_list(ini, "bans", &_network_ban_list); + proc_list(ini, "server_bind_addresses", &_network_bind_list); + proc_list(ini, "servers", &_network_host_list); + proc_list(ini, "bans", &_network_ban_list); #endif /* ENABLE_NETWORK */ + } } static IniFile *IniLoadConfig() @@ -1538,7 +1540,8 @@ void LoadFromConfig(bool minimal) IniFile *ini = IniLoadConfig(); if (!minimal) ResetCurrencies(false); // Initialize the array of curencies, without preserving the custom one - HandleSettingDescs(ini, IniLoadSettings, IniLoadSettingList, minimal); + /* Load basic settings only during bootstrap, load other settings not during bootstrap */ + HandleSettingDescs(ini, IniLoadSettings, IniLoadSettingList, minimal, !minimal); if (!minimal) { _grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false); |