OpenTTD Source: src/zoom_type.h File Reference

OpenTTD Source 15.0-beta1

Macros | 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.

## Macros
#define | ZOOM_LVL_GUI (_gui_zoom)

## Enumerations
enum | ZoomLevel : uint8_t { ZOOM_LVL_BEGIN = 0 , ZOOM_LVL_IN_4X = 0 , ZOOM_LVL_IN_2X , ZOOM_LVL_NORMAL , ZOOM_LVL_OUT_2X , ZOOM_LVL_OUT_4X , ZOOM_LVL_OUT_8X , ZOOM_LVL_END , ZOOM_LVL_VIEWPORT = ZOOM_LVL_NORMAL , ZOOM_LVL_NEWS = ZOOM_LVL_NORMAL , ZOOM_LVL_INDUSTRY = ZOOM_LVL_OUT_2X , ZOOM_LVL_TOWN = ZOOM_LVL_NORMAL , ZOOM_LVL_AIRCRAFT = ZOOM_LVL_NORMAL , ZOOM_LVL_SHIP = ZOOM_LVL_NORMAL , ZOOM_LVL_TRAIN = ZOOM_LVL_NORMAL , ZOOM_LVL_ROADVEH = ZOOM_LVL_NORMAL , ZOOM_LVL_WORLD_SCREENSHOT = ZOOM_LVL_NORMAL , ZOOM_LVL_DETAIL = ZOOM_LVL_OUT_2X , ZOOM_LVL_TEXT_EFFECT = ZOOM_LVL_OUT_2X , ZOOM_LVL_MIN = ZOOM_LVL_IN_4X , ZOOM_LVL_MAX = ZOOM_LVL_OUT_8X }
| All zoom levels we know. More...

## Variables
static uint const | ZOOM_BASE_SHIFT = static_cast<uint>(ZOOM_LVL_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.

## Macro Definition Documentation

## ◆ ZOOM_LVL_GUI

#define ZOOM_LVL_GUI (_gui_zoom)

Definition at line 55 of file zoom_type.h.

## Enumeration Type Documentation

## ◆ ZoomLevel

enum ZoomLevel : uint8_t

All zoom levels we know.

Enumerator
ZOOM_LVL_BEGIN | Begin for iteration.
ZOOM_LVL_IN_4X | Zoomed 4 times in.
ZOOM_LVL_IN_2X | Zoomed 2 times in.
ZOOM_LVL_NORMAL | The normal zoom level.
ZOOM_LVL_OUT_2X | Zoomed 2 times out.
ZOOM_LVL_OUT_4X | Zoomed 4 times out.
ZOOM_LVL_OUT_8X | Zoomed 8 times out.
ZOOM_LVL_END | End for iteration.
ZOOM_LVL_VIEWPORT | Default zoom level for viewports.
ZOOM_LVL_NEWS | Default zoom level for the news messages.
ZOOM_LVL_INDUSTRY | Default zoom level for the industry view.
ZOOM_LVL_TOWN | Default zoom level for the town view.
ZOOM_LVL_AIRCRAFT | Default zoom level for the aircraft view.
ZOOM_LVL_SHIP | Default zoom level for the ship view.
ZOOM_LVL_TRAIN | Default zoom level for the train view.
ZOOM_LVL_ROADVEH | Default zoom level for the road vehicle view.
ZOOM_LVL_WORLD_SCREENSHOT | Default zoom level for the world screen shot.
ZOOM_LVL_DETAIL | All zoom levels below or equal to this will result in details on the screen, like road-work, ...
ZOOM_LVL_TEXT_EFFECT | All zoom levels above this will not show text effects.
ZOOM_LVL_MIN | Minimum zoom level.
ZOOM_LVL_MAX | Maximum zoom level.

Definition at line 16 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::OnMouseLoop(), 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(), and UpdateGUIZoom().

## ◆ MAX_INTERFACE_SCALE

const int MAX_INTERFACE_SCALE = 500
| static

Definition at line 58 of file zoom_type.h.

## ◆ MIN_INTERFACE_SCALE

const int MIN_INTERFACE_SCALE = 100
| static

Definition at line 57 of file zoom_type.h.

## ◆ ZOOM_BASE

uint const ZOOM_BASE = 1U << ZOOM_BASE_SHIFT
| static

Definition at line 48 of file zoom_type.h.

## ◆ ZOOM_BASE_SHIFT

uint const ZOOM_BASE_SHIFT = static_cast<uint>(ZOOM_LVL_NORMAL)
| static

Definition at line 47 of file zoom_type.h.