src/table/elrail_data.h
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 5726 8f399788f6c9
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
     5 #ifndef ELRAIL_DATA_H
     5 #ifndef ELRAIL_DATA_H
     6 #define ELRAIL_DATA_H
     6 #define ELRAIL_DATA_H
     7 
     7 
     8 /** Tile Location group.
     8 /** Tile Location group.
     9  * This defines whether the X and or Y coordinate of a tile is even */
     9  * This defines whether the X and or Y coordinate of a tile is even */
    10 typedef enum TLG {
    10 enum TLG {
    11 	XEVEN_YEVEN = 0,
    11 	XEVEN_YEVEN = 0,
    12 	XEVEN_YODD  = 1,
    12 	XEVEN_YODD  = 1,
    13 	XODD_YEVEN  = 2,
    13 	XODD_YEVEN  = 2,
    14 	XODD_YODD   = 3,
    14 	XODD_YODD   = 3,
    15 	TLG_END
    15 	TLG_END
    16 } TLG;
    16 };
    17 
    17 
    18 /** When determining the pylon configuration on the edge, two tiles are taken
    18 /** When determining the pylon configuration on the edge, two tiles are taken
    19  * into account: the tile being drawn itself (the home tile, the one in
    19  * into account: the tile being drawn itself (the home tile, the one in
    20  * ti->tile), and the neighbouring tile */
    20  * ti->tile), and the neighbouring tile */
    21 typedef enum {
    21 enum TileSource {
    22 	TS_HOME      = 0,
    22 	TS_HOME      = 0,
    23 	TS_NEIGHBOUR = 1,
    23 	TS_NEIGHBOUR = 1,
    24 
    24 
    25 	TS_END
    25 	TS_END
    26 } TileSource;
    26 };
    27 
    27 
    28 enum {
    28 enum {
    29 	NUM_TRACKS_AT_PCP = 6
    29 	NUM_TRACKS_AT_PCP = 6
    30 };
    30 };
    31 
    31 
   251 	SPR_PYLON_X_SE,
   251 	SPR_PYLON_X_SE,
   252 	SPR_PYLON_Y_NE,
   252 	SPR_PYLON_Y_NE,
   253 	SPR_PYLON_Y_SW
   253 	SPR_PYLON_Y_SW
   254 };
   254 };
   255 
   255 
   256 typedef struct {
   256 struct SortableSpriteStruct {
   257 	SpriteID image;
   257 	SpriteID image;
   258 	int8 x_offset;
   258 	int8 x_offset;
   259 	int8 y_offset;
   259 	int8 y_offset;
   260 	int8 x_size;
   260 	int8 x_size;
   261 	int8 y_size;
   261 	int8 y_size;
   262 	int8 z_size;
   262 	int8 z_size;
   263 	int8 z_offset;
   263 	int8 z_offset;
   264 } SortableSpriteStruct;
   264 };
   265 
   265 
   266 enum {
   266 enum {
   267 	/** Distance between wire and rail */
   267 	/** Distance between wire and rail */
   268 	ELRAIL_ELEVATION = 8,
   268 	ELRAIL_ELEVATION = 8,
   269 	/** Corrects an off-by-one error in some places (tileh 12 and 9) (TODO -- find source of error) */
   269 	/** Corrects an off-by-one error in some places (tileh 12 and 9) (TODO -- find source of error) */
   337 	{ SPR_WIRE_DEPOT_NE,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for NE depot exit
   337 	{ SPR_WIRE_DEPOT_NE,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for NE depot exit
   338 	{ SPR_WIRE_DEPOT_SE,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }, //! Wire for SE depot exit
   338 	{ SPR_WIRE_DEPOT_SE,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }, //! Wire for SE depot exit
   339 	{ SPR_WIRE_DEPOT_SW,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for SW depot exit
   339 	{ SPR_WIRE_DEPOT_SW,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for SW depot exit
   340 	{ SPR_WIRE_DEPOT_NW,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }  //! Wire for NW depot exit
   340 	{ SPR_WIRE_DEPOT_NW,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }  //! Wire for NW depot exit
   341 };
   341 };
       
   342 
       
   343 static const SortableSpriteStruct CatenarySpriteData_Tunnel[] = {
       
   344 	{ SPR_WIRE_TUNNEL_NE,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for NE tunnel exit
       
   345 	{ SPR_WIRE_TUNNEL_SE,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }, //! Wire for SE tunnel exit
       
   346 	{ SPR_WIRE_TUNNEL_SW,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for SW tunnel exit
       
   347 	{ SPR_WIRE_TUNNEL_NW,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }  //! Wire for NW tunnel exit
       
   348 };
       
   349 
   342 
   350 
   343 /** Refers to a certain element of the catenary.
   351 /** Refers to a certain element of the catenary.
   344  * Identifiers for Wires:
   352  * Identifiers for Wires:
   345  * <ol><li>Direction of the wire</li>
   353  * <ol><li>Direction of the wire</li>
   346  * <li>Slope of the tile for diagonals, placement inside the track for horiz/vertical pieces</li>
   354  * <li>Slope of the tile for diagonals, placement inside the track for horiz/vertical pieces</li>
   349  * <ol><li>Direction of the wire</li>
   357  * <ol><li>Direction of the wire</li>
   350  * <li>Slope of the tile</li>
   358  * <li>Slope of the tile</li>
   351  * <li>Position of the Pylon relative to the track</li>
   359  * <li>Position of the Pylon relative to the track</li>
   352  * <li>Position of the Pylon inside the tile</li></ol>
   360  * <li>Position of the Pylon inside the tile</li></ol>
   353  */
   361  */
   354 typedef enum {
   362 enum CatenarySprite {
   355 	WIRE_X_FLAT_SW,
   363 	WIRE_X_FLAT_SW,
   356 	WIRE_X_FLAT_NE,
   364 	WIRE_X_FLAT_NE,
   357 	WIRE_X_FLAT_BOTH,
   365 	WIRE_X_FLAT_BOTH,
   358 
   366 
   359 	WIRE_X_UP_SW,
   367 	WIRE_X_UP_SW,
   393 
   401 
   394 	WIRE_EW_N_E,
   402 	WIRE_EW_N_E,
   395 	WIRE_EW_S_E,
   403 	WIRE_EW_S_E,
   396 
   404 
   397 	INVALID_CATENARY = 0xFF
   405 	INVALID_CATENARY = 0xFF
   398 } CatenarySprite;
   406 };
   399 
   407 
   400 /* Selects a Wire (with white and grey ends) depending on whether:
   408 /* Selects a Wire (with white and grey ends) depending on whether:
   401  * a) none (should never happen)
   409  * a) none (should never happen)
   402  * b) the first
   410  * b) the first
   403  * c) the second
   411  * c) the second