summaryrefslogtreecommitdiff
path: root/rail.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-11 04:49:23 +0000
committertron <tron@openttd.org>2006-04-11 04:49:23 +0000
commitd38964e49ab78612bbf44b876c7da6dee789b377 (patch)
tree62175ff0bb6a140ba8d6ba493f020541ea148b4a /rail.h
parentf1da549c10f8e2d2207f1b6325a86b0210a28b5e (diff)
downloadopenttd-d38964e49ab78612bbf44b876c7da6dee789b377.tar.xz
(svn r4351) Simplify ReverseTrackdir() to use a simple arithmetic operation instead of a table lookup
Diffstat (limited to 'rail.h')
-rw-r--r--rail.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/rail.h b/rail.h
index 8bb0be416..fa95fdd27 100644
--- a/rail.h
+++ b/rail.h
@@ -238,8 +238,7 @@ static inline bool HasTrack(TileIndex tile, Track track)
* Maps a trackdir to the reverse trackdir.
*/
static inline Trackdir ReverseTrackdir(Trackdir trackdir) {
- extern const Trackdir _reverse_trackdir[TRACKDIR_END];
- return _reverse_trackdir[trackdir];
+ return (Trackdir)(trackdir ^ 8);
}
/**