OpenTTD Source  12.0-beta2
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 */
SLOPE_HALFTILE_S
@ SLOPE_HALFTILE_S
the south halftile is leveled (non continuous slope)
Definition: slope_type.h:74
FOUNDATION_HALFTILE_N
@ FOUNDATION_HALFTILE_N
Level north halftile non-continuously.
Definition: slope_type.h:105
FOUNDATION_RAIL_W
@ FOUNDATION_RAIL_W
Foundation for TRACK_BIT_LEFT, but not a leveled foundation.
Definition: slope_type.h:108
SLOPE_HALFTILE_E
@ SLOPE_HALFTILE_E
the east halftile is leveled (non continuous slope)
Definition: slope_type.h:75
SLOPE_SEN
@ SLOPE_SEN
south, east and north corner are raised
Definition: slope_type.h:64
SLOPE_HALFTILE_MASK
@ SLOPE_HALFTILE_MASK
three bits used for halftile slopes
Definition: slope_type.h:72
FOUNDATION_HALFTILE_W
@ FOUNDATION_HALFTILE_W
Level west halftile non-continuously.
Definition: slope_type.h:102
VALID_LEVEL_CROSSING_SLOPES
static const uint32 VALID_LEVEL_CROSSING_SLOPES
Constant bitset with safe slopes for building a level crossing.
Definition: slope_type.h:86
FOUNDATION_RAIL_E
@ FOUNDATION_RAIL_E
Foundation for TRACK_BIT_RIGHT, but not a leveled foundation.
Definition: slope_type.h:110
SLOPE_EW
@ SLOPE_EW
east and west corner are raised
Definition: slope_type.h:59
SLOPE_STEEP_S
@ SLOPE_STEEP_S
a steep slope falling to north (from south)
Definition: slope_type.h:67
Foundation
Foundation
Enumeration for Foundations.
Definition: slope_type.h:93
SLOPE_NW
@ SLOPE_NW
north and west corner are raised
Definition: slope_type.h:55
SLOPE_FLAT
@ SLOPE_FLAT
a flat tile
Definition: slope_type.h:49
FOUNDATION_INCLINED_Y
@ FOUNDATION_INCLINED_Y
The tile has an along Y-axis inclined foundation.
Definition: slope_type.h:97
SLOPE_HALFTILE_W
@ SLOPE_HALFTILE_W
the west halftile is leveled (non continuous slope)
Definition: slope_type.h:73
M
#define M(x)
Helper for creating a bitset of slopes.
Definition: slope_type.h:84
FOUNDATION_STEEP_BOTH
@ FOUNDATION_STEEP_BOTH
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
SLOPE_ELEVATED
@ SLOPE_ELEVATED
bit mask containing all 'simple' slopes
Definition: slope_type.h:61
SLOPE_NWS
@ SLOPE_NWS
north, west and south corner are raised
Definition: slope_type.h:62
FOUNDATION_INCLINED_X
@ FOUNDATION_INCLINED_X
The tile has an along X-axis inclined foundation.
Definition: slope_type.h:96
Corner
Corner
Enumeration of tile corners.
Definition: slope_type.h:22
SLOPE_STEEP
@ SLOPE_STEEP
indicates the slope is steep
Definition: slope_type.h:54
FOUNDATION_INVALID
@ FOUNDATION_INVALID
Used inside "rail_cmd.cpp" to indicate invalid slope/track combination.
Definition: slope_type.h:113
FOUNDATION_NONE
@ FOUNDATION_NONE
The tile has no foundation, the slope remains unchanged.
Definition: slope_type.h:94
SLOPE_SW
@ SLOPE_SW
south and west corner are raised
Definition: slope_type.h:56
SLOPE_STEEP_E
@ SLOPE_STEEP_E
a steep slope falling to west (from east)
Definition: slope_type.h:68
Slope
Slope
Enumeration for the slope-type.
Definition: slope_type.h:48
FOUNDATION_STEEP_LOWER
@ FOUNDATION_STEEP_LOWER
The tile has a steep slope. The lowest corner is raised by a foundation to allow building railroad on...
Definition: slope_type.h:98
SLOPE_N
@ SLOPE_N
the north corner of the tile is raised
Definition: slope_type.h:53
FOUNDATION_RAIL_N
@ FOUNDATION_RAIL_N
Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
Definition: slope_type.h:111
FOUNDATION_HALFTILE_E
@ FOUNDATION_HALFTILE_E
Level east halftile non-continuously.
Definition: slope_type.h:104
SLOPE_WSE
@ SLOPE_WSE
west, south and east corner are raised
Definition: slope_type.h:63
SLOPE_HALFTILE
@ SLOPE_HALFTILE
one halftile is leveled (non continuous slope)
Definition: slope_type.h:71
FOUNDATION_LEVELED
@ FOUNDATION_LEVELED
The tile is leveled up to a flat slope.
Definition: slope_type.h:95
SLOPE_S
@ SLOPE_S
the south corner of the tile is raised
Definition: slope_type.h:51
enum_type.hpp
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:29
SLOPE_W
@ SLOPE_W
the west corner of the tile is raised
Definition: slope_type.h:50
FOUNDATION_RAIL_S
@ FOUNDATION_RAIL_S
Foundation for TRACK_BIT_LOWER, but not a leveled foundation.
Definition: slope_type.h:109
SLOPE_STEEP_W
@ SLOPE_STEEP_W
a steep slope falling to east (from west)
Definition: slope_type.h:66
FOUNDATION_HALFTILE_S
@ FOUNDATION_HALFTILE_S
Level south halftile non-continuously.
Definition: slope_type.h:103
SLOPE_NS
@ SLOPE_NS
north and south corner are raised
Definition: slope_type.h:60
SLOPE_HALFTILE_N
@ SLOPE_HALFTILE_N
the north halftile is leveled (non continuous slope)
Definition: slope_type.h:76
SLOPE_SE
@ SLOPE_SE
south and east corner are raised
Definition: slope_type.h:57
SLOPE_ENW
@ SLOPE_ENW
east, north and west corner are raised
Definition: slope_type.h:65
SLOPE_NE
@ SLOPE_NE
north and east corner are raised
Definition: slope_type.h:58
SLOPE_E
@ SLOPE_E
the east corner of the tile is raised
Definition: slope_type.h:52
SLOPE_STEEP_N
@ SLOPE_STEEP_N
a steep slope falling to south (from north)
Definition: slope_type.h:69