(svn r4764) Move some functions from rail.h to rail_map.h
authortron
Sun, 07 May 2006 07:01:48 +0000
changeset 3772 4872d75f5172
parent 3771 b34d07131ad1
child 3773 996897ffc8ea
(svn r4764) Move some functions from rail.h to rail_map.h
rail.h
rail_map.h
--- a/rail.h	Sat May 06 22:55:21 2006 +0000
+++ b/rail.h	Sun May 07 07:01:48 2006 +0000
@@ -178,49 +178,6 @@
 	return _signal_on_track[track];
 }
 
-/*
- * Some functions to query rail tiles
- */
-
-
-/**
- * Checks if a rail tile has signals.
- */
-static inline bool HasSignals(TileIndex tile)
-{
-	return GetRailTileType(tile) == RAIL_TYPE_SIGNALS;
-}
-
-/**
- * Returns the RailTileSubtype of a given rail tile with type
- * RAIL_TYPE_DEPOT_WAYPOINT
- */
-static inline RailTileSubtype GetRailTileSubtype(TileIndex tile)
-{
-	assert(GetRailTileType(tile) == RAIL_TYPE_DEPOT_WAYPOINT);
-	return (RailTileSubtype)(_m[tile].m5 & RAIL_SUBTYPE_MASK);
-}
-
-/**
- * Returns whether this is plain rails, with or without signals. Iow, if this
- * tiles RailTileType is RAIL_TYPE_NORMAL or RAIL_TYPE_SIGNALS.
- */
-static inline bool IsPlainRailTile(TileIndex tile)
-{
-	RailTileType rtt = GetRailTileType(tile);
-	return rtt == RAIL_TYPE_NORMAL || rtt == RAIL_TYPE_SIGNALS;
-}
-
-
-/**
- * Returns whether the given track is present on the given tile. Tile must be
- * a plain rail tile (IsPlainRailTile()).
- */
-static inline bool HasTrack(TileIndex tile, Track track)
-{
-	assert(IsValidTrack(track));
-	return HASBIT(GetTrackBits(tile), track);
-}
 
 /*
  * Functions describing logical relations between Tracks, TrackBits, Trackdirs
--- a/rail_map.h	Sat May 06 22:55:21 2006 +0000
+++ b/rail_map.h	Sun May 07 07:01:48 2006 +0000
@@ -21,6 +21,24 @@
 	return _m[t].m5 & RAIL_TILE_TYPE_MASK;
 }
 
+/**
+ * Returns whether this is plain rails, with or without signals. Iow, if this
+ * tiles RailTileType is RAIL_TYPE_NORMAL or RAIL_TYPE_SIGNALS.
+ */
+static inline bool IsPlainRailTile(TileIndex tile)
+{
+	RailTileType rtt = GetRailTileType(tile);
+	return rtt == RAIL_TYPE_NORMAL || rtt == RAIL_TYPE_SIGNALS;
+}
+
+/**
+ * Checks if a rail tile has signals.
+ */
+static inline bool HasSignals(TileIndex tile)
+{
+	return GetRailTileType(tile) == RAIL_TYPE_SIGNALS;
+}
+
 
 /** These specify the subtype when the main rail type is
  * RAIL_TYPE_DEPOT_WAYPOINT */
@@ -30,6 +48,16 @@
 	RAIL_SUBTYPE_MASK     = 0x3C
 } RailTileSubtype;
 
+/**
+ * Returns the RailTileSubtype of a given rail tile with type
+ * RAIL_TYPE_DEPOT_WAYPOINT
+ */
+static inline RailTileSubtype GetRailTileSubtype(TileIndex tile)
+{
+	assert(GetRailTileType(tile) == RAIL_TYPE_DEPOT_WAYPOINT);
+	return (RailTileSubtype)(_m[tile].m5 & RAIL_SUBTYPE_MASK);
+}
+
 
 typedef enum RailTypes {
 	RAILTYPE_RAIL     = 0,
@@ -118,6 +146,15 @@
 	SB(_m[t].m5, 0, 6, b);
 }
 
+/**
+ * Returns whether the given track is present on the given tile. Tile must be
+ * a plain rail tile (IsPlainRailTile()).
+ */
+static inline bool HasTrack(TileIndex tile, Track track)
+{
+	return HASBIT(GetTrackBits(tile), track);
+}
+
 
 static inline DiagDirection GetRailDepotDirection(TileIndex t)
 {