39static const uint NUM_TRACKS_AT_PCP = 6;
116#define NUM_IGNORE_GROUPS 3
331struct SortableSpriteStruct : SpriteBounds {
332 uint8_t image_offset;
334 constexpr SortableSpriteStruct(uint8_t image_offset,
const SpriteBounds &bounds) : SpriteBounds(bounds), image_offset(image_offset) {}
335 constexpr SortableSpriteStruct(uint8_t image_offset, int8_t x_offset, int8_t y_offset, uint8_t x_size, uint8_t y_size, uint8_t z_size, int8_t z_offset) :
336 SpriteBounds({x_offset, y_offset, z_offset}, {x_size, y_size, z_size}, {}), image_offset(image_offset) {}
423 { WSO_ENTRANCE_SW, {{0, 0,
BB_Z_SEPARATOR}, {16, 15, 1}, {0, 7,
ELRAIL_TUNNEL_OFFSET}} },
424 { WSO_ENTRANCE_NW, {{0, 0,
BB_Z_SEPARATOR}, {15, 16, 1}, {7, 0,
ELRAIL_TUNNEL_OFFSET}} },
425 { WSO_ENTRANCE_NE, {{0, 0,
BB_Z_SEPARATOR}, {16, 15, 1}, {0, 7,
ELRAIL_TUNNEL_OFFSET}} },
485 INVALID_CATENARY = 0xFF
498 {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH},
499 {INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH},
500 {INVALID_CATENARY, WIRE_EW_N_W, WIRE_EW_N_E, WIRE_EW_N_BOTH},
501 {INVALID_CATENARY, WIRE_EW_S_E, WIRE_EW_S_W, WIRE_EW_S_BOTH},
502 {INVALID_CATENARY, WIRE_NS_W_S, WIRE_NS_W_N, WIRE_NS_W_BOTH},
503 {INVALID_CATENARY, WIRE_NS_E_N, WIRE_NS_E_S, WIRE_NS_E_BOTH},
505 {INVALID_CATENARY, WIRE_X_UP_NE, WIRE_X_UP_SW, WIRE_X_UP_BOTH},
506 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
507 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
508 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
509 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
510 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
512 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
513 {INVALID_CATENARY, WIRE_Y_UP_SE, WIRE_Y_UP_NW, WIRE_Y_UP_BOTH},
514 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
515 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
516 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
517 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
519 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
520 {INVALID_CATENARY, WIRE_Y_DOWN_SE, WIRE_Y_DOWN_NW, WIRE_Y_DOWN_BOTH},
521 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
522 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
523 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
524 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
526 {INVALID_CATENARY, WIRE_X_DOWN_NE, WIRE_X_DOWN_SW, WIRE_X_DOWN_BOTH},
527 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
528 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
529 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
530 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
531 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
EnumIndexArray< T, DiagDirection, DiagDirection::End > DiagDirectionIndexArray
Array with DiagDirection as index.
EnumIndexArray< T, Direction, Direction::End > DirectionIndexArray
Array with Direction as index.
EnumBitSet< Direction, uint8_t > Directions
Allow incrementing of Direction variables.
@ NE
Northeast, upper right on your monitor.
static constexpr Directions DIRECTIONS_ALL
All possible directions.
static const uint ELRAIL_ELEVRAISE
Wires that a draw one level higher than the north corner.
static const DiagDirectionIndexArray< std::array< DirectionIndexArray< Direction >, TLG_END > > _ppp_order
Several PPPs maybe exist, here they are sorted in order of preference.
PylonSpriteOffset
Offset for pylon sprites from the base pylon sprite.
static const DiagDirectionIndexArray< int8_t > _x_pcp_offsets
static const uint ELRAIL_ELEVLOWER
Wires that a draw one level lower than the north corner.
static const DirectionIndexArray< uint8_t > _pylon_sprites
The type of pylon to draw at each PPP.
TileSource
When determining the pylon configuration on the edge, two tiles are taken into account: the tile bein...
@ Neighbour
Neighbouring tile.
static const DiagDirectionIndexArray< SortableSpriteStruct > _rail_catenary_sprite_data_tunnel
Catenary sprite data of a tunnel for each direction.
RailCatenarySprite
Refers to a certain element of the catenary.
static const TrackIndexArray< DiagDirectionIndexArray< Directions > > _disallowed_ppp_of_track_at_pcp
Which pylons can definitely NOT be built.
WireSpriteOffset
Offset for wire sprites from the base wire sprite.
static const TrackIndexArray< std::array< DiagDirection, 2 > > _pcp_positions
Maps a track bit onto two PCP positions.
static const DiagDirectionIndexArray< int8_t > _y_pcp_offsets
static const DirectionIndexArray< int8_t > _x_ppp_offsets
static const DiagDirectionIndexArray< Directions > _owned_ppp_on_pcp
Which of the PPPs are inside the tile.
static const TrackIndexArray< DiagDirectionIndexArray< Directions > > _preferred_ppp_of_track_at_pcp
Preferred points of each trackbit.
static const DiagDirectionIndexArray< Directions > _allowed_ppp_on_pcp
Which PPPs are possible at all on a given PCP.
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 int8_t ELRAIL_TUNNEL_OFFSET
In tunnelheads, the bounding box for wires covers nearly the full tile, and is lowered a bit.
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 whic...
static const DiagDirectionIndexArray< SortableSpriteStruct > _rail_catenary_sprite_data_depot
Catenary sprite data of a depot for each direction.
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...
TileLocationGroup
Tile Location group.
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 ...
static const DirectionIndexArray< int8_t > _y_ppp_offsets
static const uint ELRAIL_ELEVATION
Distance between wire and rail.
static constexpr uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in ZOOM_BASE.
EnumIndexArray< T, Track, TRACK_END > TrackIndexArray
Allow incrementing of Track variables.
@ TRACK_Y
Track along the y-axis (north-west to south-east).
@ TRACK_LOWER
Track in the lower corner of the tile (south).
@ TRACK_END
Used for iterations.
@ TRACK_LEFT
Track in the left corner of the tile (west).
@ TRACK_RIGHT
Track in the right corner of the tile (east).
@ TRACK_X
Track along the x-axis (north-east to south-west).
@ TRACK_UPPER
Track in the upper corner of the tile (north).
static constexpr int BB_Z_SEPARATOR
Separates the bridge/tunnel from the things under/above it.