src/track_func.h
changeset 9784 a9cc0dff1667
parent 9224 93528d9cb96d
child 9799 c91afc4512fe
--- a/src/track_func.h	Sat Aug 02 19:48:54 2008 +0000
+++ b/src/track_func.h	Sat Aug 02 22:47:20 2008 +0000
@@ -198,6 +198,21 @@
  */
 
 /**
+ * Find the opposite track to a given track.
+ *
+ * TRACK_LOWER -> TRACK_UPPER and vice versa, likewise for left/right.
+ * TRACK_X is mapped to TRACK_Y and reversed.
+ *
+ * @param t the track to convert
+ * @return the opposite track
+ */
+static inline Track TrackToOppositeTrack(Track t)
+{
+	assert(t != INVALID_TRACK);
+	return (Track)(t ^ 1);
+}
+
+/**
  * Maps a trackdir to the reverse trackdir.
  *
  * Returns the reverse trackdir of a Trackdir value. The reverse trackdir