genworld.c
changeset 5048 b784951def0a
parent 5045 846098142ffe
child 5145 d4a8882b32ef
equal deleted inserted replaced
5047:05c7e74ff3e5 5048:b784951def0a
   247 	LoadStringWidthTable();
   247 	LoadStringWidthTable();
   248 
   248 
   249 	/* Create toolbars */
   249 	/* Create toolbars */
   250 	SetupColorsAndInitialWindow();
   250 	SetupColorsAndInitialWindow();
   251 
   251 
   252 	if (_network_dedicated || (_gw.thread = OTTDCreateThread(&_GenerateWorld, (void *)"")) == NULL) {
   252 	/* Load the right landscape stuff */
       
   253 	GfxLoadSprites();
       
   254 	if (_network_dedicated ||
       
   255 	    (_gw.thread = OTTDCreateThread(&_GenerateWorld, NULL)) == NULL) {
       
   256 		DEBUG(misc, 1) ("[Sl] Cannot create savegame thread, reverting to single-threaded mode...");
   253 		_gw.threaded = false;
   257 		_gw.threaded = false;
   254 		_GenerateWorld(NULL);
   258 		_GenerateWorld(NULL);
   255 	} else {
   259 		return;
   256 		/* Remove any open window */
   260 	}
   257 		DeleteAllNonVitalWindows();
   261 
   258 
   262 	/* Remove any open window */
   259 		/* Don't show the dialog if we don't have a thread */
   263 	DeleteAllNonVitalWindows();
   260 		ShowGenerateWorldProgress();
       
   261 	}
       
   262 
       
   263 	/* Hide vital windows, because we don't allow to use them */
   264 	/* Hide vital windows, because we don't allow to use them */
   264 	if (_gw.thread != NULL) HideVitalWindows();
   265 	HideVitalWindows();
       
   266 
       
   267 	/* Don't show the dialog if we don't have a thread */
       
   268 	ShowGenerateWorldProgress();
   265 
   269 
   266 	/* Centre the view on the map */
   270 	/* Centre the view on the map */
   267 	if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
   271 	if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
   268 		ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2));
   272 		ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2));
   269 	}
   273 	}