mirror of https://github.com/OpenTTD/OpenTTD
(svn r6365) -Cleanup: remove IsGeneratingWorld calls that are either not called or have no effect.
parent
e98adc5d0a
commit
03f963af58
36
main_gui.c
36
main_gui.c
|
@ -1024,7 +1024,7 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
|
||||||
|
|
||||||
vp = w->viewport;
|
vp = w->viewport;
|
||||||
|
|
||||||
if (_game_mode != GM_MENU && !IsGeneratingWorld()) {
|
if (_game_mode != GM_MENU) {
|
||||||
if ((in && vp->zoom == 0) || (!in && vp->zoom == 2))
|
if ((in && vp->zoom == 0) || (!in && vp->zoom == 2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1777,8 +1777,6 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
|
||||||
case WE_KEYPRESS: {
|
case WE_KEYPRESS: {
|
||||||
PlayerID local = (_local_player != OWNER_SPECTATOR) ? _local_player : 0;
|
PlayerID local = (_local_player != OWNER_SPECTATOR) ? _local_player : 0;
|
||||||
|
|
||||||
if (IsGeneratingWorld()) break;
|
|
||||||
|
|
||||||
switch (e->keypress.keycode) {
|
switch (e->keypress.keycode) {
|
||||||
case WKC_F1: case WKC_PAUSE:
|
case WKC_F1: case WKC_PAUSE:
|
||||||
ToolbarPauseClick(w);
|
ToolbarPauseClick(w);
|
||||||
|
@ -2106,7 +2104,7 @@ static void StatusBarWndProc(Window *w, WindowEvent *e)
|
||||||
70, 1, (_pause || _patches.status_long_date) ? STR_00AF : STR_00AE, 0
|
70, 1, (_pause || _patches.status_long_date) ? STR_00AF : STR_00AE, 0
|
||||||
);
|
);
|
||||||
|
|
||||||
if (p != NULL && !IsGeneratingWorld()) {
|
if (p != NULL) {
|
||||||
// Draw player money
|
// Draw player money
|
||||||
SetDParam64(0, p->money64);
|
SetDParam64(0, p->money64);
|
||||||
DrawStringCentered(570, 1, p->player_money >= 0 ? STR_0004 : STR_0005, 0);
|
DrawStringCentered(570, 1, p->player_money >= 0 ? STR_0004 : STR_0005, 0);
|
||||||
|
@ -2124,7 +2122,7 @@ static void StatusBarWndProc(Window *w, WindowEvent *e)
|
||||||
if (!DrawScrollingStatusText(&_statusbar_news_item, WP(w,def_d).data_1))
|
if (!DrawScrollingStatusText(&_statusbar_news_item, WP(w,def_d).data_1))
|
||||||
WP(w,def_d).data_1 = -1280;
|
WP(w,def_d).data_1 = -1280;
|
||||||
} else {
|
} else {
|
||||||
if (p != NULL && !IsGeneratingWorld()) {
|
if (p != NULL) {
|
||||||
// This is the default text
|
// This is the default text
|
||||||
SetDParam(0, p->name_1);
|
SetDParam(0, p->name_1);
|
||||||
SetDParam(1, p->name_2);
|
SetDParam(1, p->name_2);
|
||||||
|
@ -2225,12 +2223,6 @@ static void MainWindowWndProc(Window *w, WindowEvent *e)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WE_KEYPRESS:
|
case WE_KEYPRESS:
|
||||||
if (e->keypress.keycode == WKC_BACKQUOTE) {
|
|
||||||
if (!IsGeneratingWorld()) IConsoleSwitch();
|
|
||||||
e->keypress.cont = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (e->keypress.keycode) {
|
switch (e->keypress.keycode) {
|
||||||
case 'Q' | WKC_CTRL:
|
case 'Q' | WKC_CTRL:
|
||||||
case 'Q' | WKC_META:
|
case 'Q' | WKC_META:
|
||||||
|
@ -2238,7 +2230,19 @@ static void MainWindowWndProc(Window *w, WindowEvent *e)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_game_mode == GM_MENU || IsGeneratingWorld()) break;
|
/* Disable all key shortcuts, except quit shortcuts when
|
||||||
|
* generating the world, otherwise they create threading
|
||||||
|
* problem during the generating, resulting in random
|
||||||
|
* assertions that are hard to trigger and debug */
|
||||||
|
if (IsGeneratingWorld()) break;
|
||||||
|
|
||||||
|
if (e->keypress.keycode == WKC_BACKQUOTE) {
|
||||||
|
IConsoleSwitch();
|
||||||
|
e->keypress.cont = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_game_mode == GM_MENU) break;
|
||||||
|
|
||||||
switch (e->keypress.keycode) {
|
switch (e->keypress.keycode) {
|
||||||
case 'C':
|
case 'C':
|
||||||
|
@ -2363,14 +2367,10 @@ void ShowVitalWindows(void)
|
||||||
|
|
||||||
if (_game_mode != GM_EDITOR) {
|
if (_game_mode != GM_EDITOR) {
|
||||||
w = AllocateWindowDesc(&_toolb_normal_desc);
|
w = AllocateWindowDesc(&_toolb_normal_desc);
|
||||||
/* Disable zoom-in for normal things, and zoom-out if we come
|
w->disabled_state = 1 << 18;
|
||||||
* from world-generating. */
|
|
||||||
w->disabled_state = IsGeneratingWorld() ? (1 << 18) : (1 << 17);
|
|
||||||
} else {
|
} else {
|
||||||
w = AllocateWindowDesc(&_toolb_scen_desc);
|
w = AllocateWindowDesc(&_toolb_scen_desc);
|
||||||
/* Disable zoom-in for normal things, and zoom-out if we come
|
w->disabled_state = 1 << 10;
|
||||||
* from world-generating. */
|
|
||||||
w->disabled_state = IsGeneratingWorld() ? (1 << 10) : (1 << 9);
|
|
||||||
}
|
}
|
||||||
CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
|
CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
|
||||||
|
|
||||||
|
|
|
@ -899,7 +899,7 @@ static void DoAutosave(void)
|
||||||
|
|
||||||
static void ScrollMainViewport(int x, int y)
|
static void ScrollMainViewport(int x, int y)
|
||||||
{
|
{
|
||||||
if (_game_mode != GM_MENU && !IsGeneratingWorld()) {
|
if (_game_mode != GM_MENU) {
|
||||||
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
|
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
|
||||||
assert(w);
|
assert(w);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ extern void HideMenuBar(void);
|
||||||
#include "../window.h"
|
#include "../window.h"
|
||||||
#include "../network.h"
|
#include "../network.h"
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
#include "../genworld.h"
|
|
||||||
#include "../os/macosx/splash.h"
|
#include "../os/macosx/splash.h"
|
||||||
|
|
||||||
#include "cocoa_v.h"
|
#include "cocoa_v.h"
|
||||||
|
@ -711,7 +710,7 @@ static void QZ_GameLoop(void)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2;
|
if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2;
|
||||||
} else if (_fast_forward & 2 && !IsGeneratingWorld()) {
|
} else if (_fast_forward & 2) {
|
||||||
_fast_forward = 0;
|
_fast_forward = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "../window.h"
|
#include "../window.h"
|
||||||
#include "../network.h"
|
#include "../network.h"
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
#include "../genworld.h"
|
|
||||||
#include "sdl_v.h"
|
#include "sdl_v.h"
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
|
@ -461,7 +460,7 @@ static void SdlVideoMainLoop(void)
|
||||||
if (keys[SDLK_TAB])
|
if (keys[SDLK_TAB])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (!_networking && _game_mode != GM_MENU && !IsGeneratingWorld()) _fast_forward |= 2;
|
if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2;
|
||||||
} else if (_fast_forward & 2) {
|
} else if (_fast_forward & 2) {
|
||||||
_fast_forward = 0;
|
_fast_forward = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
#include "../win32.h"
|
#include "../win32.h"
|
||||||
#include "../window.h"
|
#include "../window.h"
|
||||||
#include "../genworld.h"
|
|
||||||
#include "win32_v.h"
|
#include "win32_v.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
@ -801,7 +800,7 @@ static void Win32GdiMainLoop(void)
|
||||||
* real key is in the upper 16 bits (see WM_SYSKEYDOWN in WndProcGdi()) */
|
* real key is in the upper 16 bits (see WM_SYSKEYDOWN in WndProcGdi()) */
|
||||||
if ((_pressed_key >> 16) & WKC_TAB &&
|
if ((_pressed_key >> 16) & WKC_TAB &&
|
||||||
#endif
|
#endif
|
||||||
!_networking && _game_mode != GM_MENU && !IsGeneratingWorld())
|
!_networking && _game_mode != GM_MENU)
|
||||||
_fast_forward |= 2;
|
_fast_forward |= 2;
|
||||||
} else if (_fast_forward & 2) {
|
} else if (_fast_forward & 2) {
|
||||||
_fast_forward = 0;
|
_fast_forward = 0;
|
||||||
|
|
Loading…
Reference in New Issue