OpenTTD
viewport_type.h
Go to the documentation of this file.
1 /* $Id: viewport_type.h 27248 2015-04-25 11:58:19Z frosch $ */
2 
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 <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef VIEWPORT_TYPE_H
13 #define VIEWPORT_TYPE_H
14 
15 #include "zoom_type.h"
16 #include "strings_type.h"
17 #include "table/strings.h"
18 
19 class LinkGraphOverlay;
20 
24 struct ViewPort {
25  int left;
26  int top;
27  int width;
28  int height;
29 
34 
36  LinkGraphOverlay *overlay;
37 };
38 
41  VPSM_LEFT = 1,
42  VPSM_RIGHT = 1,
43  VPSM_TOP = 1,
45 };
46 
48 struct ViewportSign {
49  int32 center;
50  int32 top;
51  uint16 width_normal;
52  uint16 width_small;
53 
54  void UpdatePosition(int center, int top, StringID str, StringID str_small = STR_NULL);
55  void MarkDirty(ZoomLevel maxzoom = ZOOM_LVL_MAX) const;
56 };
57 
63  ZOOM_IN = 0,
64  ZOOM_OUT = 1,
65  ZOOM_NONE = 2,
66 };
67 
74 static const uint BB_HEIGHT_UNDER_BRIDGE = 6;
75 static const uint BB_Z_SEPARATOR = 7;
76 
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 };
92 
93 
108 
109  /* Rail specific actions */
115 
116  /* Road specific actions */
124 };
125 
126 #endif /* VIEWPORT_TYPE_H */