|
@@ -7,13 +7,15 @@
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
|
|
|
/** @file elrail_data.h Stores all the data for overhead wire and pylon drawing.
|
|
|
/**
|
|
|
* @file elrail_data.h Stores all the data for overhead wire and pylon drawing.
|
|
|
* @see elrail.c */
|
|
|
|
|
|
#ifndef ELRAIL_DATA_H
|
|
|
#define ELRAIL_DATA_H
|
|
|
|
|
|
/** Tile Location group.
|
|
|
/**
|
|
|
* Tile Location group.
|
|
|
* This defines whether the X and or Y coordinate of a tile is even */
|
|
|
enum TLG {
|
|
|
XEVEN_YEVEN = 0,
|
|
@@ -23,7 +25,8 @@ enum TLG {
|
|
|
TLG_END
|
|
|
};
|
|
|
|
|
|
/** When determining the pylon configuration on the edge, two tiles are taken
|
|
|
/**
|
|
|
* 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 TileSource {
|
|
@@ -43,7 +46,8 @@ static const byte AllowedPPPonPCP[DIAGDI
|
|
|
1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
|
|
|
};
|
|
|
|
|
|
/** Which of the PPPs are inside the tile. For the two PPPs on the tile border
|
|
|
/**
|
|
|
* 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. */
|
|
|
static const byte OwnedPPPonPCP[DIAGDIR_END] = {
|
|
@@ -64,7 +68,8 @@ static const DiagDirection PCPpositions[
|
|
|
};
|
|
|
|
|
|
#define PCP_NOT_ON_TRACK 0xFF
|
|
|
/** Preferred points of each trackbit. Those are the ones perpendicular to the
|
|
|
/**
|
|
|
* 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.
|
|
|
* @see PCPpositions */
|
|
@@ -106,7 +111,8 @@ static const byte PreferredPPPofTrackAtP
|
|
|
|
|
|
#define NUM_IGNORE_GROUPS 3
|
|
|
#define IGNORE_NONE 0xFF
|
|
|
/** In case we have a staight line, we place pylon only every two tiles,
|
|
|
/**
|
|
|
* In case we have a staight 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. */
|
|
|
static const byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
|
|
@@ -395,7 +401,8 @@ static const SortableSpriteStruct Catena
|
|
|
};
|
|
|
|
|
|
|
|
|
/** Refers to a certain element of the catenary.
|
|
|
/**
|
|
|
* Refers to a certain element of the catenary.
|
|
|
* Identifiers for Wires:
|
|
|
* <ol><li>Direction of the wire</li>
|
|
|
* <li>Slope of the tile for diagonals, placement inside the track for horiz/vertical pieces</li>
|