mirror of https://github.com/OpenTTD/OpenTTD
(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)release/0.5
parent
745a5b8cc3
commit
c4e4fa98fd
16
genworld.c
16
genworld.c
|
@ -249,19 +249,23 @@ void GenerateWorld(int mode, uint size_x, uint size_y)
|
||||||
/* Create toolbars */
|
/* Create toolbars */
|
||||||
SetupColorsAndInitialWindow();
|
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;
|
_gw.threaded = false;
|
||||||
_GenerateWorld(NULL);
|
_GenerateWorld(NULL);
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove any open window */
|
/* Remove any open window */
|
||||||
DeleteAllNonVitalWindows();
|
DeleteAllNonVitalWindows();
|
||||||
|
/* Hide vital windows, because we don't allow to use them */
|
||||||
|
HideVitalWindows();
|
||||||
|
|
||||||
/* Don't show the dialog if we don't have a thread */
|
/* Don't show the dialog if we don't have a thread */
|
||||||
ShowGenerateWorldProgress();
|
ShowGenerateWorldProgress();
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide vital windows, because we don't allow to use them */
|
|
||||||
if (_gw.thread != NULL) HideVitalWindows();
|
|
||||||
|
|
||||||
/* Centre the view on the map */
|
/* Centre the view on the map */
|
||||||
if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
|
if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
|
||||||
|
|
|
@ -164,8 +164,6 @@ static void StartGeneratingLandscape(glwp_modes mode)
|
||||||
UpdatePatches();
|
UpdatePatches();
|
||||||
_opt_ptr = &_opt;
|
_opt_ptr = &_opt;
|
||||||
*_opt_ptr = _opt_newgame;
|
*_opt_ptr = _opt_newgame;
|
||||||
/* Load the right landscape stuff */
|
|
||||||
GfxLoadSprites();
|
|
||||||
|
|
||||||
SndPlayFx(SND_15_BEEP);
|
SndPlayFx(SND_15_BEEP);
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
11
main_gui.c
11
main_gui.c
|
@ -879,7 +879,6 @@ bool DoZoomInOutWindow(int how, Window *w)
|
||||||
vp->virtual_width <<= 1;
|
vp->virtual_width <<= 1;
|
||||||
vp->virtual_height <<= 1;
|
vp->virtual_height <<= 1;
|
||||||
break;
|
break;
|
||||||
default: return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
|
@ -2413,13 +2412,9 @@ void ShowVitalWindows(void)
|
||||||
{
|
{
|
||||||
Window *w;
|
Window *w;
|
||||||
|
|
||||||
if (_game_mode != GM_EDITOR) {
|
w = AllocateWindowDesc((_game_mode != GM_EDITOR) ? &_toolb_normal_desc : &_toolb_scen_desc);
|
||||||
w = AllocateWindowDesc(&_toolb_normal_desc);
|
DoZoomInOutWindow(ZOOM_NONE, w);
|
||||||
DisableWindowWidget(w, 18);
|
|
||||||
} else {
|
|
||||||
w = AllocateWindowDesc(&_toolb_scen_desc);
|
|
||||||
DisableWindowWidget(w, 10);
|
|
||||||
}
|
|
||||||
CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
|
CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
|
||||||
|
|
||||||
SetWindowWidgetDisabledState(w, 0, _networking && !_network_server); // if not server, disable pause button
|
SetWindowWidgetDisabledState(w, 0, _networking && !_network_server); // if not server, disable pause button
|
||||||
|
|
Loading…
Reference in New Issue