|
@@ -19,24 +19,25 @@
|
|
|
#include "viewport_func.h"
|
|
|
#include "gfx_func.h"
|
|
|
#include "map_func.h"
|
|
|
#include "date_func.h"
|
|
|
#include "core/random_func.hpp"
|
|
|
#include "engine_func.h"
|
|
|
#include "settings_type.h"
|
|
|
#include "newgrf_storage.h"
|
|
|
#include "water.h"
|
|
|
#include "blitter/factory.hpp"
|
|
|
#include "tilehighlight_func.h"
|
|
|
#include "saveload/saveload.h"
|
|
|
#include "void_map.h"
|
|
|
|
|
|
#include "table/sprites.h"
|
|
|
|
|
|
void GenerateClearTile();
|
|
|
void GenerateIndustries();
|
|
|
void GenerateUnmovables();
|
|
|
bool GenerateTowns();
|
|
|
void GenerateTrees();
|
|
|
|
|
|
void StartupEconomy();
|
|
|
void StartupCompanies();
|
|
|
void StartupDisasters();
|
|
@@ -97,24 +98,30 @@ static void _GenerateWorld(void *arg)
|
|
|
_random.SetSeed(_settings_game.game_creation.generation_seed);
|
|
|
SetGeneratingWorldProgress(GWP_MAP_INIT, 2);
|
|
|
SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);
|
|
|
|
|
|
IncreaseGeneratingWorldProgress(GWP_MAP_INIT);
|
|
|
/* Must start economy early because of the costs. */
|
|
|
StartupEconomy();
|
|
|
|
|
|
/* Don't generate landscape items when in the scenario editor. */
|
|
|
if (_gw.mode == GW_EMPTY) {
|
|
|
SetGeneratingWorldProgress(GWP_UNMOVABLE, 1);
|
|
|
|
|
|
/* Make sure the tiles at the north border are void tiles if needed. */
|
|
|
if (_settings_game.construction.freeform_edges) {
|
|
|
for (uint row = 0; row < MapSizeY(); row++) MakeVoid(TileXY(0, row));
|
|
|
for (uint col = 0; col < MapSizeX(); col++) MakeVoid(TileXY(col, 0));
|
|
|
}
|
|
|
|
|
|
/* Make the map the height of the patch setting */
|
|
|
if (_game_mode != GM_MENU) FlatEmptyWorld(_settings_game.game_creation.se_flat_world_height);
|
|
|
|
|
|
ConvertGroundTilesIntoWaterTiles();
|
|
|
IncreaseGeneratingWorldProgress(GWP_UNMOVABLE);
|
|
|
} else {
|
|
|
GenerateLandscape(_gw.mode);
|
|
|
GenerateClearTile();
|
|
|
|
|
|
/* only generate towns, tree and industries in newgame mode. */
|
|
|
if (_game_mode != GM_EDITOR) {
|
|
|
GenerateTowns();
|