OpenTTD
slope_type.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * 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.
4  * 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.
5  * 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/>.
6  */
7 
14 #ifndef SLOPE_TYPE_H
15 #define SLOPE_TYPE_H
16 
17 #include "core/enum_type.hpp"
18 
22 enum Corner {
23  CORNER_W = 0,
24  CORNER_S = 1,
25  CORNER_E = 2,
26  CORNER_N = 3,
27  CORNER_END,
28  CORNER_INVALID = 0xFF
29 };
30 
31 
48 enum Slope {
49  SLOPE_FLAT = 0x00,
50  SLOPE_W = 0x01,
51  SLOPE_S = 0x02,
52  SLOPE_E = 0x04,
53  SLOPE_N = 0x08,
54  SLOPE_STEEP = 0x10,
70 
71  SLOPE_HALFTILE = 0x20,
73  SLOPE_HALFTILE_W = SLOPE_HALFTILE | (CORNER_W << 6),
74  SLOPE_HALFTILE_S = SLOPE_HALFTILE | (CORNER_S << 6),
75  SLOPE_HALFTILE_E = SLOPE_HALFTILE | (CORNER_E << 6),
76  SLOPE_HALFTILE_N = SLOPE_HALFTILE | (CORNER_N << 6),
77 };
79 
80 
84 #define M(x) (1 << (x))
85 
87 #undef M
88 
89 
93 enum Foundation {
99 
100  /* Halftile foundations */
106 
107  /* Special anti-zig-zag foundations for single horizontal/vertical track */
112 
114 };
115 
116 #endif /* SLOPE_TYPE_H */
the north corner of the tile is raised
Definition: slope_type.h:53
Corner
Enumeration of tile corners.
Definition: slope_type.h:22
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Foundation for TRACK_BIT_RIGHT, but not a leveled foundation.
Definition: slope_type.h:110
south and east corner are raised
Definition: slope_type.h:57
the west corner of the tile is raised
Definition: slope_type.h:50
Level south halftile non-continuously.
Definition: slope_type.h:103
north and south corner are raised
Definition: slope_type.h:60
the west halftile is leveled (non continuous slope)
Definition: slope_type.h:73
the south halftile is leveled (non continuous slope)
Definition: slope_type.h:74
Foundation for TRACK_BIT_LOWER, but not a leveled foundation.
Definition: slope_type.h:109
the east corner of the tile is raised
Definition: slope_type.h:52
north, west and south corner are raised
Definition: slope_type.h:62
south and west corner are raised
Definition: slope_type.h:56
a flat tile
Definition: slope_type.h:49
Type (helpers) for enums.
north and east corner are raised
Definition: slope_type.h:58
east, north and west corner are raised
Definition: slope_type.h:65
indicates the slope is steep
Definition: slope_type.h:54
Foundation
Enumeration for Foundations.
Definition: slope_type.h:93
Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
Definition: slope_type.h:111
The tile is leveled up to a flat slope.
Definition: slope_type.h:95
Level north halftile non-continuously.
Definition: slope_type.h:105
west, south and east corner are raised
Definition: slope_type.h:63
Foundation for TRACK_BIT_LEFT, but not a leveled foundation.
Definition: slope_type.h:108
static const uint32 VALID_LEVEL_CROSSING_SLOPES
Constant bitset with safe slopes for building a level crossing.
Definition: slope_type.h:86
one halftile is leveled (non continuous slope)
Definition: slope_type.h:71
The tile has an along Y-axis inclined foundation.
Definition: slope_type.h:97
bit mask containing all &#39;simple&#39; slopes
Definition: slope_type.h:61
The tile has a steep slope. The lowest corner is raised by a foundation and the upper halftile is lev...
Definition: slope_type.h:101
#define M(x)
Helper for creating a bitset of slopes.
Definition: slope_type.h:84
a steep slope falling to east (from west)
Definition: slope_type.h:66
east and west corner are raised
Definition: slope_type.h:59
north and west corner are raised
Definition: slope_type.h:55
The tile has no foundation, the slope remains unchanged.
Definition: slope_type.h:94
The tile has an along X-axis inclined foundation.
Definition: slope_type.h:96
Used inside "rail_cmd.cpp" to indicate invalid slope/track combination.
Definition: slope_type.h:113
the east halftile is leveled (non continuous slope)
Definition: slope_type.h:75
Slope
Enumeration for the slope-type.
Definition: slope_type.h:48
the north halftile is leveled (non continuous slope)
Definition: slope_type.h:76
Level east halftile non-continuously.
Definition: slope_type.h:104
a steep slope falling to south (from north)
Definition: slope_type.h:69
The tile has a steep slope. The lowest corner is raised by a foundation to allow building railroad on...
Definition: slope_type.h:98
a steep slope falling to west (from east)
Definition: slope_type.h:68
three bits used for halftile slopes
Definition: slope_type.h:72
the south corner of the tile is raised
Definition: slope_type.h:51
Level west halftile non-continuously.
Definition: slope_type.h:102
south, east and north corner are raised
Definition: slope_type.h:64
a steep slope falling to north (from south)
Definition: slope_type.h:67