mirror of https://github.com/OpenTTD/OpenTTD
(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.
parent
40186486de
commit
34f9c4d00f
|
@ -1502,15 +1502,16 @@ static void GRFSaveConfig(IniFile *ini, const char *grpname, const GRFConfig *li
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common handler for saving/loading variables to the configuration file */
|
/* 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)
|
||||||
{
|
{
|
||||||
|
if (basic_settings) {
|
||||||
proc(ini, (const SettingDesc*)_misc_settings, "misc", NULL);
|
proc(ini, (const SettingDesc*)_misc_settings, "misc", NULL);
|
||||||
#if defined(WIN32) && !defined(DEDICATED)
|
#if defined(WIN32) && !defined(DEDICATED)
|
||||||
proc(ini, (const SettingDesc*)_win32_settings, "win32", NULL);
|
proc(ini, (const SettingDesc*)_win32_settings, "win32", NULL);
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
}
|
||||||
|
|
||||||
if (minimal) return;
|
if (other_settings) {
|
||||||
|
|
||||||
proc(ini, _settings, "patches", &_settings_newgame);
|
proc(ini, _settings, "patches", &_settings_newgame);
|
||||||
proc(ini, _currency_settings,"currency", &_custom_currency);
|
proc(ini, _currency_settings,"currency", &_custom_currency);
|
||||||
proc(ini, _company_settings, "company", &_settings_client.company);
|
proc(ini, _company_settings, "company", &_settings_client.company);
|
||||||
|
@ -1521,6 +1522,7 @@ static void HandleSettingDescs(IniFile *ini, SettingDescProc *proc, SettingDescP
|
||||||
proc_list(ini, "bans", &_network_ban_list);
|
proc_list(ini, "bans", &_network_ban_list);
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static IniFile *IniLoadConfig()
|
static IniFile *IniLoadConfig()
|
||||||
{
|
{
|
||||||
|
@ -1538,7 +1540,8 @@ void LoadFromConfig(bool minimal)
|
||||||
IniFile *ini = IniLoadConfig();
|
IniFile *ini = IniLoadConfig();
|
||||||
if (!minimal) ResetCurrencies(false); // Initialize the array of curencies, without preserving the custom one
|
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) {
|
if (!minimal) {
|
||||||
_grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false);
|
_grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false);
|
||||||
|
|
Loading…
Reference in New Issue