# HG changeset patch # User truelight # Date 2007-03-06 20:59:52 # Node ID 4cdf70b5a6ea93bad891ddd26c14472324031652 # Parent 13b38a5840dd26e5f55ff30137b89a33ca00d421 (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.....) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp --- 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 --- 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 --- 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 --- 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 } 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(Windo } 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, 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, 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, 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 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -104,7 +104,7 @@ void InitializeGame(int mode, uint size_ 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_d 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 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -257,8 +257,8 @@ int32 CmdChangePresidentName(TileIndex t 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 --- 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 --- 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 --- 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 --- 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 --- 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; }