(svn r5313) Move IsRailWaypoint() to rail_map.h and remove unused enum
authortron
Mon, 19 Jun 2006 09:15:16 +0000
changeset 4044 37822ac6f431
parent 4043 2ef4553a3be2
child 4045 e85dc17faa9f
(svn r5313) Move IsRailWaypoint() to rail_map.h and remove unused enum
rail_map.h
waypoint.h
--- a/rail_map.h	Mon Jun 19 06:49:51 2006 +0000
+++ b/rail_map.h	Mon Jun 19 09:15:16 2006 +0000
@@ -60,6 +60,14 @@
 }
 
 
+static inline bool IsRailWaypoint(TileIndex t)
+{
+	return
+		GetRailTileType(t) == RAIL_TILE_DEPOT_WAYPOINT &&
+		GetRailTileSubtype(t) == RAIL_SUBTYPE_WAYPOINT;
+}
+
+
 static inline RailType GetRailType(TileIndex t)
 {
 	return (RailType)GB(_m[t].m3, 0, 4);
--- a/waypoint.h	Mon Jun 19 06:49:51 2006 +0000
+++ b/waypoint.h	Mon Jun 19 09:15:16 2006 +0000
@@ -24,11 +24,6 @@
 	byte deleted;      ///< Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is deleted.
 };
 
-enum {
-	RAIL_TILE_WAYPOINT = 0xC4,
-	RAIL_WAYPOINT_TRACK_MASK = 1,
-};
-
 extern MemoryPool _waypoint_pool;
 
 /**
@@ -55,10 +50,6 @@
 #define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1 < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1) : NULL)
 #define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)
 
-static inline bool IsRailWaypoint(TileIndex tile)
-{
-	return (_m[tile].m5 & 0xFC) == 0xC4;
-}
 
 /**
  * Fetch a waypoint by tile