From 1f9ec758aac11f97458b6bb609fc44cf5ff5b086 Mon Sep 17 00:00:00 2001 From: yexo Date: Sat, 14 Feb 2009 23:17:32 +0000 Subject: (svn r15495) -Revert (r15383,r15422): Loading NewGRFs depends on correct settings, but the economy can only be started after loading NewGRFs. In short: r15383 causes more problems then it's worth. --- src/genworld.cpp | 6 +++--- src/genworld_gui.cpp | 6 ++++-- src/openttd.cpp | 8 ++------ 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/genworld.cpp b/src/genworld.cpp index ff30e4720..1d6880208 100644 --- a/src/genworld.cpp +++ b/src/genworld.cpp @@ -284,13 +284,13 @@ void GenerateWorld(GenerateWorldMode mode, uint size_x, uint size_y) /* Set the date before loading sprites as some newgrfs check it */ SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1)); - InitializeGame(_gw.size_x, _gw.size_y, false); - PrepareGenerateWorldProgress(); - /* Load the right landscape stuff */ GfxLoadSprites(); LoadStringWidthTable(); + InitializeGame(_gw.size_x, _gw.size_y, false); + PrepareGenerateWorldProgress(); + /* Re-init the windowing system */ ResetWindowSystem(); diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index b3c70f212..10d1b97df 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -248,8 +248,8 @@ void StartGeneratingLandscape(glwp_modes mode) { DeleteAllNonVitalWindows(); - /* Copy the settings needed for creating a new map. */ - _settings_game.game_creation = _settings_newgame.game_creation; + /* Copy all XXX_newgame to XXX when coming from outside the editor */ + MakeNewgameSettingsLive(); ResetGRFConfig(true); SndPlayFx(SND_15_BEEP); @@ -442,6 +442,8 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow { break; case GLAND_GENERATE_BUTTON: // Generate + MakeNewgameSettingsLive(); + if (mode == GLWP_HEIGHTMAP && (this->x * 2 < (1U << _settings_newgame.game_creation.map_x) || this->x / 2 > (1U << _settings_newgame.game_creation.map_x) || diff --git a/src/openttd.cpp b/src/openttd.cpp index 96ee00c48..d2fc2c658 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -640,8 +640,8 @@ int ttd_main(int argc, char *argv[]) ResetGRFConfig(false); - /* Copy the settings needed for creating a new map. */ - _settings_game.game_creation = _settings_newgame.game_creation; + /* Make sure _settings is filled with _settings_newgame if we switch to a game directly */ + if (_switch_mode != SM_NONE) MakeNewgameSettingsLive(); /* initialize the ingame console */ IConsoleInit(); @@ -649,10 +649,6 @@ int ttd_main(int argc, char *argv[]) InitializeGUI(); IConsoleCmdExec("exec scripts/autoexec.scr 0"); - /* Initialise the sprite/string tables. */ - GfxLoadSprites(); - LoadStringWidthTable(); - GenerateWorld(GW_EMPTY, 64, 64); // Make the viewport initialization happy WaitTillGeneratedWorld(); -- cgit v1.2.3-70-g09d2