summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-03-06 20:59:52 +0000
committertruelight <truelight@openttd.org>2007-03-06 20:59:52 +0000
commit43133c766c850ac4be15c9d357183d21aa765cc0 (patch)
tree589dd69d82d0ad95f4e1c72216940e55d6208cf8
parent5bb9aed844e4c37f9c7bcb01772c409289c2ef86 (diff)
downloadopenttd-43133c766c850ac4be15c9d357183d21aa765cc0.tar.xz
(svn r9034) -Codechange: renamed _pause to _pause_game, as some targets already have
a symbol called _pause (and therefor our variable conflicts with thatone. We shouldn't be using _ as global indicator.....)
-rw-r--r--src/console_cmds.cpp4
-rw-r--r--src/gfx.cpp2
-rw-r--r--src/gfx.h2
-rw-r--r--src/main_gui.cpp12
-rw-r--r--src/misc.cpp4
-rw-r--r--src/misc_cmd.cpp4
-rw-r--r--src/oldloader.cpp2
-rw-r--r--src/openttd.cpp8
-rw-r--r--src/video/sdl_v.cpp2
-rw-r--r--src/video/win32_v.cpp2
-rw-r--r--src/window.cpp2
11 files changed, 22 insertions, 22 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 5edde43be..4d3ac74fa 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -499,7 +499,7 @@ DEF_CONSOLE_CMD(ConPauseGame)
return true;
}
- if (_pause == 0) {
+ if (_pause_game == 0) {
DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
IConsolePrint(_icolour_def, "Game paused.");
} else {
@@ -516,7 +516,7 @@ DEF_CONSOLE_CMD(ConUnPauseGame)
return true;
}
- if (_pause != 0) {
+ if (_pause_game != 0) {
DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
IConsolePrint(_icolour_def, "Game unpaused.");
} else {
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 2599344a5..8086431f4 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -37,7 +37,7 @@ DrawPixelInfo _screen;
bool _exit_game;
bool _networking; ///< are we in networking mode?
byte _game_mode;
-byte _pause;
+byte _pause_game;
int _pal_first_dirty;
int _pal_last_dirty;
diff --git a/src/gfx.h b/src/gfx.h
index f4f2d6a88..37444baff 100644
--- a/src/gfx.h
+++ b/src/gfx.h
@@ -156,7 +156,7 @@ extern DrawPixelInfo _screen;
extern bool _exit_game;
extern bool _networking; ///< are we in networking mode?
extern byte _game_mode;
-extern byte _pause;
+extern byte _pause_game;
extern int _pal_first_dirty;
extern int _pal_last_dirty;
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index f5933c5c7..2bd909dcf 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -136,7 +136,7 @@ static void ToolbarPauseClick(Window *w)
{
if (_networking && !_network_server) return; // only server can pause the game
- if (DoCommandP(0, _pause ? 0 : 1, 0, NULL, CMD_PAUSE)) SndPlayFx(SND_15_BEEP);
+ if (DoCommandP(0, _pause_game ? 0 : 1, 0, NULL, CMD_PAUSE)) SndPlayFx(SND_15_BEEP);
}
static void ToolbarFastForwardClick(Window *w)
@@ -1873,7 +1873,7 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
} break;
case WE_MOUSELOOP:
- if (IsWindowWidgetLowered(w, 0) != !!_pause) {
+ if (IsWindowWidgetLowered(w, 0) != !!_pause_game) {
ToggleWidgetLoweredState(w, 0);
InvalidateWidget(w, 0);
}
@@ -2072,7 +2072,7 @@ static void ScenEditToolbarWndProc(Window *w, WindowEvent *e)
} break;
case WE_MOUSELOOP:
- if (IsWindowWidgetLowered(w, 0) != !!_pause) {
+ if (IsWindowWidgetLowered(w, 0) != !!_pause_game) {
ToggleWidgetLoweredState(w, 0);
SetWindowDirty(w);
}
@@ -2155,7 +2155,7 @@ static void StatusBarWndProc(Window *w, WindowEvent *e)
DrawWindowWidgets(w);
SetDParam(0, _date);
DrawStringCentered(
- 70, 1, (_pause || _patches.status_long_date) ? STR_00AF : STR_00AE, 0
+ 70, 1, (_pause_game || _patches.status_long_date) ? STR_00AF : STR_00AE, 0
);
if (p != NULL) {
@@ -2169,7 +2169,7 @@ static void StatusBarWndProc(Window *w, WindowEvent *e)
DrawStringCentered(320, 1, STR_SAVING_GAME, 0);
} else if (_do_autosave) {
DrawStringCentered(320, 1, STR_032F_AUTOSAVE, 0);
- } else if (_pause) {
+ } else if (_pause_game) {
DrawStringCentered(320, 1, STR_0319_PAUSED, 0);
} else if (WP(w,def_d).data_1 > -1280 && FindWindowById(WC_NEWS_WINDOW,0) == NULL && _statusbar_news_item.string_id != 0) {
/* Draw the scrolling news text */
@@ -2201,7 +2201,7 @@ static void StatusBarWndProc(Window *w, WindowEvent *e)
break;
case WE_TICK: {
- if (_pause) return;
+ if (_pause_game) return;
if (WP(w, def_d).data_1 > -1280) { // Scrolling text
WP(w, def_d).data_1 -= 2;
diff --git a/src/misc.cpp b/src/misc.cpp
index bfb1177cf..55e4627aa 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -104,7 +104,7 @@ void InitializeGame(int mode, uint size_x, uint size_y)
SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, WC_MAIN_WINDOW, 0);
- _pause = 0;
+ _pause_game = 0;
_fast_forward = 0;
_tick_counter = 0;
_date_fract = 0;
@@ -307,7 +307,7 @@ static const SaveLoadGlobVarList _date_desc[] = {
SLEG_VAR(_cur_player_tick_index, SLE_FILE_U8 | SLE_VAR_U32),
SLEG_VAR(_next_competitor_start, SLE_FILE_U16 | SLE_VAR_U32),
SLEG_VAR(_trees_tick_ctr, SLE_UINT8),
- SLEG_CONDVAR(_pause, SLE_UINT8, 4, SL_MAX_VERSION),
+ SLEG_CONDVAR(_pause_game, SLE_UINT8, 4, SL_MAX_VERSION),
SLEG_CONDVAR(_cur_town_iter, SLE_UINT32, 11, SL_MAX_VERSION),
SLEG_END()
};
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index ff7ed7adb..59824a1ac 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -257,8 +257,8 @@ int32 CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
int32 CmdPause(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
if (flags & DC_EXEC) {
- _pause += (p1 == 1) ? 1 : -1;
- if (_pause == (byte)-1) _pause = 0;
+ _pause_game += (p1 == 1) ? 1 : -1;
+ if (_pause_game == (byte)-1) _pause_game = 0;
InvalidateWindow(WC_STATUS_BAR, 0);
InvalidateWindow(WC_MAIN_TOOLBAR, 0);
}
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 76b74620d..3f926a3a7 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -1611,7 +1611,7 @@ bool LoadOldSaveGame(const char *file)
fclose(ls.file);
- _pause = 2;
+ _pause_game = 2;
return true;
}
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 170f40e87..3ba03dad2 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -319,7 +319,7 @@ static void LoadIntroGame(void)
WaitTillGeneratedWorld();
}
- _pause = 0;
+ _pause_game = 0;
SetLocalPlayer(PLAYER_FIRST);
/* Make sure you can't scroll in the menu */
_scrolling_viewport = 0;
@@ -903,7 +903,7 @@ void SwitchMode(int new_mode)
void StateGameLoop(void)
{
// dont execute the state loop during pause
- if (_pause) return;
+ if (_pause_game) return;
if (IsGeneratingWorld()) return;
if (_game_mode == GM_EDITOR) {
@@ -1064,9 +1064,9 @@ void GameLoop(void)
StateGameLoop();
#endif /* ENABLE_NETWORK */
- if (!_pause && _display_opt & DO_FULL_ANIMATION) DoPaletteAnimations();
+ if (!_pause_game && _display_opt & DO_FULL_ANIMATION) DoPaletteAnimations();
- if (!_pause || _cheats.build_in_pause.value) MoveAllTextEffects();
+ if (!_pause_game || _cheats.build_in_pause.value) MoveAllTextEffects();
InputLoop();
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 628ffaf63..2fc625d17 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -452,7 +452,7 @@ static void SdlVideoMainLoop(void)
}
cur_ticks = SDL_CALL SDL_GetTicks();
- if (cur_ticks >= next_tick || (_fast_forward && !_pause) || cur_ticks < prev_cur_ticks) {
+ if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) {
next_tick = cur_ticks + 30;
_ctrl_pressed = !!(mod & KMOD_CTRL);
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index b23d57ac5..4f8cfec8b 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -835,7 +835,7 @@ static void Win32GdiMainLoop(void)
}
cur_ticks = GetTickCount();
- if (cur_ticks >= next_tick || (_fast_forward && !_pause) || cur_ticks < prev_cur_ticks) {
+ if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) {
next_tick = cur_ticks + 30;
_ctrl_pressed = _wnd.has_focus && GetAsyncKeyState(VK_CONTROL)<0;
_shift_pressed = _wnd.has_focus && GetAsyncKeyState(VK_SHIFT)<0;
diff --git a/src/window.cpp b/src/window.cpp
index 4bb43077f..dfb0c383e 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1673,7 +1673,7 @@ void MouseLoop(int click, int mousewheel)
// query button and place sign button work in pause mode
_cursor.sprite != SPR_CURSOR_QUERY &&
_cursor.sprite != SPR_CURSOR_SIGN &&
- _pause != 0 &&
+ _pause_game != 0 &&
!_cheats.build_in_pause.value) {
return;
}