Go to the documentation of this file.
1 /* $Id: viewport_type.h 27248 2015-04-25 11:58:19Z frosch $ */
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <>.
8  */
12 #ifndef VIEWPORT_TYPE_H
13 #define VIEWPORT_TYPE_H
15 #include "zoom_type.h"
16 #include "strings_type.h"
17 #include "table/strings.h"
19 class LinkGraphOverlay;
24 struct ViewPort {
25  int left;
26  int top;
27  int width;
28  int height;
36  LinkGraphOverlay *overlay;
37 };
41  VPSM_LEFT = 1,
42  VPSM_RIGHT = 1,
43  VPSM_TOP = 1,
45 };
48 struct ViewportSign {
49  int32 center;
50  int32 top;
51  uint16 width_normal;
52  uint16 width_small;
54  void UpdatePosition(int center, int top, StringID str, StringID str_small = STR_NULL);
55  void MarkDirty(ZoomLevel maxzoom = ZOOM_LVL_MAX) const;
56 };
63  ZOOM_IN = 0,
64  ZOOM_OUT = 1,
65  ZOOM_NONE = 2,
66 };
74 static const uint BB_HEIGHT_UNDER_BRIDGE = 6;
75 static const uint BB_Z_SEPARATOR = 7;
79  VPM_X_OR_Y = 0,
80  VPM_FIX_X = 1,
81  VPM_FIX_Y = 2,
88  VPM_RAILDIRS = 0x40,
89  VPM_SIGNALDIRS = 0x80,
90 };
109  /* Rail specific actions */
116  /* Road specific actions */
124 };
126 #endif /* VIEWPORT_TYPE_H */
Drag and drop selection process, or, what to do with an area of land when you&#39;ve selected it...
Definition: viewport_type.h:97
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
int virtual_left
Virtual left coordinate.
Definition: viewport_type.h:30
Station placement.
area of land of limited size
Definition: viewport_type.h:83
Raise / level area.
Definition: viewport_type.h:99
Road stop placement (trucks)
Zoom out (get helicopter view).
Definition: viewport_type.h:64
int height
Screen height of the viewport.
Definition: viewport_type.h:28
Road stop removal (trucks)
Lower / level area.
drag only in X axis
Definition: viewport_type.h:80
static const uint BB_Z_SEPARATOR
Separates the bridge/tunnel from the things under/above it.
Definition: viewport_type.h:75
Drag only in X axis with limited size.
Definition: viewport_type.h:86
similar to VMP_RAILDIRS, but with different cursor
Definition: viewport_type.h:89
drag only in Y axis
Definition: viewport_type.h:81
Drag only in Y axis with limited size.
Definition: viewport_type.h:87
int virtual_height
height << zoom
Definition: viewport_type.h:33
Zoom in (get more detailed view).
Definition: viewport_type.h:63
Road stop removal (buses)
Left margin.
Definition: viewport_type.h:41
Right margin.
Definition: viewport_type.h:42
Types related to zooming in and out.
Fill area with rocks.
Clear area.
Definition: viewport_type.h:98
Road placement (X axis)
Maximum zoom level.
Definition: zoom_type.h:48
Plant trees.
Signal placement.
int32 top
The top of the sign.
Definition: viewport_type.h:50
Viewport place method (type of highlighted area and placed objects)
Definition: viewport_type.h:78
drag in X or Y direction
Definition: viewport_type.h:79
Location information about a sign as seen on the viewport.
Definition: viewport_type.h:48
static const uint BB_HEIGHT_UNDER_BRIDGE
Some values for constructing bounding boxes (BB).
Definition: viewport_type.h:74
Road stop placement (buses)
Station removal.
uint16 width_normal
The width when not zoomed out (normal font)
Definition: viewport_type.h:51
int virtual_width
width << zoom
Definition: viewport_type.h:32
Create rivers.
Bridge placement.
Create a canal.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:18
drag only in horizontal direction
Definition: viewport_type.h:84
Road placement (auto)
Rail placement.
int32 center
The center position of the sign.
Definition: viewport_type.h:49
int left
Screen coordinate left egde of the viewport.
Definition: viewport_type.h:25
All zoom levels we know.
Definition: zoom_type.h:21
Fill area with desert.
area of land in X and Y directions
Definition: viewport_type.h:82
Bottom margin.
Definition: viewport_type.h:44
Data structure for viewport, display of a part of the world.
Definition: viewport_type.h:24
Rail conversion.
Margins for the viewport sign.
Definition: viewport_type.h:40
Top margin.
Definition: viewport_type.h:43
Types related to strings.
drag only in vertical direction
Definition: viewport_type.h:85
Road placement (Y axis)
ZoomLevel zoom
The zoom level of the viewport.
Definition: viewport_type.h:35
Directions of zooming.
Definition: viewport_type.h:62
int virtual_top
Virtual top coordinate.
Definition: viewport_type.h:31
uint16 width_small
The width when zoomed out (small font)
Definition: viewport_type.h:52
all rail directions
Definition: viewport_type.h:88
int top
Screen coordinate top edge of the viewport.
Definition: viewport_type.h:26
Level area.
Hack, used to update the button status.
Definition: viewport_type.h:65
Handles drawing of links into some window.
Definition: linkgraph_gui.h:38
int width
Screen width of the viewport.
Definition: viewport_type.h:27