src/genworld.cpp
branchNewGRF_ports
changeset 6719 4cc327ad39d5
parent 6573 7624f942237f
child 6871 5a9dc001e1ad
equal deleted inserted replaced
6718:5a8b295aa345 6719:4cc327ad39d5
     3 /** @file genworld.cpp */
     3 /** @file genworld.cpp */
     4 
     4 
     5 #include "stdafx.h"
     5 #include "stdafx.h"
     6 #include "openttd.h"
     6 #include "openttd.h"
     7 #include "functions.h"
     7 #include "functions.h"
       
     8 #include "landscape.h"
     8 #include "player.h"
     9 #include "player.h"
     9 #include "table/sprites.h"
    10 #include "table/sprites.h"
    10 #include "variables.h"
    11 #include "variables.h"
    11 #include "thread.h"
    12 #include "thread.h"
       
    13 #include "command.h"
    12 #include "genworld.h"
    14 #include "genworld.h"
    13 #include "gfx.h"
    15 #include "gfx.h"
    14 #include "gfxinit.h"
    16 #include "gfxinit.h"
    15 #include "gui.h"
    17 #include "gui.h"
    16 #include "network/network.h"
    18 #include "network/network.h"
    17 #include "debug.h"
    19 #include "debug.h"
    18 #include "settings.h"
    20 #include "settings.h"
    19 #include "heightmap.h"
    21 #include "heightmap.h"
    20 #include "date.h"
    22 #include "date.h"
    21 
    23 
    22 void GenerateLandscape(byte mode);
       
    23 void GenerateClearTile();
    24 void GenerateClearTile();
    24 void GenerateIndustries();
    25 void GenerateIndustries();
    25 void GenerateUnmovables();
    26 void GenerateUnmovables();
    26 bool GenerateTowns();
    27 bool GenerateTowns();
    27 void GenerateTrees();
    28 void GenerateTrees();
    29 void StartupEconomy();
    30 void StartupEconomy();
    30 void StartupPlayers();
    31 void StartupPlayers();
    31 void StartupDisasters();
    32 void StartupDisasters();
    32 
    33 
    33 void InitializeGame(int mode, uint size_x, uint size_y);
    34 void InitializeGame(int mode, uint size_x, uint size_y);
    34 
       
    35 void ConvertGroundTilesIntoWaterTiles();
       
    36 
    35 
    37 /* Please only use this variable in genworld.h and genworld.c and
    36 /* Please only use this variable in genworld.h and genworld.c and
    38  *  nowhere else. For speed improvements we need it to be global, but
    37  *  nowhere else. For speed improvements we need it to be global, but
    39  *  in no way the meaning of it is to use it anywhere else besides
    38  *  in no way the meaning of it is to use it anywhere else besides
    40  *  in the genworld.h and genworld.c! -- TrueLight */
    39  *  in the genworld.h and genworld.c! -- TrueLight */
   152 
   151 
   153 	DeleteWindowById(WC_GENERATE_PROGRESS_WINDOW, 0);
   152 	DeleteWindowById(WC_GENERATE_PROGRESS_WINDOW, 0);
   154 	MarkWholeScreenDirty();
   153 	MarkWholeScreenDirty();
   155 
   154 
   156 	if (_network_dedicated) DEBUG(net, 0, "Map generated, starting game");
   155 	if (_network_dedicated) DEBUG(net, 0, "Map generated, starting game");
       
   156 
       
   157 	if (_patches.pause_on_newgame && _game_mode == GM_NORMAL) DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
   157 
   158 
   158 	return NULL;
   159 	return NULL;
   159 }
   160 }
   160 
   161 
   161 /**
   162 /**
   287 	/* Don't show the dialog if we don't have a thread */
   288 	/* Don't show the dialog if we don't have a thread */
   288 	ShowGenerateWorldProgress();
   289 	ShowGenerateWorldProgress();
   289 
   290 
   290 	/* Centre the view on the map */
   291 	/* Centre the view on the map */
   291 	if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
   292 	if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
   292 		ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2));
   293 		ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2), true);
   293 	}
   294 	}
   294 }
   295 }