File diff r5375:772a1c1f8fa4 → r5376:226f4edfd4b1
genworld.c
Show inline comments
 
@@ -124,25 +124,25 @@ static void *_GenerateWorld(void *arg)
 
	// No need to run the tile loop in the scenario editor.
 
	if (_gw.mode != GW_EMPTY) {
 
		uint i;
 

	
 
		SetGeneratingWorldProgress(GWP_RUNTILELOOP, 0x500);
 
		for (i = 0; i < 0x500; i++) {
 
			RunTileLoop();
 
			IncreaseGeneratingWorldProgress(GWP_RUNTILELOOP);
 
		}
 
	}
 

	
 
	ResetObjectToPlace();
 
	_local_player = _gw.lp;
 
	SetLocalPlayer(_gw.lp);
 

	
 
	SetGeneratingWorldProgress(GWP_GAME_START, 1);
 
	/* Call any callback */
 
	if (_gw.proc != NULL) _gw.proc();
 
	IncreaseGeneratingWorldProgress(GWP_GAME_START);
 

	
 
	if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE);
 
	/* Show all vital windows again, because we have hidden them */
 
	if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
 
	_gw.active   = false;
 
	_gw.thread   = NULL;
 
	_gw.proc     = NULL;
 
@@ -240,25 +240,25 @@ void GenerateWorld(int mode, uint size_x
 
	_gw.mode   = mode;
 
	_gw.size_x = size_x;
 
	_gw.size_y = size_y;
 
	_gw.active = true;
 
	_gw.abort  = false;
 
	_gw.abortp = NULL;
 
	_gw.lp     = _local_player;
 
	_gw.wait_for_draw = false;
 
	_gw.quit_thread   = false;
 
	_gw.threaded      = true;
 

	
 
	/* This disables some commands and stuff */
 
	_local_player   = PLAYER_SPECTATOR;
 
	SetLocalPlayer(PLAYER_SPECTATOR);
 
	/* Make sure everything is done via OWNER_NONE */
 
	_current_player = OWNER_NONE;
 

	
 
	/* Set the date before loading sprites as some newgrfs check it */
 
	SetDate(ConvertYMDToDate(_patches.starting_year, 0, 1));
 

	
 
	/* Load the right landscape stuff */
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
 

	
 
	InitializeGame(IG_NONE, _gw.size_x, _gw.size_y);
 
	PrepareGenerateWorldProgress();