diff options
author | tron <tron@openttd.org> | 2006-03-15 07:10:41 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-15 07:10:41 +0000 |
commit | 251242165cdee3f30e148d365b416a6b079dfe33 (patch) | |
tree | c4c8fbce340b1303c9e47db7434fd1b78a01c132 /direction.h | |
parent | decf3c42f8f01a040f03a15158ea50fdeb110738 (diff) | |
download | openttd-251242165cdee3f30e148d365b416a6b079dfe33.tar.xz |
(svn r3877) Add functions to turn a tile into a rail/road bridge ramp/middle part
Diffstat (limited to 'direction.h')
-rw-r--r-- | direction.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/direction.h b/direction.h index 8f29bdd6c..c7a8498f6 100644 --- a/direction.h +++ b/direction.h @@ -102,4 +102,14 @@ static inline Axis DiagDirToAxis(DiagDirection d) return (Axis)(d & 1); } + +/* + * Converts an Axis to a DiagDirection + * Points always in the positive direction, i.e. S[EW] + */ +static inline DiagDirection AxisToDiagDir(Axis a) +{ + return (DiagDirection)(2 - a); +} + #endif |