Codechange: Set ZoomLevel's base type to byte instead of using ZoomLevelByte

This commit is contained in:
Charles Pigott
2019-04-21 20:15:55 +01:00
committed by PeterN
parent aa220b2375
commit 96a4787710
8 changed files with 14 additions and 20 deletions

View File

@@ -14,11 +14,11 @@
#include "core/enum_type.hpp"
static int const ZOOM_LVL_SHIFT = 2;
static int const ZOOM_LVL_BASE = 1 << ZOOM_LVL_SHIFT;
static uint const ZOOM_LVL_SHIFT = 2;
static uint const ZOOM_LVL_BASE = 1 << ZOOM_LVL_SHIFT;
/** All zoom levels we know. */
enum ZoomLevel {
enum ZoomLevel : byte {
/* Our possible zoom-levels */
ZOOM_LVL_BEGIN = 0, ///< Begin for iteration.
ZOOM_LVL_NORMAL = 0, ///< The normal zoom level.
@@ -46,14 +46,12 @@ enum ZoomLevel {
ZOOM_LVL_MIN = ZOOM_LVL_NORMAL, ///< Minimum zoom level.
ZOOM_LVL_MAX = ZOOM_LVL_OUT_32X, ///< Maximum zoom level.
};
DECLARE_POSTFIX_INCREMENT(ZoomLevel)
/** Type for storing the zoom level in a byte. */
typedef SimpleTinyEnumT<ZoomLevel, byte> ZoomLevelByte;
extern ZoomLevelByte _gui_zoom;
extern ZoomLevelByte _font_zoom;
extern ZoomLevel _gui_zoom;
extern ZoomLevel _font_zoom;
#define ZOOM_LVL_GUI (_gui_zoom)
#define ZOOM_LVL_FONT (_font_zoom)