Mercurial > hg > openttd
changeset 6231:a4e11dd2d7c6 draft
(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.....)
author | truelight <truelight@openttd.org> |
---|---|
date | Tue, 06 Mar 2007 20:59:52 +0000 |
parents | d9b18ac4c028 |
children | 8f5f0fc38758 |
files | src/console_cmds.cpp src/gfx.cpp src/gfx.h src/main_gui.cpp src/misc.cpp src/misc_cmd.cpp src/oldloader.cpp src/openttd.cpp src/video/sdl_v.cpp src/video/win32_v.cpp src/window.cpp |
diffstat | 11 files changed, 22 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -499,7 +499,7 @@ 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 @@ return true; } - if (_pause != 0) { + if (_pause_game != 0) { DoCommandP(0, 0, 0, NULL, CMD_PAUSE); IConsolePrint(_icolour_def, "Game unpaused."); } else {
--- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -37,7 +37,7 @@ 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;
--- a/src/gfx.h +++ b/src/gfx.h @@ -156,7 +156,7 @@ 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;
--- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -136,7 +136,7 @@ { 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 @@ } 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 @@ } break; case WE_MOUSELOOP: - if (IsWindowWidgetLowered(w, 0) != !!_pause) { + if (IsWindowWidgetLowered(w, 0) != !!_pause_game) { ToggleWidgetLoweredState(w, 0); SetWindowDirty(w); } @@ -2155,7 +2155,7 @@ 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 @@ 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 @@ 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;
--- a/src/misc.cpp +++ b/src/misc.cpp @@ -104,7 +104,7 @@ 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 @@ 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() };
--- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -257,8 +257,8 @@ 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); }
--- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -1611,7 +1611,7 @@ fclose(ls.file); - _pause = 2; + _pause_game = 2; return true; }
--- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -319,7 +319,7 @@ 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 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 @@ 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();
--- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -452,7 +452,7 @@ } 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);
--- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -835,7 +835,7 @@ } 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;