forked from mirror/OpenTTD
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
This commit is contained in:
@@ -197,6 +197,21 @@ static inline bool IsValidTrackdir(Trackdir trackdir)
|
||||
* TrackdirBits, Direction and DiagDirections.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Find the opposite track to a given track.
|
||||
*
|
||||
* TRACK_LOWER -> TRACK_UPPER and vice versa, likewise for left/right.
|
||||
* TRACK_X is mapped to TRACK_Y and reversed.
|
||||
*
|
||||
* @param t the track to convert
|
||||
* @return the opposite track
|
||||
*/
|
||||
static inline Track TrackToOppositeTrack(Track t)
|
||||
{
|
||||
assert(t != INVALID_TRACK);
|
||||
return (Track)(t ^ 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps a trackdir to the reverse trackdir.
|
||||
*
|
||||
|
Reference in New Issue
Block a user