forked from mirror/OpenTTD
(svn r12870) -Codechange: remove some magic numbers from u.ship.state handling
This commit is contained in:
@@ -167,6 +167,22 @@ static inline DiagDirection AxisToDiagDir(Axis a)
|
||||
return (DiagDirection)(2 - a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an Axis to a Direction
|
||||
*
|
||||
* This function returns the Direction which
|
||||
* belongs to the axis. As 2 directions are mapped to an axis
|
||||
* this function returns the one which points to south,
|
||||
* either south-west (on X axis) or south-east (on Y axis)
|
||||
*
|
||||
* @param a The axis
|
||||
* @return The direction pointed to south
|
||||
*/
|
||||
static inline Direction AxisToDirection(Axis a)
|
||||
{
|
||||
return (Direction)(5 - 2 * a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an axis and a flag for north/south into a DiagDirection
|
||||
* @param xy axis to convert
|
||||
|
Reference in New Issue
Block a user