(svn r13090) -Codechange: add functions for direct conversion from DiagDirection to Track and Trackbits

This commit is contained in:
smatz
2008-05-14 18:31:21 +00:00
parent 56f15b3544
commit ec627dedf8
12 changed files with 63 additions and 32 deletions

View File

@@ -168,6 +168,17 @@ static inline DiagDirection GetRailDepotDirection(TileIndex t)
return (DiagDirection)GB(_m[t].m5, 0, 2);
}
/**
* Returns the track of a depot, ignoring direction
* @pre IsRailDepotTile(t)
* @param t the tile to get the depot track from
* @return the track of the depot
*/
static inline Track GetRailDepotTrack(TileIndex t)
{
return DiagDirToDiagTrack(GetRailDepotDirection(t));
}
/**
* Returns the axis of the waypoint