(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots

This commit is contained in:
tron
2006-06-04 16:04:15 +00:00
parent f1be69c47b
commit 3cb526d0d9
5 changed files with 23 additions and 19 deletions

View File

@@ -113,6 +113,16 @@ static inline DiagDirection AxisToDiagDir(Axis a)
return (DiagDirection)(2 - a);
}
/**
* Convert an axis and a flag for north/south into a DiagDirection
* @param ns north -> 0, south -> 1
*/
static inline DiagDirection XYNSToDiagDir(Axis xy, uint ns)
{
return (DiagDirection)(xy * 3 ^ ns * 2);
}
static inline bool IsValidDiagDirection(DiagDirection d)
{
return d < DIAGDIR_END;