40static const uint NUM_TRACKS_AT_PCP = 6;
72#define PCP_NOT_ON_TRACK 0xFF
112#undef PCP_NOT_ON_TRACK
115#define NUM_IGNORE_GROUPS 3
116#define IGNORE_NONE 0xFF
217 {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME },
218 {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME },
219 {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_HOME , TS_NEIGHBOUR},
220 {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR},
248static const int8_t x_pcp_offsets[
DIAGDIR_END] = {0, 8, 16, 8};
249static const int8_t y_pcp_offsets[
DIAGDIR_END] = {8, 16, 8, 0};
251static const int8_t x_ppp_offsets[
DIR_END] = {-2, -4, -2, 0, 2, 4, 2, 0};
252static const int8_t y_ppp_offsets[
DIR_END] = {-2, 0, 2, 4, 2, 0, -2, -4};
269static const uint8_t pylon_sprites[] = {
318 uint8_t image_offset;
465 INVALID_CATENARY = 0xFF
476 {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH},
477 {INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH},
478 {INVALID_CATENARY, WIRE_EW_N_W, WIRE_EW_N_E, WIRE_EW_N_BOTH},
479 {INVALID_CATENARY, WIRE_EW_S_E, WIRE_EW_S_W, WIRE_EW_S_BOTH},
480 {INVALID_CATENARY, WIRE_NS_W_S, WIRE_NS_W_N, WIRE_NS_W_BOTH},
481 {INVALID_CATENARY, WIRE_NS_E_N, WIRE_NS_E_S, WIRE_NS_E_BOTH},
483 {INVALID_CATENARY, WIRE_X_UP_NE, WIRE_X_UP_SW, WIRE_X_UP_BOTH},
484 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
485 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
486 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
487 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
488 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
490 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
491 {INVALID_CATENARY, WIRE_Y_UP_SE, WIRE_Y_UP_NW, WIRE_Y_UP_BOTH},
492 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
493 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
494 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
495 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
497 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
498 {INVALID_CATENARY, WIRE_Y_DOWN_SE, WIRE_Y_DOWN_NW, WIRE_Y_DOWN_BOTH},
499 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
500 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
501 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
502 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
504 {INVALID_CATENARY, WIRE_X_DOWN_NE, WIRE_X_DOWN_SW, WIRE_X_DOWN_BOTH},
505 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
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},
Direction
Defines the 8 directions on the map.
@ DIR_END
Used to iterate.
DiagDirection
Enumeration for diagonal directions.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
@ DIAGDIR_END
Used for iterations.
PylonSpriteOffset
Offset for pylon sprites from the base pylon sprite.
static const uint ELRAIL_ELEVRAISE
Wires that a draw one level higher than the north corner.
static const uint ELRAIL_ELEVLOWER
Wires that a draw one level lower than the north corner.
RailCatenarySprite
Refers to a certain element of the catenary.
WireSpriteOffset
Offset for wire sprites from the base wire sprite.
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 whic...
static const uint8_t OwnedPPPonPCP[DIAGDIR_END]
Which of the PPPs are inside the tile.
static const uint8_t PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END]
Preferred points of each trackbit.
static const uint8_t DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END]
Which pylons can definitely NOT be built.
static const uint8_t AllowedPPPonPCP[DIAGDIR_END]
Which PPPs are possible at all on a given PCP.
static const DiagDirection PCPpositions[TRACK_END][2]
Maps a track bit onto two PCP positions.
TileSource
When determining the pylon configuration on the edge, two tiles are taken into account: the tile bein...
static const uint ELRAIL_ELEVATION
Distance between wire and rail.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in ZOOM_BASE.
Track
These are used to specify a single track.
@ 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)