mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-13 09:39:10 +00:00
Codechange: Remove PauseModeByte
This commit is contained in:
@@ -46,7 +46,7 @@ bool _screen_disable_anim = false; ///< Disable palette animation (important f
|
||||
bool _exit_game;
|
||||
GameMode _game_mode;
|
||||
SwitchMode _switch_mode; ///< The next mainloop command.
|
||||
PauseModeByte _pause_mode;
|
||||
PauseMode _pause_mode;
|
||||
Palette _cur_palette;
|
||||
|
||||
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;
|
||||
|
||||
if (p2 == 0) {
|
||||
_pause_mode = _pause_mode & ~p1;
|
||||
_pause_mode = static_cast<PauseMode>(_pause_mode & (byte)~p1);
|
||||
} else {
|
||||
_pause_mode = _pause_mode | p1;
|
||||
_pause_mode = static_cast<PauseMode>(_pause_mode | (byte)p1);
|
||||
}
|
||||
|
||||
NetworkHandlePauseChange(prev_mode, (PauseMode)p1);
|
||||
|
@@ -54,7 +54,7 @@ extern SwitchMode _switch_mode;
|
||||
extern bool _exit_game;
|
||||
|
||||
/** Modes of pausing we've got */
|
||||
enum PauseMode {
|
||||
enum PauseMode : byte {
|
||||
PM_UNPAUSED = 0, ///< A normal unpaused game
|
||||
PM_PAUSED_NORMAL = 1 << 0, ///< A game normally paused
|
||||
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,
|
||||
};
|
||||
DECLARE_ENUM_AS_BIT_SET(PauseMode)
|
||||
typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
|
||||
|
||||
/** The current pause mode */
|
||||
extern PauseModeByte _pause_mode;
|
||||
extern PauseMode _pause_mode;
|
||||
|
||||
void AskExitGame();
|
||||
void AskExitToGameMenu();
|
||||
|
@@ -314,7 +314,7 @@ bool LoadOldSaveGame(const char *file)
|
||||
return false;
|
||||
}
|
||||
|
||||
_pause_mode = 2;
|
||||
_pause_mode = PM_PAUSED_SAVELOAD;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user