Codechange: ZOOM_LVL_SHIFT/BASE are not actually ZOOM_LVLs.

Rename to ZOOM_BASE_SHIFT and ZOOM_BASE respectively, and derive from ZOOM_LVL instead of numeric value.
This commit is contained in:
Peter Nelson 2024-04-04 18:27:34 +01:00 committed by Peter Nelson
parent 3c94e81665
commit 9854553e10
16 changed files with 59 additions and 60 deletions

View File

@ -23,12 +23,12 @@ static const int ASCII_LETTERSTART = 32; ///< First printable ASCII letter.
/**
* Scale traditional pixel dimensions to font zoom level, for drawing sprite fonts.
* @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size).
* @param value Pixel amount at #ZOOM_BASE (traditional "normal" interface size).
* @return Pixel amount at _font_zoom (current interface size).
*/
static int ScaleFontTrad(int value)
{
return UnScaleByZoom(value * ZOOM_LVL_BASE, _font_zoom);
return UnScaleByZoom(value * ZOOM_BASE, _font_zoom);
}
/**

View File

@ -1210,7 +1210,7 @@ std::unique_ptr<uint32_t[]> DrawSpriteToRgbaBuffer(SpriteID spriteId, ZoomLevel
static void GfxMainBlitterViewport(const Sprite *sprite, int x, int y, BlitterMode mode, const SubSprite *sub, SpriteID sprite_id)
{
GfxBlitter<ZOOM_LVL_BASE, false>(sprite, x, y, mode, sub, sprite_id, _cur_dpi->zoom);
GfxBlitter<ZOOM_BASE, false>(sprite, x, y, mode, sub, sprite_id, _cur_dpi->zoom);
}
static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode, const SubSprite *sub, SpriteID sprite_id, ZoomLevel zoom)

View File

@ -79,8 +79,8 @@ inline std::tuple<Slope, int> GetFoundationPixelSlope(TileIndex tile)
inline Point RemapCoords(int x, int y, int z)
{
Point pt;
pt.x = (y - x) * 2 * ZOOM_LVL_BASE;
pt.y = (y + x - z) * ZOOM_LVL_BASE;
pt.x = (y - x) * 2 * ZOOM_BASE;
pt.y = (y + x - z) * ZOOM_BASE;
return pt;
}
@ -108,7 +108,7 @@ inline Point RemapCoords2(int x, int y)
*/
inline Point InverseRemapCoords(int x, int y)
{
Point pt = {(y * 2 - x) >> (2 + ZOOM_LVL_SHIFT), (y * 2 + x) >> (2 + ZOOM_LVL_SHIFT)};
Point pt = {(y * 2 - x) >> (2 + ZOOM_BASE_SHIFT), (y * 2 + x) >> (2 + ZOOM_BASE_SHIFT)};
return pt;
}

View File

@ -2838,9 +2838,9 @@ bool AfterLoadGame()
if (IsSavegameVersionBefore(SLV_165)) {
/* Adjust zoom level to account for new levels */
_saved_scrollpos_zoom = static_cast<ZoomLevel>(_saved_scrollpos_zoom + ZOOM_LVL_SHIFT);
_saved_scrollpos_x *= ZOOM_LVL_BASE;
_saved_scrollpos_y *= ZOOM_LVL_BASE;
_saved_scrollpos_zoom = static_cast<ZoomLevel>(_saved_scrollpos_zoom + ZOOM_BASE_SHIFT);
_saved_scrollpos_x *= ZOOM_BASE;
_saved_scrollpos_y *= ZOOM_BASE;
}
/* When any NewGRF has been changed the availability of some vehicles might

View File

@ -50,7 +50,7 @@ void Sign::UpdateVirtCoord()
if (this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeSign(this->index));
SetDParam(0, this->index);
this->sign.UpdatePosition(pt.x, pt.y - 6 * ZOOM_LVL_BASE, STR_WHITE_SIGN);
this->sign.UpdatePosition(pt.x, pt.y - 6 * ZOOM_BASE, STR_WHITE_SIGN);
_viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeSign(this->index));
}

View File

@ -843,7 +843,7 @@ protected:
void SetNewScroll(int sx, int sy, int sub)
{
const NWidgetBase *wi = this->GetWidget<NWidgetBase>(WID_SM_MAP);
Point hv = InverseRemapCoords(wi->current_x * ZOOM_LVL_BASE * TILE_SIZE / 2, wi->current_y * ZOOM_LVL_BASE * TILE_SIZE / 2);
Point hv = InverseRemapCoords(wi->current_x * ZOOM_BASE * TILE_SIZE / 2, wi->current_y * ZOOM_BASE * TILE_SIZE / 2);
hv.x *= this->zoom;
hv.y *= this->zoom;

View File

@ -441,8 +441,8 @@ void Station::UpdateVirtCoord()
{
Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE);
pt.y -= 32 * ZOOM_LVL_BASE;
if ((this->facilities & FACIL_AIRPORT) && this->airport.type == AT_OILRIG) pt.y -= 16 * ZOOM_LVL_BASE;
pt.y -= 32 * ZOOM_BASE;
if ((this->facilities & FACIL_AIRPORT) && this->airport.type == AT_OILRIG) pt.y -= 16 * ZOOM_BASE;
if (this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeStation(this->index));

View File

@ -104,7 +104,7 @@ IntervalTimer<TimerWindow> move_all_text_effects_interval = {std::chrono::millis
te.MarkDirty(ZOOM_LVL_TEXT_EFFECT);
te.duration -= count;
te.top -= count * ZOOM_LVL_BASE;
te.top -= count * ZOOM_BASE;
te.MarkDirty(ZOOM_LVL_TEXT_EFFECT);
}
}};

View File

@ -14,12 +14,12 @@
static const uint TILE_SIZE = 16; ///< Tile size in world coordinates.
static const uint TILE_UNIT_MASK = TILE_SIZE - 1; ///< For masking in/out the inner-tile world coordinate units.
static const uint TILE_PIXELS = 32; ///< Pixel distance between tile columns/rows in #ZOOM_LVL_BASE.
static const uint TILE_HEIGHT = 8; ///< Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
static const uint TILE_PIXELS = 32; ///< Pixel distance between tile columns/rows in #ZOOM_BASE.
static const uint TILE_HEIGHT = 8; ///< Height of a height level in world coordinate AND in pixels in #ZOOM_BASE.
static const uint MAX_BUILDING_PIXELS = 200; ///< Maximum height of a building in pixels in #ZOOM_LVL_BASE. (Also applies to "bridge buildings" on the bridge floor.)
static const int MAX_VEHICLE_PIXEL_X = 192; ///< Maximum width of a vehicle in pixels in #ZOOM_LVL_BASE.
static const int MAX_VEHICLE_PIXEL_Y = 96; ///< Maximum height of a vehicle in pixels in #ZOOM_LVL_BASE.
static const uint MAX_BUILDING_PIXELS = 200; ///< Maximum height of a building in pixels in #ZOOM_BASE. (Also applies to "bridge buildings" on the bridge floor.)
static const int MAX_VEHICLE_PIXEL_X = 192; ///< Maximum width of a vehicle in pixels in #ZOOM_BASE.
static const int MAX_VEHICLE_PIXEL_Y = 96; ///< Maximum height of a vehicle in pixels in #ZOOM_BASE.
static const uint MAX_TILE_HEIGHT = 255; ///< Maximum allowed tile height

View File

@ -409,7 +409,7 @@ void Town::UpdateVirtCoord()
SetDParam(0, this->index);
SetDParam(1, this->cache.population);
this->cache.sign.UpdatePosition(pt.x, pt.y - 24 * ZOOM_LVL_BASE,
this->cache.sign.UpdatePosition(pt.x, pt.y - 24 * ZOOM_BASE,
_settings_client.gui.population_in_label ? STR_VIEWPORT_TOWN_POP : STR_VIEWPORT_TOWN,
STR_VIEWPORT_TOWN_TINY_WHITE);

View File

@ -74,13 +74,13 @@ static const uint GEN_HASHX_BUCKET_BITS = 7;
static const uint GEN_HASHY_BUCKET_BITS = 6;
/* Compute hash for vehicle coord */
#define GEN_HASHX(x) GB((x), GEN_HASHX_BUCKET_BITS + ZOOM_LVL_SHIFT, GEN_HASHX_BITS)
#define GEN_HASHY(y) (GB((y), GEN_HASHY_BUCKET_BITS + ZOOM_LVL_SHIFT, GEN_HASHY_BITS) << GEN_HASHX_BITS)
#define GEN_HASHX(x) GB((x), GEN_HASHX_BUCKET_BITS + ZOOM_BASE_SHIFT, GEN_HASHX_BITS)
#define GEN_HASHY(y) (GB((y), GEN_HASHY_BUCKET_BITS + ZOOM_BASE_SHIFT, GEN_HASHY_BITS) << GEN_HASHX_BITS)
#define GEN_HASH(x, y) (GEN_HASHY(y) + GEN_HASHX(x))
/* Maximum size until hash repeats */
static const int GEN_HASHX_SIZE = 1 << (GEN_HASHX_BUCKET_BITS + GEN_HASHX_BITS + ZOOM_LVL_SHIFT);
static const int GEN_HASHY_SIZE = 1 << (GEN_HASHY_BUCKET_BITS + GEN_HASHY_BITS + ZOOM_LVL_SHIFT);
static const int GEN_HASHX_SIZE = 1 << (GEN_HASHX_BUCKET_BITS + GEN_HASHX_BITS + ZOOM_BASE_SHIFT);
static const int GEN_HASHY_SIZE = 1 << (GEN_HASHY_BUCKET_BITS + GEN_HASHY_BITS + ZOOM_BASE_SHIFT);
/* Increments to reach next bucket in hash table */
static const int GEN_HASHX_INC = 1;
@ -1158,8 +1158,8 @@ void ViewportAddVehicles(DrawPixelInfo *dpi)
const int b = dpi->top + dpi->height;
/* Border size of MAX_VEHICLE_PIXEL_xy */
const int xb = MAX_VEHICLE_PIXEL_X * ZOOM_LVL_BASE;
const int yb = MAX_VEHICLE_PIXEL_Y * ZOOM_LVL_BASE;
const int xb = MAX_VEHICLE_PIXEL_X * ZOOM_BASE;
const int yb = MAX_VEHICLE_PIXEL_Y * ZOOM_BASE;
/* The hash area to scan */
int xl, xu, yl, yu;
@ -1254,8 +1254,8 @@ Vehicle *CheckClickOnVehicle(const Viewport *vp, int x, int y)
y = ScaleByZoom(y, vp->zoom) + vp->virtual_top;
/* Border size of MAX_VEHICLE_PIXEL_xy */
const int xb = MAX_VEHICLE_PIXEL_X * ZOOM_LVL_BASE;
const int yb = MAX_VEHICLE_PIXEL_Y * ZOOM_LVL_BASE;
const int xb = MAX_VEHICLE_PIXEL_X * ZOOM_BASE;
const int yb = MAX_VEHICLE_PIXEL_Y * ZOOM_BASE;
/* The hash area to scan */
int xl = GEN_HASHX(x - xb);
@ -1695,8 +1695,8 @@ void Vehicle::UpdateBoundingBoxCoordinates(bool update_cache) const
Point pt = RemapCoords(this->x_pos + this->x_offs, this->y_pos + this->y_offs, this->z_pos);
new_coord.left += pt.x;
new_coord.top += pt.y;
new_coord.right += pt.x + 2 * ZOOM_LVL_BASE;
new_coord.bottom += pt.y + 2 * ZOOM_LVL_BASE;
new_coord.right += pt.x + 2 * ZOOM_BASE;
new_coord.bottom += pt.y + 2 * ZOOM_BASE;
if (update_cache) {
/*

View File

@ -106,10 +106,10 @@ ViewportSignKdtree _viewport_sign_kdtree(&Kdtree_ViewportSignXYFunc);
static int _viewport_sign_maxwidth = 0;
static const int MAX_TILE_EXTENT_LEFT = ZOOM_LVL_BASE * TILE_PIXELS; ///< Maximum left extent of tile relative to north corner.
static const int MAX_TILE_EXTENT_RIGHT = ZOOM_LVL_BASE * TILE_PIXELS; ///< Maximum right extent of tile relative to north corner.
static const int MAX_TILE_EXTENT_TOP = ZOOM_LVL_BASE * MAX_BUILDING_PIXELS; ///< Maximum top extent of tile relative to north corner (not considering bridges).
static const int MAX_TILE_EXTENT_BOTTOM = ZOOM_LVL_BASE * (TILE_PIXELS + 2 * TILE_HEIGHT); ///< Maximum bottom extent of tile relative to north corner (worst case: #SLOPE_STEEP_N).
static const int MAX_TILE_EXTENT_LEFT = ZOOM_BASE * TILE_PIXELS; ///< Maximum left extent of tile relative to north corner.
static const int MAX_TILE_EXTENT_RIGHT = ZOOM_BASE * TILE_PIXELS; ///< Maximum right extent of tile relative to north corner.
static const int MAX_TILE_EXTENT_TOP = ZOOM_BASE * MAX_BUILDING_PIXELS; ///< Maximum top extent of tile relative to north corner (not considering bridges).
static const int MAX_TILE_EXTENT_BOTTOM = ZOOM_BASE * (TILE_PIXELS + 2 * TILE_HEIGHT); ///< Maximum bottom extent of tile relative to north corner (worst case: #SLOPE_STEEP_N).
struct StringSpriteToDraw {
std::string string;
@ -570,9 +570,9 @@ void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32_t x, int32_t y, int
if (_vd.foundation[_vd.foundation_part] != -1) {
Point pt = RemapCoords(x, y, z);
AddChildSpriteToFoundation(image, pal, sub, _vd.foundation_part, pt.x + extra_offs_x * ZOOM_LVL_BASE, pt.y + extra_offs_y * ZOOM_LVL_BASE);
AddChildSpriteToFoundation(image, pal, sub, _vd.foundation_part, pt.x + extra_offs_x * ZOOM_BASE, pt.y + extra_offs_y * ZOOM_BASE);
} else {
AddTileSpriteToDraw(image, pal, _cur_ti.x + x, _cur_ti.y + y, _cur_ti.z + z, sub, extra_offs_x * ZOOM_LVL_BASE, extra_offs_y * ZOOM_LVL_BASE);
AddTileSpriteToDraw(image, pal, _cur_ti.x + x, _cur_ti.y + y, _cur_ti.z + z, sub, extra_offs_x * ZOOM_BASE, extra_offs_y * ZOOM_BASE);
}
}
@ -614,8 +614,8 @@ void OffsetGroundSprite(int x, int y)
/* _vd.last_child == nullptr if foundation sprite was clipped by the viewport bounds */
if (_vd.last_child != nullptr) _vd.foundation[_vd.foundation_part] = (uint)_vd.parent_sprites_to_draw.size() - 1;
_vd.foundation_offset[_vd.foundation_part].x = x * ZOOM_LVL_BASE;
_vd.foundation_offset[_vd.foundation_part].y = y * ZOOM_LVL_BASE;
_vd.foundation_offset[_vd.foundation_part].x = x * ZOOM_BASE;
_vd.foundation_offset[_vd.foundation_part].y = y * ZOOM_BASE;
_vd.last_foundation_child[_vd.foundation_part] = _vd.last_child;
}
@ -845,8 +845,8 @@ void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool tran
cs.image = image;
cs.pal = pal;
cs.sub = sub;
cs.x = scale ? x * ZOOM_LVL_BASE : x;
cs.y = scale ? y * ZOOM_LVL_BASE : y;
cs.x = scale ? x * ZOOM_BASE : x;
cs.y = scale ? y * ZOOM_BASE : y;
cs.relative = relative;
cs.next = -1;
@ -892,7 +892,7 @@ static void DrawSelectionSprite(SpriteID image, PaletteID pal, const TileInfo *t
AddTileSpriteToDraw(image, pal, ti->x, ti->y, ti->z + z_offset, nullptr, extra_offs_x, extra_offs_y);
} else {
/* draw on top of foundation */
AddChildSpriteToFoundation(image, pal, nullptr, foundation_part, extra_offs_x, extra_offs_y - z_offset * ZOOM_LVL_BASE);
AddChildSpriteToFoundation(image, pal, nullptr, foundation_part, extra_offs_x, extra_offs_y - z_offset * ZOOM_BASE);
}
}
@ -1177,7 +1177,7 @@ draw_inner:
static int GetViewportY(Point tile)
{
/* Each increment in X or Y direction moves down by half a tile, i.e. TILE_PIXELS / 2. */
return (tile.y * (int)(TILE_PIXELS / 2) + tile.x * (int)(TILE_PIXELS / 2) - TilePixelHeightOutsideMap(tile.x, tile.y)) << ZOOM_LVL_SHIFT;
return (tile.y * (int)(TILE_PIXELS / 2) + tile.x * (int)(TILE_PIXELS / 2) - TilePixelHeightOutsideMap(tile.x, tile.y)) << ZOOM_BASE_SHIFT;
}
/**
@ -1207,7 +1207,7 @@ static void ViewportAddLandscape()
int left_column = (upper_left.y - upper_left.x) / (int)TILE_SIZE - 2;
int right_column = (upper_right.y - upper_right.x) / (int)TILE_SIZE + 2;
int potential_bridge_height = ZOOM_LVL_BASE * TILE_HEIGHT * _settings_game.construction.max_bridge_height;
int potential_bridge_height = ZOOM_BASE * TILE_HEIGHT * _settings_game.construction.max_bridge_height;
/* Rows overlap with neighbouring rows by a half tile.
* The first row that could possibly be visible is the row above upper_left (if it is at height 0).
@ -1267,7 +1267,7 @@ static void ViewportAddLandscape()
if (IsBridgeAbove(_cur_ti.tile)) {
/* Is the bridge visible? */
TileIndex bridge_tile = GetNorthernBridgeEnd(_cur_ti.tile);
int bridge_height = ZOOM_LVL_BASE * (GetBridgePixelHeight(bridge_tile) - TilePixelHeight(_cur_ti.tile));
int bridge_height = ZOOM_BASE * (GetBridgePixelHeight(bridge_tile) - TilePixelHeight(_cur_ti.tile));
if (min_visible_height < bridge_height + MAX_TILE_EXTENT_TOP) tile_visible = true;
}
@ -1883,7 +1883,7 @@ static inline void ClampViewportToMap(const Viewport *vp, int *scroll_x, int *sc
static void ClampSmoothScroll(uint32_t delta_ms, int64_t delta_hi, int64_t delta_lo, int &delta_hi_clamped, int &delta_lo_clamped)
{
/** A tile is 64 pixels in width at 1x zoom; viewport coordinates are in 4x zoom. */
constexpr int PIXELS_PER_TILE = TILE_PIXELS * 2 * ZOOM_LVL_BASE;
constexpr int PIXELS_PER_TILE = TILE_PIXELS * 2 * ZOOM_BASE;
assert(delta_hi != 0);
@ -2053,7 +2053,7 @@ void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset, int tile_heigh
Point pt = RemapCoords(TileX(tile) * TILE_SIZE, TileY(tile) * TILE_SIZE, tile_height_override * TILE_HEIGHT);
MarkAllViewportsDirty(
pt.x - MAX_TILE_EXTENT_LEFT,
pt.y - MAX_TILE_EXTENT_TOP - ZOOM_LVL_BASE * TILE_HEIGHT * bridge_level_offset,
pt.y - MAX_TILE_EXTENT_TOP - ZOOM_BASE * TILE_HEIGHT * bridge_level_offset,
pt.x + MAX_TILE_EXTENT_RIGHT,
pt.y + MAX_TILE_EXTENT_BOTTOM);
}
@ -2131,15 +2131,15 @@ static void SetSelectionTilesDirty()
/* the 'x' coordinate of 'top' and 'bot' is the same (and always in the same distance from tile middle),
* tile height/slope affects only the 'y' on-screen coordinate! */
int l = top.x - TILE_PIXELS * ZOOM_LVL_BASE; // 'x' coordinate of left side of the dirty rectangle
int l = top.x - TILE_PIXELS * ZOOM_BASE; // 'x' coordinate of left side of the dirty rectangle
int t = top.y; // 'y' coordinate of top side of the dirty rectangle
int r = top.x + TILE_PIXELS * ZOOM_LVL_BASE; // 'x' coordinate of right side of the dirty rectangle
int r = top.x + TILE_PIXELS * ZOOM_BASE; // 'x' coordinate of right side of the dirty rectangle
int b = bot.y; // 'y' coordinate of bottom side of the dirty rectangle
static const int OVERLAY_WIDTH = 4 * ZOOM_LVL_BASE; // part of selection sprites is drawn outside the selected area (in particular: terraforming)
static const int OVERLAY_WIDTH = 4 * ZOOM_BASE; // part of selection sprites is drawn outside the selected area (in particular: terraforming)
/* For halftile foundations on SLOPE_STEEP_S the sprite extents some more towards the top */
MarkAllViewportsDirty(l - OVERLAY_WIDTH, t - OVERLAY_WIDTH - TILE_HEIGHT * ZOOM_LVL_BASE, r + OVERLAY_WIDTH, b + OVERLAY_WIDTH);
MarkAllViewportsDirty(l - OVERLAY_WIDTH, t - OVERLAY_WIDTH - TILE_HEIGHT * ZOOM_BASE, r + OVERLAY_WIDTH, b + OVERLAY_WIDTH);
/* haven't we reached the topmost tile yet? */
if (top_x != x_start) {

View File

@ -44,7 +44,7 @@ void Waypoint::UpdateVirtCoord()
if (this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeWaypoint(this->index));
SetDParam(0, this->index);
this->sign.UpdatePosition(pt.x, pt.y - 32 * ZOOM_LVL_BASE, STR_VIEWPORT_WAYPOINT);
this->sign.UpdatePosition(pt.x, pt.y - 32 * ZOOM_BASE, STR_VIEWPORT_WAYPOINT);
_viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeWaypoint(this->index));

View File

@ -29,7 +29,7 @@ WidgetDimensions WidgetDimensions::scaled = {};
/**
* Scale a RectPadding to GUI zoom level.
* @param r RectPadding at ZOOM_LVL_BASE (traditional "normal" interface size).
* @param r RectPadding at ZOOM_BASE (traditional "normal" interface size).
* @return RectPadding at #ZOOM_LVL_GUI (current interface size).
*/
static inline RectPadding ScaleGUITrad(const RectPadding &r)
@ -39,7 +39,7 @@ static inline RectPadding ScaleGUITrad(const RectPadding &r)
/**
* Scale a Dimension to GUI zoom level.
* @param d Dimension at ZOOM_LVL_BASE (traditional "normal" interface size).
* @param d Dimension at ZOOM_BASE (traditional "normal" interface size).
* @return Dimension at #ZOOM_LVL_GUI (current interface size).
*/
static inline Dimension ScaleGUITrad(const Dimension &dim)

View File

@ -101,17 +101,17 @@ inline ZoomLevel UnScaleZoomGUI(ZoomLevel value)
/**
* Scale traditional pixel dimensions to GUI zoom level, for drawing sprites.
* @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size).
* @param value Pixel amount at #ZOOM_BASE (traditional "normal" interface size).
* @return Pixel amount at #ZOOM_LVL_GUI (current interface size).
*/
inline int ScaleSpriteTrad(int value)
{
return UnScaleGUI(value * ZOOM_LVL_BASE);
return UnScaleGUI(value * ZOOM_BASE);
}
/**
* Scale traditional pixel dimensions to GUI zoom level.
* @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size).
* @param value Pixel amount at #ZOOM_BASE (traditional "normal" interface size).
* @return Pixel amount at #ZOOM_LVL_GUI (current interface size).
*/
inline int ScaleGUITrad(int value)

View File

@ -12,9 +12,6 @@
#include "core/enum_type.hpp"
static uint const ZOOM_LVL_SHIFT = 2;
static uint const ZOOM_LVL_BASE = 1 << ZOOM_LVL_SHIFT;
/** All zoom levels we know. */
enum ZoomLevel : uint8_t {
/* Our possible zoom-levels */
@ -43,11 +40,13 @@ enum ZoomLevel : uint8_t {
ZOOM_LVL_MIN = ZOOM_LVL_NORMAL, ///< Minimum zoom level.
ZOOM_LVL_MAX = ZOOM_LVL_OUT_32X, ///< Maximum zoom level.
};
DECLARE_POSTFIX_INCREMENT(ZoomLevel)
DECLARE_ENUM_AS_ADDABLE(ZoomLevel)
static uint const ZOOM_BASE_SHIFT = static_cast<uint>(ZOOM_LVL_OUT_4X);
static uint const ZOOM_BASE = 1U << ZOOM_BASE_SHIFT;
extern int _gui_scale;
extern int _gui_scale_cfg;