OpenTTD Source 20260531-master-g0e951f3528
track_data.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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
19};
20
25};
26
35};
36
39 TRACK_BIT_Y, // TRACK_X
40 TRACK_BIT_X, // TRACK_Y
41 TRACK_BIT_VERT, // TRACK_UPPER
42 TRACK_BIT_VERT, // TRACK_LOWER
43 TRACK_BIT_HORZ, // TRACK_LEFT
44 TRACK_BIT_HORZ // TRACK_RIGHT
45};
46
51};
52
61}}};
62
71}}};
72
81}}};
82
86};
87
91};
92
93extern const TrackdirBits _uphill_trackdirs[] = {
125};
EnumIndexArray< T, DiagDirection, DiagDirection::End > DiagDirectionIndexArray
Array with DiagDirection as index.
@ SW
Southwest.
@ NW
Northwest.
@ NE
Northeast, upper right on your monitor.
@ SE
Southeast.
EnumIndexArray< T, Corner, CORNER_END > CornerIndexArray
Array with Corner as index.
Definition slope_type.h:35
const TrackIndexArray< DiagDirectionIndexArray< Trackdir > > _track_enterdir_to_trackdir
Maps a track and an (4-way) dir to the trackdir that represents the track with the entry in the given...
const TrackIndexArray< TrackdirBits > _track_crosses_trackdirs
Maps a trackdir to all trackdirs that make 90 deg turns with it.
const DiagDirectionIndexArray< TrackdirBits > _exitdir_reaches_trackdirs
Maps a diagonal direction to the all trackdirs that are connected to any track entering in this direc...
const CornerIndexArray< TrackBits > _corner_to_trackbits
Maps a single horizontal/vertical trackbit that is in a specific tile corner.
const TrackdirIndexArray< DiagDirection > _trackdir_to_exitdir
Maps a trackdir to the (4-way) direction the tile is exited when following that trackdir.
const TrackdirIndexArray< Trackdir > _next_trackdir
Next trackdir to use when moving to a new tile for each current trackdir.
const DiagDirectionIndexArray< Trackdir > _dir_to_diag_trackdir
Maps a (4-way) direction to the diagonal trackdir that runs in that direction.
const TrackIndexArray< DirectionIndexArray< Trackdir > > _track_direction_to_trackdir
Maps a track and a full (8-way) direction to the trackdir that represents the track running in the gi...
const TrackIndexArray< TrackBits > _track_crosses_tracks
Maps a track to all tracks that make 90 deg turns with it.
const TrackIndexArray< DiagDirectionIndexArray< Trackdir > > _track_exitdir_to_trackdir
Maps a track and an (4-way) dir to the trackdir that represents the track with the exit in the given ...
@ TRACK_BIT_UPPER
Upper track.
Definition track_type.h:46
@ TRACK_BIT_LEFT
Left track.
Definition track_type.h:48
@ TRACK_BIT_Y
Y-axis track.
Definition track_type.h:45
@ TRACK_BIT_HORZ
Upper and lower track.
Definition track_type.h:51
@ TRACK_BIT_X
X-axis track.
Definition track_type.h:44
@ TRACK_BIT_LOWER
Lower track.
Definition track_type.h:47
@ TRACK_BIT_RIGHT
Right track.
Definition track_type.h:49
@ TRACK_BIT_VERT
Left and right track.
Definition track_type.h:52
EnumIndexArray< T, Trackdir, TRACKDIR_END > TrackdirIndexArray
Allow incrementing of Trackdir variables.
Definition track_type.h:103
EnumIndexArray< T, Track, TRACK_END > TrackIndexArray
Allow incrementing of Track variables.
Definition track_type.h:39
@ TRACKDIR_X_NE
X-axis and direction to north-east.
Definition track_type.h:75
@ TRACKDIR_LOWER_E
Lower track and direction to east.
Definition track_type.h:78
@ TRACKDIR_RIGHT_N
Right track and direction to north.
Definition track_type.h:88
@ INVALID_TRACKDIR
Flag for an invalid trackdir.
Definition track_type.h:92
@ TRACKDIR_UPPER_E
Upper track and direction to east.
Definition track_type.h:77
@ TRACKDIR_Y_SE
Y-axis and direction to south-east.
Definition track_type.h:76
@ TRACKDIR_LEFT_S
Left track and direction to south.
Definition track_type.h:79
@ TRACKDIR_UPPER_W
Upper track and direction to west.
Definition track_type.h:85
@ TRACKDIR_X_SW
X-axis and direction to south-west.
Definition track_type.h:83
@ TRACKDIR_LOWER_W
Lower track and direction to west.
Definition track_type.h:86
@ TRACKDIR_Y_NW
Y-axis and direction to north-west.
Definition track_type.h:84
@ TRACKDIR_RIGHT_S
Right track and direction to south.
Definition track_type.h:80
@ TRACKDIR_LEFT_N
Left track and direction to north.
Definition track_type.h:87
TrackdirBits
Enumeration of bitmasks for the TrackDirs.
Definition track_type.h:111
@ TRACKDIR_BIT_LEFT_S
Track left, direction south.
Definition track_type.h:117
@ TRACKDIR_BIT_Y_NW
Track y-axis, direction north-west.
Definition track_type.h:121
@ TRACKDIR_BIT_UPPER_E
Track upper, direction east.
Definition track_type.h:115
@ TRACKDIR_BIT_X_NE
Track x-axis, direction north-east.
Definition track_type.h:113
@ TRACKDIR_BIT_LOWER_E
Track lower, direction east.
Definition track_type.h:116
@ TRACKDIR_BIT_LEFT_N
Track left, direction north.
Definition track_type.h:124
@ TRACKDIR_BIT_RIGHT_S
Track right, direction south.
Definition track_type.h:118
@ TRACKDIR_BIT_Y_SE
Track y-axis, direction south-east.
Definition track_type.h:114
@ TRACKDIR_BIT_NONE
No track build.
Definition track_type.h:112
@ TRACKDIR_BIT_RIGHT_N
Track right, direction north.
Definition track_type.h:125
@ TRACKDIR_BIT_UPPER_W
Track upper, direction west.
Definition track_type.h:122
@ TRACKDIR_BIT_LOWER_W
Track lower, direction west.
Definition track_type.h:123
@ TRACKDIR_BIT_X_SW
Track x-axis, direction south-west.
Definition track_type.h:120