diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gfx.cpp | 2 | ||||
-rw-r--r-- | src/misc_cmd.cpp | 4 | ||||
-rw-r--r-- | src/openttd.h | 5 | ||||
-rw-r--r-- | src/saveload/oldloader.cpp | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 5165fe01c..4fd705b9f 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -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() diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index f0ccfbd74..4271f5758 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -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); diff --git a/src/openttd.h b/src/openttd.h index 5e360d6fc..539b7e14f 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -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(); diff --git a/src/saveload/oldloader.cpp b/src/saveload/oldloader.cpp index 9b24750d2..11eb058fa 100644 --- a/src/saveload/oldloader.cpp +++ b/src/saveload/oldloader.cpp @@ -314,7 +314,7 @@ bool LoadOldSaveGame(const char *file) return false; } - _pause_mode = 2; + _pause_mode = PM_PAUSED_SAVELOAD; return true; } |