summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-19 09:15:16 +0000
committertron <tron@openttd.org>2006-06-19 09:15:16 +0000
commit072312b538efc9cd70d87f09e4b20f8ceca5090d (patch)
tree4a678acd6c78c178da7b9e33fc712bb04b2c74de
parentbefc6accba2a7bfce4aa6e36c75b12bbb12b04ea (diff)
downloadopenttd-072312b538efc9cd70d87f09e4b20f8ceca5090d.tar.xz
(svn r5313) Move IsRailWaypoint() to rail_map.h and remove unused enum
-rw-r--r--rail_map.h8
-rw-r--r--waypoint.h9
2 files changed, 8 insertions, 9 deletions
diff --git a/rail_map.h b/rail_map.h
index bf32f5030..67973b9fb 100644
--- a/rail_map.h
+++ b/rail_map.h
@@ -60,6 +60,14 @@ static inline RailTileSubtype GetRailTileSubtype(TileIndex tile)
}
+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);
diff --git a/waypoint.h b/waypoint.h
index d32c85a18..207b46027 100644
--- a/waypoint.h
+++ b/waypoint.h
@@ -24,11 +24,6 @@ struct Waypoint {
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 @@ static inline bool IsWaypointIndex(uint index)
#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