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