OpenTTD Source: src/viewport_type.h File Reference

OpenTTD Source 15.0-RC2

Data Structures | Typedefs | Enumerations | Variables
viewport_type.h File Reference

Types related to viewports. More...

`#include "core/enum_type.hpp"`
`#include "zoom_type.h"`

Go to the source code of this file.

## Data Structures
struct | Viewport
| Data structure for viewport, display of a part of the world. More...
struct | ViewportSign
| Location information about a sign as seen on the viewport. More...
struct | TrackedViewportSign
| Specialised ViewportSign that tracks whether it is valid for entering into a Kdtree. More...

## Typedefs
using | ViewportStringFlags = EnumBitSet< ViewportStringFlag, uint8_t >

## Enumerations
enum class | ViewportStringFlag : uint8_t { Small , Shadow , ColourRect , TransparentRect , TextColour }
| Flags to control how Viewport Strings are rendered. More...
enum | ZoomStateChange : uint8_t { ZOOM_IN = 0 , ZOOM_OUT = 1 , ZOOM_NONE = 2 }
| Directions of zooming. More...
enum | ViewportPlaceMethod : uint8_t { VPM_X_OR_Y = 0 , VPM_FIX_X = 1 , VPM_FIX_Y = 2 , VPM_X_AND_Y = 3 , VPM_X_AND_Y_LIMITED = 4 , VPM_FIX_HORIZONTAL = 5 , VPM_FIX_VERTICAL = 6 , VPM_X_LIMITED = 7 , VPM_Y_LIMITED = 8 , VPM_RAILDIRS = 0x40 , VPM_SIGNALDIRS = 0x80 }
| Viewport place method (type of highlighted area and placed objects) More...
enum | ViewportDragDropSelectionProcess : uint8_t { DDSP_DEMOLISH_AREA , DDSP_RAISE_AND_LEVEL_AREA , DDSP_LOWER_AND_LEVEL_AREA , DDSP_LEVEL_AREA , DDSP_CREATE_DESERT , DDSP_CREATE_ROCKS , DDSP_CREATE_WATER , DDSP_CREATE_RIVER , DDSP_PLANT_TREES , DDSP_BUILD_BRIDGE , DDSP_BUILD_OBJECT , DDSP_PLACE_RAIL , DDSP_BUILD_SIGNALS , DDSP_BUILD_STATION , DDSP_REMOVE_STATION , DDSP_CONVERT_RAIL , DDSP_PLACE_ROAD_X_DIR , DDSP_PLACE_ROAD_Y_DIR , DDSP_PLACE_AUTOROAD , DDSP_BUILD_ROAD_WAYPOINT , DDSP_BUILD_BUSSTOP , DDSP_BUILD_TRUCKSTOP , DDSP_REMOVE_ROAD_WAYPOINT , DDSP_REMOVE_BUSSTOP , DDSP_REMOVE_TRUCKSTOP , DDSP_CONVERT_ROAD }
| Drag and drop selection process, or, what to do with an area of land when you've selected it. More...
enum | ViewportScrollTarget : uint8_t { VST_EVERYONE , VST_COMPANY , VST_CLIENT }
| Target of the viewport scrolling GS method. More...

## Variables
static constexpr int | BB_HEIGHT_UNDER_BRIDGE = 6
| Some values for constructing bounding boxes (BB).
static constexpr int | BB_Z_SEPARATOR = 7
| Separates the bridge/tunnel from the things under/above it.

## Detailed Description

Types related to viewports.

Definition in file viewport_type.h.

## Typedef Documentation

## ◆ ViewportStringFlags

using ViewportStringFlags = EnumBitSet<ViewportStringFlag, uint8_t>

Definition at line 26 of file viewport_type.h.

## Enumeration Type Documentation

## ◆ ViewportDragDropSelectionProcess

enum ViewportDragDropSelectionProcess : uint8_t

Drag and drop selection process, or, what to do with an area of land when you've selected it.

Enumerator
DDSP_DEMOLISH_AREA | Clear area.
DDSP_RAISE_AND_LEVEL_AREA | Raise / level area.
DDSP_LOWER_AND_LEVEL_AREA | Lower / level area.
DDSP_LEVEL_AREA | Level area.
DDSP_CREATE_DESERT | Fill area with desert.
DDSP_CREATE_ROCKS | Fill area with rocks.
DDSP_CREATE_WATER | Create a canal.
DDSP_CREATE_RIVER | Create rivers.
DDSP_PLANT_TREES | Plant trees.
DDSP_BUILD_BRIDGE | Bridge placement.
DDSP_BUILD_OBJECT | Build an object.
DDSP_PLACE_RAIL | Rail placement.
DDSP_BUILD_SIGNALS | Signal placement.
DDSP_BUILD_STATION | Station placement.
DDSP_REMOVE_STATION | Station removal.
DDSP_CONVERT_RAIL | Rail conversion.
DDSP_PLACE_ROAD_X_DIR | Road placement (X axis)
DDSP_PLACE_ROAD_Y_DIR | Road placement (Y axis)
DDSP_PLACE_AUTOROAD | Road placement (auto)
DDSP_BUILD_ROAD_WAYPOINT | Road stop placement (waypoint)
DDSP_BUILD_BUSSTOP | Road stop placement (buses)
DDSP_BUILD_TRUCKSTOP | Road stop placement (trucks)
DDSP_REMOVE_ROAD_WAYPOINT | Road stop removal (waypoint)
DDSP_REMOVE_BUSSTOP | Road stop removal (buses)
DDSP_REMOVE_TRUCKSTOP | Road stop removal (trucks)
DDSP_CONVERT_ROAD | Road conversion.

Definition at line 115 of file viewport_type.h.

## ◆ ViewportPlaceMethod

enum ViewportPlaceMethod : uint8_t

Viewport place method (type of highlighted area and placed objects)

Enumerator
VPM_X_OR_Y | drag in X or Y direction
VPM_FIX_X | drag only in X axis
VPM_FIX_Y | drag only in Y axis
VPM_X_AND_Y | area of land in X and Y directions
VPM_X_AND_Y_LIMITED | area of land of limited size
VPM_FIX_HORIZONTAL | drag only in horizontal direction
VPM_FIX_VERTICAL | drag only in vertical direction
VPM_X_LIMITED | Drag only in X axis with limited size.
VPM_Y_LIMITED | Drag only in Y axis with limited size.
VPM_RAILDIRS | all rail directions
VPM_SIGNALDIRS | similar to VMP_RAILDIRS, but with different cursor

Definition at line 96 of file viewport_type.h.

## ◆ ViewportScrollTarget

enum ViewportScrollTarget : uint8_t

Target of the viewport scrolling GS method.

Enumerator
VST_EVERYONE | All players.
VST_COMPANY | All players in specific company.
VST_CLIENT | Single player.

Definition at line 152 of file viewport_type.h.

## ◆ ViewportStringFlag

enum class ViewportStringFlag : uint8_t
| strong

Flags to control how Viewport Strings are rendered.

Enumerator
Small | Draw using the small font.
Shadow | Draw an extra text shadow. Should only be used with ViewportStringFlag::Small, as normal font already has a shadow.
ColourRect | Draw a colour rect around the sign.
TransparentRect | Draw a transparent rect around the sign.
TextColour | Draw text in colour.

Definition at line 19 of file viewport_type.h.

## ◆ ZoomStateChange

enum ZoomStateChange : uint8_t

Directions of zooming.

See also
  DoZoomInOutWindow

Enumerator
ZOOM_IN | Zoom in (get more detailed view).
ZOOM_OUT | Zoom out (get helicopter view).
ZOOM_NONE | Hack, used to update the button status.

Definition at line 80 of file viewport_type.h.

## Variable Documentation

## ◆ BB_HEIGHT_UNDER_BRIDGE

constexpr int BB_HEIGHT_UNDER_BRIDGE = 6
| staticconstexpr

Some values for constructing bounding boxes (BB).

The Z positions under bridges are: z=0..5 Everything that can be built under low bridges. z=6 reserved, currently unused. z=7 Z separator between bridge/tunnel and the things under/above it. Everything that can be built under low bridges, must not exceed this Z height.

Definition at line 92 of file viewport_type.h.

Referenced by DrawRailCatenaryOnBridge(), DrawRailCatenaryRailway(), and DrawRoadTypeCatenary().

## ◆ BB_Z_SEPARATOR

constexpr int BB_Z_SEPARATOR = 7
| staticconstexpr

Separates the bridge/tunnel from the things under/above it.

Definition at line 93 of file viewport_type.h.

Referenced by DrawBridgeMiddle(), and DrawTile_TunnelBridge().