(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.....)
This commit is contained in:
truelight 2007-03-06 20:59:52 +00:00
parent 5bb9aed844
commit 43133c766c
11 changed files with 22 additions and 22 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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()
};

View File

@ -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);
}

View File

@ -1611,7 +1611,7 @@ bool LoadOldSaveGame(const char *file)
fclose(ls.file);
_pause = 2;
_pause_game = 2;
return true;
}

View File

@ -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();

View File

@ -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);

View File

@ -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;

View File

@ -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;
}