OpenTTD Source: src/zoom_type.h File Reference

OpenTTD Source 15.3

Typedefs | Enumerations | Variables
zoom_type.h File Reference

Types related to zooming in and out. More...

`#include "core/enum_type.hpp"`

Go to the source code of this file.

## Typedefs
using | ZoomLevels = EnumBitSet< ZoomLevel, uint8_t >

## Enumerations
enum class | ZoomLevel : int8_t { Begin = 0 , Min = Begin , In4x = Begin , In2x , Normal , Out2x , Out4x , Out8x , Max = Out8x , End , Viewport = Normal , News = Normal , Industry = Out2x , Town = Normal , Aircraft = Normal , Ship = Normal , Train = Normal , RoadVehicle = Normal , WorldScreenshot = Normal , Detail = Out2x , TextEffect = Out2x }
| All zoom levels we know. More...

## Variables
static const uint | ZOOM_BASE_SHIFT = to_underlying(ZoomLevel::Normal)
static uint const | ZOOM_BASE = 1U << ZOOM_BASE_SHIFT
int | _gui_scale
| GUI scale, 100 is 100%.
int | _gui_scale_cfg
| GUI scale in config.
ZoomLevel | _gui_zoom
| GUI Zoom level.
ZoomLevel | _font_zoom
| Sprite font Zoom level (not clamped)
static const int | MIN_INTERFACE_SCALE = 100
static const int | MAX_INTERFACE_SCALE = 500

## Detailed Description

Types related to zooming in and out.

Definition in file zoom_type.h.

## Typedef Documentation

## ◆ ZoomLevels

using ZoomLevels = EnumBitSet<ZoomLevel, uint8_t>

Definition at line 49 of file zoom_type.h.

## Enumeration Type Documentation

## ◆ ZoomLevel

enum class ZoomLevel : int8_t
| strong

All zoom levels we know.

The underlying type is signed so subtract-and-Clamp works without need for casting.

Enumerator
Begin | Begin for iteration.
Min | Minimum zoom level.
In4x | Zoomed 4 times in.
In2x | Zoomed 2 times in.
Normal | The normal zoom level.
Out2x | Zoomed 2 times out.
Out4x | Zoomed 4 times out.
Out8x | Zoomed 8 times out.
Max | Maximum zoom level.
End | End for iteration.
Viewport | Default zoom level for viewports.
News | Default zoom level for the news messages.
Industry | Default zoom level for the industry view.
Town | Default zoom level for the town view.
Aircraft | Default zoom level for the aircraft view.
Ship | Default zoom level for the ship view.
Train | Default zoom level for the train view.
RoadVehicle | Default zoom level for the road vehicle view.
WorldScreenshot | Default zoom level for the world screen shot.
Detail | All zoom levels below or equal to this will result in details on the screen, like road-work, ...
TextEffect | All zoom levels above this will not show text effects.

Definition at line 20 of file zoom_type.h.

## Variable Documentation

## ◆ _font_zoom

ZoomLevel _font_zoom
| extern

Sprite font Zoom level (not clamped)

Definition at line 62 of file gfx.cpp.

Referenced by AdjustGUIZoom(), ReadSprite(), ScaleFontTrad(), and UpdateGUIZoom().

## ◆ _gui_scale

int _gui_scale
| extern

GUI scale, 100 is 100%.

Definition at line 63 of file gfx.cpp.

Referenced by AdjustGUIZoom(), GameOptionsWindow::OnClick(), GameOptionsWindow::OnInit(), Window::ReInit(), ScaleGUITrad(), and UpdateGUIZoom().

## ◆ _gui_scale_cfg

int _gui_scale_cfg
| extern

GUI scale in config.

Definition at line 64 of file gfx.cpp.

Referenced by GameOptionsWindow::OnClick(), GameOptionsWindow::OnInvalidateData(), GameOptionsWindow::OnMouseLoop(), and UpdateGUIZoom().

## ◆ _gui_zoom

ZoomLevel _gui_zoom
| extern

GUI Zoom level.

Definition at line 61 of file gfx.cpp.

Referenced by AdjustGUIZoom(), OpenGLBackend::DrawMouseCursor(), ScaleZoomGUI(), UnScaleGUI(), UnScaleZoomGUI(), and UpdateGUIZoom().

## ◆ MAX_INTERFACE_SCALE

const int MAX_INTERFACE_SCALE = 500
| static

Definition at line 61 of file zoom_type.h.

## ◆ MIN_INTERFACE_SCALE

const int MIN_INTERFACE_SCALE = 100
| static

Definition at line 60 of file zoom_type.h.

## ◆ ZOOM_BASE

uint const ZOOM_BASE = 1U << ZOOM_BASE_SHIFT
| static

Definition at line 52 of file zoom_type.h.

## ◆ ZOOM_BASE_SHIFT

const uint ZOOM_BASE_SHIFT = to_underlying(ZoomLevel::Normal)
| static

Definition at line 51 of file zoom_type.h.