|
OpenTTD Source 20260531-master-g0e951f3528
|
Stores all the data for overhead wire and pylon drawing. More...
Go to the source code of this file.
Data Structures | |
| struct | SortableSpriteStruct |
Macros | |
| #define | NUM_IGNORE_GROUPS 3 |
Enumerations | |
| enum | TileLocationGroup : uint8_t { XEVEN_YEVEN = 0 , XEVEN_YODD = 1 , XODD_YEVEN = 2 , XODD_YODD = 3 , TLG_END } |
| Tile Location group. More... | |
| enum class | TileSource : uint8_t { Home , Neighbour , End } |
| When determining the pylon configuration on the edge, two tiles are taken into account: the tile being drawn itself (the home tile, the one in ti->tile), and the neighbouring tile. More... | |
| enum | PylonSpriteOffset : uint8_t { PSO_Y_NE , PSO_Y_SW , PSO_X_NW , PSO_X_SE , PSO_EW_N , PSO_EW_S , PSO_NS_W , PSO_NS_E } |
| Offset for pylon sprites from the base pylon sprite. More... | |
| enum | WireSpriteOffset : uint8_t { WSO_X_SHORT , WSO_Y_SHORT , WSO_EW_SHORT , WSO_NS_SHORT , WSO_X_SHORT_DOWN , WSO_Y_SHORT_UP , WSO_X_SHORT_UP , WSO_Y_SHORT_DOWN , WSO_X_SW , WSO_Y_SE , WSO_EW_E , WSO_NS_S , WSO_X_SW_DOWN , WSO_Y_SE_UP , WSO_X_SW_UP , WSO_Y_SE_DOWN , WSO_X_NE , WSO_Y_NW , WSO_EW_W , WSO_NS_N , WSO_X_NE_DOWN , WSO_Y_NW_UP , WSO_X_NE_UP , WSO_Y_NW_DOWN , WSO_ENTRANCE_SW , WSO_ENTRANCE_NW , WSO_ENTRANCE_NE , WSO_ENTRANCE_SE } |
| Offset for wire sprites from the base wire sprite. More... | |
| enum | RailCatenarySprite : uint8_t { WIRE_X_FLAT_SW , WIRE_X_FLAT_NE , WIRE_X_FLAT_BOTH , WIRE_X_UP_SW , WIRE_X_UP_NE , WIRE_X_UP_BOTH , WIRE_X_DOWN_SW , WIRE_X_DOWN_NE , WIRE_X_DOWN_BOTH , WIRE_Y_FLAT_SE , WIRE_Y_FLAT_NW , WIRE_Y_FLAT_BOTH , WIRE_Y_UP_SE , WIRE_Y_UP_NW , WIRE_Y_UP_BOTH , WIRE_Y_DOWN_SE , WIRE_Y_DOWN_NW , WIRE_Y_DOWN_BOTH , WIRE_NS_W_BOTH , WIRE_NS_E_BOTH , WIRE_NS_W_N , WIRE_NS_E_N , WIRE_NS_W_S , WIRE_NS_E_S , WIRE_EW_N_BOTH , WIRE_EW_S_BOTH , WIRE_EW_N_W , WIRE_EW_S_W , WIRE_EW_N_E , WIRE_EW_S_E , INVALID_CATENARY = 0xFF } |
| Refers to a certain element of the catenary. More... | |
Variables | |
| static const uint | NUM_TRACKS_AT_PCP = 6 |
| static const DiagDirectionIndexArray< Directions > | _allowed_ppp_on_pcp |
| Which PPPs are possible at all on a given PCP. | |
| static const DiagDirectionIndexArray< Directions > | _owned_ppp_on_pcp |
| Which of the PPPs are inside the tile. | |
| static const TrackIndexArray< std::array< DiagDirection, 2 > > | _pcp_positions |
| Maps a track bit onto two PCP positions. | |
| static const TrackIndexArray< DiagDirectionIndexArray< Directions > > | _preferred_ppp_of_track_at_pcp |
| Preferred points of each trackbit. | |
| static const DiagDirectionIndexArray< Directions > | _ignored_pcp [NUM_IGNORE_GROUPS][TLG_END] |
| In case we have a straight line, we place pylon only every two tiles, so there are certain tiles which we ignore. | |
| static const TrackIndexArray< DiagDirectionIndexArray< Directions > > | _disallowed_ppp_of_track_at_pcp |
| Which pylons can definitely NOT be built. | |
| static const DiagDirectionIndexArray< std::array< Track, NUM_TRACKS_AT_PCP > > | _tracks_at_pcp |
| This array stores which track bits can meet at a tile edge. | |
| static const DiagDirectionIndexArray< std::array< TileSource, NUM_TRACKS_AT_PCP > > | _track_source_tile |
| Takes each of the 6 track bits from the array above and assigns it to the home tile or neighbour tile. | |
| static const DiagDirectionIndexArray< std::array< DirectionIndexArray< Direction >, TLG_END > > | _ppp_order |
| Several PPPs maybe exist, here they are sorted in order of preference. | |
| static const DirectionIndexArray< uint8_t > | _pylon_sprites |
| The type of pylon to draw at each PPP. | |
| static const uint | ELRAIL_ELEVATION = 10 |
| Distance between wire and rail. | |
| static const uint | ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT + 1 |
| Wires that a draw one level higher than the north corner. | |
| static const uint | ELRAIL_ELEVLOWER = ELRAIL_ELEVATION - 1 |
| Wires that a draw one level lower than the north corner. | |
| static const SortableSpriteStruct | _rail_catenary_sprite_data [] |
| static const DiagDirectionIndexArray< SortableSpriteStruct > | _rail_catenary_sprite_data_depot |
| Catenary sprite data of a depot for each direction. | |
| static const int8_t | ELRAIL_TUNNEL_OFFSET = ELRAIL_ELEVATION - BB_Z_SEPARATOR |
| In tunnelheads, the bounding box for wires covers nearly the full tile, and is lowered a bit. | |
| static const DiagDirectionIndexArray< SortableSpriteStruct > | _rail_catenary_sprite_data_tunnel |
| Catenary sprite data of a tunnel for each direction. | |
| static const RailCatenarySprite | _rail_wires [5][TRACK_END][4] |
| Selects a Wire (with white and grey ends) depending on whether: a) none (should never happen) b) the first c) the second d) both PCP exists. | |
| static const DiagDirectionIndexArray< int8_t > | _x_pcp_offsets {0, 8, 16, 8} |
| static const DiagDirectionIndexArray< int8_t > | _y_pcp_offsets {8, 16, 8, 0} |
| static const DirectionIndexArray< int8_t > | _x_ppp_offsets {-2, -4, -2, 0, 2, 4, 2, 0} |
| static const DirectionIndexArray< int8_t > | _y_ppp_offsets {-2, 0, 2, 4, 2, 0, -2, -4} |
Stores all the data for overhead wire and pylon drawing.
Definition in file elrail_data.h.
| #define NUM_IGNORE_GROUPS 3 |
Definition at line 116 of file elrail_data.h.
| enum PylonSpriteOffset : uint8_t |
Offset for pylon sprites from the base pylon sprite.
Definition at line 271 of file elrail_data.h.
| enum RailCatenarySprite : uint8_t |
Refers to a certain element of the catenary.
Identifiers for Wires:
Identifiers for Pylons:
Definition at line 442 of file elrail_data.h.
| enum TileLocationGroup : uint8_t |
Tile Location group.
This defines whether the X and or Y coordinate of a tile is even
Definition at line 20 of file elrail_data.h.
|
strong |
When determining the pylon configuration on the edge, two tiles are taken into account: the tile being drawn itself (the home tile, the one in ti->tile), and the neighbouring tile.
| Enumerator | |
|---|---|
| Home | Home tile. |
| Neighbour | Neighbouring tile. |
| End | End marker. |
Definition at line 33 of file elrail_data.h.
| enum WireSpriteOffset : uint8_t |
Offset for wire sprites from the base wire sprite.
Definition at line 297 of file elrail_data.h.
|
static |
Which PPPs are possible at all on a given PCP.
Definition at line 42 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Which pylons can definitely NOT be built.
Definition at line 204 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
In case we have a straight line, we place pylon only every two tiles, so there are certain tiles which we ignore.
A straight line is found if we have exactly two PPPs.
Definition at line 122 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Which of the PPPs are inside the tile.
For the two PPPs on the tile border the following system is used: if you rotate the PCP so that it is in the north, the eastern PPP belongs to the tile.
Definition at line 54 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Maps a track bit onto two PCP positions.
Definition at line 62 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Several PPPs maybe exist, here they are sorted in order of preference.
Definition at line 230 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Preferred points of each trackbit.
Those are the ones perpendicular to the track, plus the point in extension of the track (to mark end-of-track). PCPs which are not on either end of the track are fully preferred.
Definition at line 77 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
The type of pylon to draw at each PPP.
Definition at line 283 of file elrail_data.h.
Referenced by DrawRailCatenaryOnBridge(), and DrawRailCatenaryRailway().
|
static |
Definition at line 346 of file elrail_data.h.
|
static |
Catenary sprite data of a depot for each direction.
Definition at line 408 of file elrail_data.h.
Referenced by DrawRailCatenary().
|
static |
Catenary sprite data of a tunnel for each direction.
Definition at line 422 of file elrail_data.h.
Referenced by DrawRailCatenaryOnTunnel().
|
static |
Selects a Wire (with white and grey ends) depending on whether: a) none (should never happen) b) the first c) the second d) both PCP exists.
Definition at line 496 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Takes each of the 6 track bits from the array above and assigns it to the home tile or neighbour tile.
Definition at line 222 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
This array stores which track bits can meet at a tile edge.
Definition at line 214 of file elrail_data.h.
Referenced by DrawRailCatenaryRailway().
|
static |
Geometric placement of the PCP relative to the tile origin.
Definition at line 259 of file elrail_data.h.
Referenced by DrawRailCatenaryOnBridge(), DrawRailCatenaryRailway(), and GetPCPElevation().
|
static |
Geometric placement of the PPP relative to the PCP.
Definition at line 264 of file elrail_data.h.
Referenced by DrawRailCatenaryOnBridge(), and DrawRailCatenaryRailway().
|
static |
Geometric placement of the PCP relative to the tile origin.
Definition at line 260 of file elrail_data.h.
Referenced by DrawRailCatenaryOnBridge(), DrawRailCatenaryRailway(), and GetPCPElevation().
|
static |
Geometric placement of the PPP relative to the PCP.
Definition at line 265 of file elrail_data.h.
Referenced by DrawRailCatenaryOnBridge(), and DrawRailCatenaryRailway().
|
static |
Distance between wire and rail.
Definition at line 340 of file elrail_data.h.
|
static |
Wires that a draw one level lower than the north corner.
Definition at line 344 of file elrail_data.h.
|
static |
Wires that a draw one level higher than the north corner.
Definition at line 342 of file elrail_data.h.
|
static |
In tunnelheads, the bounding box for wires covers nearly the full tile, and is lowered a bit.
ELRAIL_TUNNEL_OFFSET is the difference between visual position and bounding box.
Definition at line 419 of file elrail_data.h.
|
static |
Definition at line 39 of file elrail_data.h.