mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Remove PauseModeByte
parent
e18c8c30be
commit
327ff89808
|
@ -46,7 +46,7 @@ bool _screen_disable_anim = false; ///< Disable palette animation (important f
|
||||||
bool _exit_game;
|
bool _exit_game;
|
||||||
GameMode _game_mode;
|
GameMode _game_mode;
|
||||||
SwitchMode _switch_mode; ///< The next mainloop command.
|
SwitchMode _switch_mode; ///< The next mainloop command.
|
||||||
PauseModeByte _pause_mode;
|
PauseMode _pause_mode;
|
||||||
Palette _cur_palette;
|
Palette _cur_palette;
|
||||||
|
|
||||||
static byte _stringwidth_table[FS_END][224]; ///< Cache containing width of often used characters. @see GetCharacterWidth()
|
static byte _stringwidth_table[FS_END][224]; ///< Cache containing width of often used characters. @see GetCharacterWidth()
|
||||||
|
|
|
@ -173,9 +173,9 @@ CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2,
|
||||||
PauseMode prev_mode = _pause_mode;
|
PauseMode prev_mode = _pause_mode;
|
||||||
|
|
||||||
if (p2 == 0) {
|
if (p2 == 0) {
|
||||||
_pause_mode = _pause_mode & ~p1;
|
_pause_mode = static_cast<PauseMode>(_pause_mode & (byte)~p1);
|
||||||
} else {
|
} else {
|
||||||
_pause_mode = _pause_mode | p1;
|
_pause_mode = static_cast<PauseMode>(_pause_mode | (byte)p1);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkHandlePauseChange(prev_mode, (PauseMode)p1);
|
NetworkHandlePauseChange(prev_mode, (PauseMode)p1);
|
||||||
|
|
|
@ -54,7 +54,7 @@ extern SwitchMode _switch_mode;
|
||||||
extern bool _exit_game;
|
extern bool _exit_game;
|
||||||
|
|
||||||
/** Modes of pausing we've got */
|
/** Modes of pausing we've got */
|
||||||
enum PauseMode {
|
enum PauseMode : byte {
|
||||||
PM_UNPAUSED = 0, ///< A normal unpaused game
|
PM_UNPAUSED = 0, ///< A normal unpaused game
|
||||||
PM_PAUSED_NORMAL = 1 << 0, ///< A game normally paused
|
PM_PAUSED_NORMAL = 1 << 0, ///< A game normally paused
|
||||||
PM_PAUSED_SAVELOAD = 1 << 1, ///< A game paused for saving/loading
|
PM_PAUSED_SAVELOAD = 1 << 1, ///< A game paused for saving/loading
|
||||||
|
@ -67,10 +67,9 @@ enum PauseMode {
|
||||||
PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
|
PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
|
||||||
};
|
};
|
||||||
DECLARE_ENUM_AS_BIT_SET(PauseMode)
|
DECLARE_ENUM_AS_BIT_SET(PauseMode)
|
||||||
typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
|
|
||||||
|
|
||||||
/** The current pause mode */
|
/** The current pause mode */
|
||||||
extern PauseModeByte _pause_mode;
|
extern PauseMode _pause_mode;
|
||||||
|
|
||||||
void AskExitGame();
|
void AskExitGame();
|
||||||
void AskExitToGameMenu();
|
void AskExitToGameMenu();
|
||||||
|
|
|
@ -314,7 +314,7 @@ bool LoadOldSaveGame(const char *file)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_pause_mode = 2;
|
_pause_mode = PM_PAUSED_SAVELOAD;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue