celestar@3355: /* $Id */ celestar@3449: /** @file elrail_data.h Stores all the data for overhead wire and pylon drawing. celestar@3449: @see elrail.c */ celestar@3355: celestar@3355: #ifndef ELRAIL_DATA_H celestar@3355: #define ELRAIL_DATA_H celestar@3355: celestar@3449: /** Tile Location group. celestar@3449: This defines whether the X and or Y coordinate of a tile is even */ celestar@3355: typedef enum TLG { celestar@3355: XEVEN_YEVEN = 0, celestar@3355: XEVEN_YODD = 1, celestar@3355: XODD_YEVEN = 2, celestar@3355: XODD_YODD = 3, celestar@3355: TLG_END celestar@3355: } TLG; celestar@3355: celestar@3449: /** When determining the pylon configuration on the edge, two tiles are taken celestar@3449: into account: the tile being drawn itself (the home tile, the one in celestar@3449: ti->tile), and the neighbouring tile */ celestar@3355: typedef enum { celestar@3355: TS_HOME = 0, celestar@3355: TS_NEIGHBOUR = 1, celestar@3355: celestar@3355: TS_END celestar@3355: } TileSource; celestar@3355: celestar@3355: enum { celestar@3451: NUM_TRACKS_AT_PCP = 6 celestar@3355: }; celestar@3355: celestar@3355: /** Which PPPs are possible at all on a given PCP */ celestar@3355: static byte AllowedPPPonPCP[DIAGDIR_END] = { celestar@3449: 1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW, celestar@3449: 1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W, celestar@3449: 1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW, celestar@3449: 1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W, celestar@3355: }; celestar@3355: celestar@3449: /** Which of the PPPs are inside the tile. For the two PPPs on the tile border celestar@3449: the following system is used: if you rotate the PCP so that it is in the celestar@3449: north, the eastern PPP belongs to the tile. */ celestar@3449: static byte OwnedPPPonPCP[DIAGDIR_END] = { celestar@3449: 1 << DIR_SE | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W, celestar@3449: 1 << DIR_N | 1 << DIR_SW | 1 << DIR_W | 1 << DIR_NW, celestar@3449: 1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_NW, celestar@3449: 1 << DIR_NE | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S celestar@3449: }; celestar@3449: celestar@3449: /** Maps a track bit onto two PCP positions */ celestar@3449: static const DiagDirection PCPpositions[TRACK_END][2] = { celestar@3449: {DIAGDIR_NE, DIAGDIR_SW}, /* X */ celestar@3449: {DIAGDIR_SE, DIAGDIR_NW}, /* Y */ celestar@3449: {DIAGDIR_NW, DIAGDIR_NE}, /* UPPER */ celestar@3449: {DIAGDIR_SE, DIAGDIR_SW}, /* LOWER */ celestar@3449: {DIAGDIR_SW, DIAGDIR_NW}, /* LEFT */ celestar@3449: {DIAGDIR_NE, DIAGDIR_SE}, /* RIGHT */ celestar@3449: }; celestar@3449: celestar@3449: #define PCP_NOT_ON_TRACK 0xFF celestar@3449: /** Preferred points of each trackbit. Those are the ones perpendicular to the celestar@3449: track, plus the point in extension of the track (to mark end-of-track). PCPs celestar@3449: which are not on either end of the track are fully preferred. celestar@3449: @see PCPpositions */ celestar@3451: static byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = { celestar@3449: { /* X */ celestar@3449: 1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, /* NE */ celestar@3449: PCP_NOT_ON_TRACK, /* SE */ celestar@3449: 1 << DIR_SE | 1 << DIR_SW | 1 << DIR_NW, /* SW */ celestar@3449: PCP_NOT_ON_TRACK /* NE */ celestar@3449: }, { /* Y */ celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: 1 << DIR_NE | 1 << DIR_SE | 1 << DIR_SW, celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: 1 << DIR_SW | 1 << DIR_NW | 1 << DIR_NE celestar@3449: }, { /* UPPER */ celestar@3449: 1 << DIR_E | 1 << DIR_N | 1 << DIR_S, celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: 1 << DIR_W | 1 << DIR_N | 1 << DIR_S celestar@3449: }, { /* LOWER */ celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: 1 << DIR_E | 1 << DIR_N | 1 << DIR_S, celestar@3449: 1 << DIR_W | 1 << DIR_N | 1 << DIR_S, celestar@3449: PCP_NOT_ON_TRACK celestar@3449: }, { /* LEFT */ celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: 1 << DIR_S | 1 << DIR_E | 1 << DIR_W, celestar@3449: 1 << DIR_N | 1 << DIR_E | 1 << DIR_W celestar@3449: }, { /* RIGHT */ celestar@3449: 1 << DIR_N | 1 << DIR_E | 1 << DIR_W, celestar@3449: 1 << DIR_S | 1 << DIR_E | 1 << DIR_W, celestar@3449: PCP_NOT_ON_TRACK, celestar@3449: PCP_NOT_ON_TRACK celestar@3449: } celestar@3355: }; celestar@3449: #undef PCP_NOT_ON_TRACK celestar@3355: celestar@3450: celestar@3355: #define NUM_IGNORE_GROUPS 3 celestar@3450: #define IGNORE_NONE 0xFF celestar@3449: /** In case we have a staight line, we place pylon only every two tiles, celestar@3449: so there are certain tiles which we ignore. A straight line is found if celestar@3450: we have exactly two PPPs. */ celestar@3355: static byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = { celestar@3450: { /* Ignore group 1, X and Y tracks */ celestar@3449: { /* X even, Y even */ celestar@3450: IGNORE_NONE, celestar@3449: 1 << DIR_NE | 1 << DIR_SW, celestar@3449: 1 << DIR_NW | 1 << DIR_SE, celestar@3450: IGNORE_NONE celestar@3449: }, { /* X even, Y odd */ celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE, celestar@3449: 1 << DIR_NW | 1 << DIR_SE, celestar@3449: 1 << DIR_NE | 1 << DIR_SW celestar@3449: }, { /* X odd, Y even */ celestar@3449: 1 << DIR_NW | 1 << DIR_SE, celestar@3449: 1 << DIR_NE | 1 << DIR_SW, celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE celestar@3449: }, { /* X odd, Y odd */ celestar@3449: 1 << DIR_NW | 1 << DIR_SE, celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE, celestar@3449: 1 << DIR_NE | 1 << DIR_SW celestar@3449: } celestar@3355: }, celestar@3450: { /* Ignore group 2, LEFT and RIGHT tracks */ celestar@3449: { celestar@3449: 1 << DIR_E | 1 << DIR_W, celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE, celestar@3449: 1 << DIR_E | 1 << DIR_W celestar@3449: }, { celestar@3450: IGNORE_NONE, celestar@3450: 1 << DIR_E | 1 << DIR_W, celestar@3450: 1 << DIR_E | 1 << DIR_W, celestar@3450: IGNORE_NONE celestar@3450: }, { celestar@3450: IGNORE_NONE, celestar@3450: 1 << DIR_E | 1 << DIR_W, celestar@3450: 1 << DIR_E | 1 << DIR_W, celestar@3450: IGNORE_NONE celestar@3450: }, { celestar@3450: 1 << DIR_E | 1 << DIR_W, celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE, celestar@3450: 1 << DIR_E | 1 << DIR_W celestar@3450: } celestar@3450: }, celestar@3450: { /* Ignore group 3, UPPER and LOWER tracks */ celestar@3450: { celestar@3450: 1 << DIR_N | 1 << DIR_S, celestar@3450: 1 << DIR_N | 1 << DIR_S, celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE celestar@3450: }, { celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE, celestar@3449: 1 << DIR_N | 1 << DIR_S, celestar@3449: 1 << DIR_N | 1 << DIR_S celestar@3449: }, { celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE, celestar@3450: 1 << DIR_N | 1 << DIR_S , celestar@3449: 1 << DIR_N | 1 << DIR_S celestar@3449: }, { celestar@3449: 1 << DIR_N | 1 << DIR_S, celestar@3449: 1 << DIR_N | 1 << DIR_S, celestar@3450: IGNORE_NONE, celestar@3450: IGNORE_NONE celestar@3449: } celestar@3355: } celestar@3355: }; celestar@3355: celestar@3449: #undef NO_IGNORE celestar@3449: celestar@3355: /** Which pylons can definately NOT be built */ celestar@3451: static byte DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = { celestar@3355: {1 << DIR_SW | 1 << DIR_NE, 0, 1 << DIR_SW | 1 << DIR_NE, 0 }, /* X */ celestar@3355: {0, 1 << DIR_NW | 1 << DIR_SE, 0, 1 << DIR_NW | 1 << DIR_SE}, /* Y */ celestar@3355: {1 << DIR_W | 1 << DIR_E, 0, 0, 1 << DIR_W | 1 << DIR_E }, /* UPPER */ celestar@3355: {0, 1 << DIR_W | 1 << DIR_E, 1 << DIR_W | 1 << DIR_E, 0 }, /* LOWER */ celestar@3355: {0, 0, 1 << DIR_S | 1 << DIR_N, 1 << DIR_N | 1 << DIR_S }, /* LEFT */ celestar@3355: {1 << DIR_S | 1 << DIR_N, 1 << DIR_S | 1 << DIR_N, 0, 0, }, /* RIGHT */ celestar@3355: }; celestar@3355: celestar@3449: /* This array stores which track bits can meet at a tile edge */ celestar@3451: static const Track TracksAtPCP[DIAGDIR_END][NUM_TRACKS_AT_PCP] = { celestar@3449: {TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, celestar@3449: {TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, celestar@3449: {TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, celestar@3449: {TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, celestar@3449: }; celestar@3449: celestar@3451: /* takes each of the 6 track bits from the array above and celestar@3449: assigns it to the home tile or neighbour tile */ celestar@3451: static const TileSource TrackSourceTile[DIAGDIR_END][NUM_TRACKS_AT_PCP] = { celestar@3449: {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME }, celestar@3449: {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME }, celestar@3449: {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_HOME , TS_NEIGHBOUR}, celestar@3449: {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR}, celestar@3449: }; celestar@3449: celestar@3449: /* Several PPPs maybe exist, here they are sorted in order of preference. */ celestar@3449: static const Direction PPPorder[DIAGDIR_END][TLG_END][DIR_END] = { /* X - Y */ celestar@3449: { /* PCP 0 */ celestar@3449: {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_E, DIR_S, DIR_W}, /* evn - evn */ celestar@3449: {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, /* evn - odd */ celestar@3449: {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_W, DIR_N, DIR_E}, /* odd - evn */ celestar@3449: {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, /* odd - odd */ celestar@3449: }, {/* PCP 1 */ celestar@3449: {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_E, DIR_N, DIR_W}, /* evn - evn */ celestar@3449: {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, /* evn - odd */ celestar@3449: {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_W, DIR_S, DIR_E}, /* odd - evn */ celestar@3449: {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, /* odd - odd */ celestar@3449: }, {/* PCP 2 */ celestar@3449: {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_W, DIR_N, DIR_E}, /* evn - evn */ celestar@3449: {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, /* evn - odd */ celestar@3449: {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_E, DIR_S, DIR_W}, /* odd - evn */ celestar@3449: {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, /* odd - odd */ celestar@3449: }, {/* PCP 3 */ celestar@3449: {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_W, DIR_S, DIR_E}, /* evn - evn */ celestar@3449: {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, /* evn - odd */ celestar@3449: {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_E, DIR_N, DIR_W}, /* odd - evn */ celestar@3449: {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, /* odd - odd */ celestar@3449: } celestar@3449: }; celestar@3449: /* Geometric placement of the PCP relative to the tile origin */ celestar@3449: static const int8 x_pcp_offsets[DIAGDIR_END] = {0, 8, 15, 8}; celestar@3449: static const int8 y_pcp_offsets[DIAGDIR_END] = {8, 15, 8, 0}; celestar@3449: /* Geometric placement of the PPP relative to the PCP*/ celestar@3449: static const int8 x_ppp_offsets[DIR_END] = {-3, -4, -3, 0, +3, +4, +3, 0}; celestar@3449: static const int8 y_ppp_offsets[DIR_END] = {-3, 0, +3, +4, +3, 0, -3, -4}; celestar@3449: /* The type of pylon to draw at each PPP */ celestar@3449: static const SpriteID pylons_normal[] = { celestar@3449: SPR_PYLON_EW_N, celestar@3449: SPR_PYLON_Y_NE, celestar@3449: SPR_PYLON_NS_E, celestar@3449: SPR_PYLON_X_SE, celestar@3449: SPR_PYLON_EW_S, celestar@3449: SPR_PYLON_Y_SW, celestar@3449: SPR_PYLON_NS_W, celestar@3449: SPR_PYLON_X_NW celestar@3449: }; celestar@3449: celestar@3449: static const SpriteID pylons_bridge[] = { celestar@3449: SPR_PYLON_X_NW, celestar@3449: SPR_PYLON_X_SE, celestar@3449: SPR_PYLON_Y_NE, celestar@3449: SPR_PYLON_Y_SW celestar@3449: }; celestar@3449: celestar@3355: typedef struct { celestar@3355: SpriteID image; celestar@3355: int8 x_offset; celestar@3355: int8 y_offset; celestar@3355: int8 x_size; celestar@3355: int8 y_size; celestar@3355: int8 z_size; celestar@3355: int8 z_offset; celestar@3355: } SortableSpriteStruct; celestar@3355: celestar@3355: enum { celestar@3355: /** Distance between wire and rail */ celestar@3355: ELRAIL_ELEVATION = 8, celestar@3355: /** Corrects an off-by-one error in some places (tileh 12 and 9) (TODO -- find source of error) */ celestar@3355: ELRAIL_ELEV_CORR = ELRAIL_ELEVATION + 1, celestar@3355: /** Wires that a draw one level higher than the north corner. */ celestar@3355: ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT celestar@3355: }; celestar@3355: celestar@3355: static const SortableSpriteStruct CatenarySpriteData[] = { celestar@3355: /* X direction */ celestar@3355: /* Flat tiles: */ celestar@3355: /* Wires */ celestar@3355: { SPR_WIRE_X_SW, 0, 8, 16, 1, 1, ELRAIL_ELEVATION }, //! 0: Wire in X direction, pylon on the SW end only celestar@3355: { SPR_WIRE_X_NE, 0, 8, 16, 1, 1, ELRAIL_ELEVATION }, //! 1: Wire in X direction, pylon on the NE end celestar@3355: { SPR_WIRE_X_SHORT, 0, 8, 16, 1, 1, ELRAIL_ELEVATION }, //! 2: Wire in X direction, pylon on both ends celestar@3355: celestar@3355: /* "up" tiles */ celestar@3355: /* Wires */ celestar@3355: { SPR_WIRE_X_SW_UP, 0, 8, 16, 8, 1, ELRAIL_ELEVRAISE }, //! 3: Wire in X pitch up, pylon on the SW end only celestar@3355: { SPR_WIRE_X_NE_UP, 0, 8, 16, 8, 1, ELRAIL_ELEVRAISE }, //! 4: Wire in X pitch up, pylon on the NE end celestar@3355: { SPR_WIRE_X_SHORT_UP, 0, 8, 16, 8, 1, ELRAIL_ELEVRAISE }, //! 5: Wire in X pitch up, pylon on both ends celestar@3355: celestar@3355: /* "down" tiles */ celestar@3355: /* Wires */ celestar@3355: { SPR_WIRE_X_SW_DOWN, 0, 8, 16, 8, 1, ELRAIL_ELEV_CORR }, //! 6: Wire in X pitch down, pylon on the SW end celestar@3355: { SPR_WIRE_X_NE_DOWN, 0, 8, 16, 8, 1, ELRAIL_ELEV_CORR }, //! 7: Wire in X pitch down, pylon on the NE end celestar@3355: { SPR_WIRE_X_SHORT_DOWN, 0, 8, 16, 8, 1, ELRAIL_ELEV_CORR }, //! 8: Wire in X pitch down, pylon on both ends celestar@3355: celestar@3355: celestar@3355: /* Y direction */ celestar@3355: /* Flat tiles: */ celestar@3355: /* Wires */ celestar@3355: { SPR_WIRE_Y_SE, 8, 0, 1, 16, 1, ELRAIL_ELEVATION }, //! 9: Wire in Y direction, pylon on the SE end only celestar@3355: { SPR_WIRE_Y_NW, 8, 0, 1, 16, 1, ELRAIL_ELEVATION }, //!10: Wire in Y direction, pylon on the NW end celestar@3355: { SPR_WIRE_Y_SHORT, 8, 0, 1, 16, 1, ELRAIL_ELEVATION }, //!11: Wire in Y direction, pylon on both ends celestar@3355: celestar@3355: /* "up" tiles */ celestar@3355: /* Wires */ celestar@3355: { SPR_WIRE_Y_SE_UP, 8, 0, 8, 16, 1, ELRAIL_ELEVRAISE }, //!12: Wire in Y pitch up, pylon on the SE end only celestar@3355: { SPR_WIRE_Y_NW_UP, 8, 0, 8, 16, 1, ELRAIL_ELEVRAISE }, //!13: Wire in Y pitch up, pylon on the NW end celestar@3355: { SPR_WIRE_Y_SHORT_UP, 8, 0, 8, 16, 1, ELRAIL_ELEVRAISE }, //!14: Wire in Y pitch up, pylon on both ends celestar@3355: celestar@3355: /* "down" tiles */ celestar@3355: /* Wires */ celestar@3355: { SPR_WIRE_Y_SE_DOWN, 8, 0, 8, 16, 1, ELRAIL_ELEV_CORR }, //!15: Wire in Y pitch down, pylon on the SE end celestar@3355: { SPR_WIRE_Y_NW_DOWN, 8, 0, 8, 16, 1, ELRAIL_ELEV_CORR }, //!16: Wire in Y pitch down, pylon on the NW end celestar@3355: { SPR_WIRE_Y_SHORT_DOWN, 8, 0, 8, 16, 1, ELRAIL_ELEV_CORR }, //!17: Wire in Y pitch down, pylon on both ends celestar@3355: celestar@3355: /* NS Direction */ celestar@3355: { SPR_WIRE_NS_SHORT, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!18: LEFT trackbit wire, pylon on both ends celestar@3355: { SPR_WIRE_NS_SHORT, 0, 8, 8, 8, 1, ELRAIL_ELEVATION }, //!19: RIGHT trackbit wire, pylon on both ends celestar@3355: celestar@3355: { SPR_WIRE_NS_N, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!20: LEFT trackbit wire, pylon on N end celestar@3355: { SPR_WIRE_NS_N, 0, 8, 8, 8, 1, ELRAIL_ELEVATION }, //!21: RIGHT trackbit wire, pylon on N end celestar@3355: celestar@3355: { SPR_WIRE_NS_S, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!22: LEFT trackbit wire, pylon on S end celestar@3355: { SPR_WIRE_NS_S, 0, 8, 8, 8, 1, ELRAIL_ELEVATION }, //!23: RIGHT trackbit wire, pylon on S end celestar@3355: celestar@3355: /* EW Direction */ celestar@3355: { SPR_WIRE_EW_SHORT, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!24: UPPER trackbit wire, pylon on both ends celestar@3355: { SPR_WIRE_EW_SHORT, 16, 8, 8, 8, 1, ELRAIL_ELEVATION }, //!25: LOWER trackbit wire, pylon on both ends celestar@3355: celestar@3355: { SPR_WIRE_EW_W, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!28: UPPER trackbit wire, pylon on both ends celestar@3355: { SPR_WIRE_EW_W, 16, 8, 8, 8, 1, ELRAIL_ELEVATION }, //!29: LOWER trackbit wire, pylon on both ends celestar@3355: celestar@3355: { SPR_WIRE_EW_E, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!32: UPPER trackbit wire, pylon on both ends celestar@3355: { SPR_WIRE_EW_E, 16, 8, 8, 8, 1, ELRAIL_ELEVATION }, //!33: LOWER trackbit wire, pylon on both ends celestar@3355: celestar@3355: /* Depots */ celestar@3355: { SPR_WIRE_DEPOT_SW, 0, 8, 8, 1, 1, ELRAIL_ELEVATION }, //!36: Wire for SW depot exit celestar@3355: { SPR_WIRE_DEPOT_NW, 8, 0, 1, 8, 1, ELRAIL_ELEVATION }, //!37: Wire for NW depot exit celestar@3355: { SPR_WIRE_DEPOT_NE, 0, 8, 8, 1, 1, ELRAIL_ELEVATION }, //!38: Wire for NE depot exit celestar@3355: { SPR_WIRE_DEPOT_SE, 8, 0, 1, 8, 1, ELRAIL_ELEVATION }, //!39: Wire for SE depot exit celestar@3355: }; celestar@3355: celestar@3355: /** Refers to a certain element of the catenary. celestar@3355: * Identifiers for Wires: celestar@3355: *
  1. Direction of the wire
  2. celestar@3355: *
  3. Slope of the tile for diagonals, placement inside the track for horiz/vertical pieces
  4. celestar@3355: *
  5. Place where a pylon shoule be
celestar@3355: * Identifiers for Pylons: celestar@3355: *
  1. Direction of the wire
  2. celestar@3355: *
  3. Slope of the tile
  4. celestar@3355: *
  5. Position of the Pylon relative to the track
  6. celestar@3355: *
  7. Position of the Pylon inside the tile
celestar@3355: */ celestar@3355: typedef enum { celestar@3355: WIRE_X_FLAT_SW, celestar@3355: WIRE_X_FLAT_NE, celestar@3355: WIRE_X_FLAT_BOTH, celestar@3355: celestar@3355: WIRE_X_UP_SW, celestar@3355: WIRE_X_UP_NE, celestar@3355: WIRE_X_UP_BOTH, celestar@3355: celestar@3355: WIRE_X_DOWN_SW, celestar@3355: WIRE_X_DOWN_NE, celestar@3355: WIRE_X_DOWN_BOTH, celestar@3355: celestar@3355: WIRE_Y_FLAT_SE, celestar@3355: WIRE_Y_FLAT_NW, celestar@3355: WIRE_Y_FLAT_BOTH, celestar@3355: celestar@3355: WIRE_Y_UP_SE, celestar@3355: WIRE_Y_UP_NW, celestar@3355: WIRE_Y_UP_BOTH, celestar@3355: celestar@3355: WIRE_Y_DOWN_SE, celestar@3355: WIRE_Y_DOWN_NW, celestar@3355: WIRE_Y_DOWN_BOTH, celestar@3355: celestar@3355: WIRE_NS_W_BOTH, celestar@3355: WIRE_NS_E_BOTH, celestar@3355: celestar@3355: WIRE_NS_W_N, celestar@3355: WIRE_NS_E_N, celestar@3355: celestar@3355: WIRE_NS_W_S, celestar@3355: WIRE_NS_E_S, celestar@3355: celestar@3355: WIRE_EW_N_BOTH, celestar@3355: WIRE_EW_S_BOTH, celestar@3355: celestar@3355: WIRE_EW_N_W, celestar@3355: WIRE_EW_S_W, celestar@3355: celestar@3355: WIRE_EW_N_E, celestar@3355: WIRE_EW_S_E, celestar@3355: celestar@3355: WIRE_DEPOT_SW, celestar@3355: WIRE_DEPOT_NW, celestar@3355: WIRE_DEPOT_NE, celestar@3355: WIRE_DEPOT_SE, celestar@3355: celestar@3355: INVALID_CATENARY = 0xFF celestar@3355: } CatenarySprite; celestar@3355: celestar@3355: /* Selects a Wire (with white and grey ends) depending on whether: celestar@3355: a) none (should never happen) celestar@3355: b) the first celestar@3355: c) the second celestar@3355: d) both celestar@3355: PCP exists.*/ celestar@3355: static const CatenarySprite Wires[5][TRACK_END][4] = { celestar@3355: { /* Tileh == 0 */ celestar@3355: {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH}, celestar@3355: {INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH}, celestar@3355: {INVALID_CATENARY, WIRE_EW_N_W, WIRE_EW_N_E, WIRE_EW_N_BOTH}, celestar@3355: {INVALID_CATENARY, WIRE_EW_S_E, WIRE_EW_S_W, WIRE_EW_S_BOTH}, celestar@3355: {INVALID_CATENARY, WIRE_NS_W_S, WIRE_NS_W_N, WIRE_NS_W_BOTH}, celestar@3355: {INVALID_CATENARY, WIRE_NS_E_N, WIRE_NS_E_S, WIRE_NS_E_BOTH}, celestar@3355: }, { /* Tileh == 3 */ celestar@3355: {INVALID_CATENARY, WIRE_X_UP_NE, WIRE_X_UP_SW, WIRE_X_UP_BOTH}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: }, { /* Tileh == 6 */ celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, WIRE_Y_UP_SE, WIRE_Y_UP_NW, WIRE_Y_UP_BOTH}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: }, { /* Tileh == 9 */ celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, WIRE_Y_DOWN_SE, WIRE_Y_DOWN_NW, WIRE_Y_DOWN_BOTH}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: }, { /* Tileh == 12 */ celestar@3355: {INVALID_CATENARY, WIRE_X_DOWN_NE, WIRE_X_DOWN_SW, WIRE_X_DOWN_BOTH}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY}, celestar@3355: } celestar@3355: }; celestar@3355: celestar@3355: #endif /* ELRAIL_DATA_H */