OpenTTD Source
20241108-master-g80f628063a
|
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 | PCP_NOT_ON_TRACK 0xFF |
#define | NUM_IGNORE_GROUPS 3 |
#define | IGNORE_NONE 0xFF |
Enumerations | |
enum | TLG { XEVEN_YEVEN = 0 , XEVEN_YODD = 1 , XODD_YEVEN = 2 , XODD_YODD = 3 , TLG_END } |
Tile Location group. More... | |
enum | TileSource { TS_HOME = 0 , TS_NEIGHBOUR = 1 , TS_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. | |
enum | PylonSpriteOffset { 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. | |
enum | WireSpriteOffset { 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. | |
enum | RailCatenarySprite { 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 uint8_t | AllowedPPPonPCP [DIAGDIR_END] |
Which PPPs are possible at all on a given PCP. More... | |
static const uint8_t | OwnedPPPonPCP [DIAGDIR_END] |
Which of the PPPs are inside the tile. More... | |
static const DiagDirection | PCPpositions [TRACK_END][2] |
Maps a track bit onto two PCP positions. More... | |
static const uint8_t | PreferredPPPofTrackAtPCP [TRACK_END][DIAGDIR_END] |
Preferred points of each trackbit. More... | |
static const uint8_t | IgnoredPCP [NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] |
In case we have a straight line, we place pylon only every two tiles, so there are certain tiles which we ignore. More... | |
static const uint8_t | DisallowedPPPofTrackAtPCP [TRACK_END][DIAGDIR_END] |
Which pylons can definitely NOT be built. More... | |
static const Track | TracksAtPCP [DIAGDIR_END][NUM_TRACKS_AT_PCP] |
static const TileSource | TrackSourceTile [DIAGDIR_END][NUM_TRACKS_AT_PCP] |
static const Direction | PPPorder [DIAGDIR_END][TLG_END][DIR_END] |
static const int8_t | x_pcp_offsets [DIAGDIR_END] = {0, 8, 16, 8} |
static const int8_t | y_pcp_offsets [DIAGDIR_END] = {8, 16, 8, 0} |
static const int8_t | x_ppp_offsets [DIR_END] = {-2, -4, -2, 0, 2, 4, 2, 0} |
static const int8_t | y_ppp_offsets [DIR_END] = {-2, 0, 2, 4, 2, 0, -2, -4} |
static const uint8_t | pylon_sprites [] |
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 | RailCatenarySpriteData [] |
static const SortableSpriteStruct | RailCatenarySpriteData_Depot [] |
static const SortableSpriteStruct | RailCatenarySpriteData_Tunnel [] |
static const RailCatenarySprite | Wires [5][TRACK_END][4] |
Stores all the data for overhead wire and pylon drawing.
Definition in file elrail_data.h.
enum RailCatenarySprite |
Refers to a certain element of the catenary.
Identifiers for Wires:
Identifiers for Pylons:
Definition at line 422 of file elrail_data.h.
enum TLG |
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.
|
static |
Which PPPs are possible at all on a given PCP.
Definition at line 43 of file elrail_data.h.
|
static |
Which pylons can definitely NOT be built.
Definition at line 197 of file elrail_data.h.
|
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.
|
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 55 of file elrail_data.h.
|
static |
Maps a track bit onto two PCP positions.
Definition at line 63 of file elrail_data.h.
|
static |
Definition at line 224 of file elrail_data.h.
|
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 79 of file elrail_data.h.
|
static |
Definition at line 269 of file elrail_data.h.
|
static |
Definition at line 395 of file elrail_data.h.
|
static |
Definition at line 402 of file elrail_data.h.
|
static |
Definition at line 207 of file elrail_data.h.
|
static |
Definition at line 216 of file elrail_data.h.