(svn r7098) -Regression (r7094): Zoom buttons were not properly updated with a new/loaded game. The
authorDarkvater
Tue, 07 Nov 2006 14:41:53 +0000
changeset 5048 b784951def0a
parent 5047 05c7e74ff3e5
child 5049 43340069c983
(svn r7098) -Regression (r7094): Zoom buttons were not properly updated with a new/loaded game. The
good thing is, we got rid of even more magic code (tm)
genworld.c
genworld_gui.c
main_gui.c
--- a/genworld.c	Tue Nov 07 13:09:44 2006 +0000
+++ b/genworld.c	Tue Nov 07 14:41:53 2006 +0000
@@ -249,19 +249,23 @@
 	/* Create toolbars */
 	SetupColorsAndInitialWindow();
 
-	if (_network_dedicated || (_gw.thread = OTTDCreateThread(&_GenerateWorld, (void *)"")) == NULL) {
+	/* Load the right landscape stuff */
+	GfxLoadSprites();
+	if (_network_dedicated ||
+	    (_gw.thread = OTTDCreateThread(&_GenerateWorld, NULL)) == NULL) {
+		DEBUG(misc, 1) ("[Sl] Cannot create savegame thread, reverting to single-threaded mode...");
 		_gw.threaded = false;
 		_GenerateWorld(NULL);
-	} else {
-		/* Remove any open window */
-		DeleteAllNonVitalWindows();
-
-		/* Don't show the dialog if we don't have a thread */
-		ShowGenerateWorldProgress();
+		return;
 	}
 
+	/* Remove any open window */
+	DeleteAllNonVitalWindows();
 	/* Hide vital windows, because we don't allow to use them */
-	if (_gw.thread != NULL) HideVitalWindows();
+	HideVitalWindows();
+
+	/* Don't show the dialog if we don't have a thread */
+	ShowGenerateWorldProgress();
 
 	/* Centre the view on the map */
 	if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
--- a/genworld_gui.c	Tue Nov 07 13:09:44 2006 +0000
+++ b/genworld_gui.c	Tue Nov 07 14:41:53 2006 +0000
@@ -164,8 +164,6 @@
 	UpdatePatches();
 	_opt_ptr = &_opt;
 	*_opt_ptr = _opt_newgame;
-	/* Load the right landscape stuff */
-	GfxLoadSprites();
 
 	SndPlayFx(SND_15_BEEP);
 	switch (mode) {
--- a/main_gui.c	Tue Nov 07 13:09:44 2006 +0000
+++ b/main_gui.c	Tue Nov 07 14:41:53 2006 +0000
@@ -879,7 +879,6 @@
 			vp->virtual_width <<= 1;
 			vp->virtual_height <<= 1;
 			break;
-		default: return false;
 	}
 
 	SetWindowDirty(w);
@@ -2413,13 +2412,9 @@
 {
 	Window *w;
 
-	if (_game_mode != GM_EDITOR) {
-		w = AllocateWindowDesc(&_toolb_normal_desc);
-		DisableWindowWidget(w, 18);
-	} else {
-		w = AllocateWindowDesc(&_toolb_scen_desc);
-		DisableWindowWidget(w, 10);
-	}
+	w = AllocateWindowDesc((_game_mode != GM_EDITOR) ? &_toolb_normal_desc : &_toolb_scen_desc);
+	DoZoomInOutWindow(ZOOM_NONE, w);
+
 	CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
 
 	SetWindowWidgetDisabledState(w, 0, _networking && !_network_server); // if not server, disable pause button