summaryrefslogtreecommitdiff
path: root/station.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-10-28 11:51:38 +0000
committertron <tron@openttd.org>2006-10-28 11:51:38 +0000
commit16d8c2fe903bac2c703a774c62015b45720f97b8 (patch)
tree77948ee44c883c50b221db42899cab3cb1ace910 /station.h
parentf5b45492d33627f8a637d25e86a77d181c9f13c7 (diff)
downloadopenttd-16d8c2fe903bac2c703a774c62015b45720f97b8.tar.xz
(svn r6984) Use the pool macros for the RoadStop pool
Diffstat (limited to 'station.h')
-rw-r--r--station.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/station.h b/station.h
index 6edb573d5..c2594f7e8 100644
--- a/station.h
+++ b/station.h
@@ -181,23 +181,7 @@ static inline void DeleteStation(Station *st)
/* Stuff for ROADSTOPS */
-extern MemoryPool _roadstop_pool;
-
-/**
- * Get the pointer to the roadstop with index 'index'
- */
-static inline RoadStop *GetRoadStop(uint index)
-{
- return (RoadStop*)GetItemFromPool(&_roadstop_pool, index);
-}
-
-/**
- * Get the current size of the RoadStoptPool
- */
-static inline uint16 GetRoadStopPoolSize(void)
-{
- return _roadstop_pool.total_items;
-}
+DECLARE_POOL(RoadStop, RoadStop, 5, 2000)
/**
* Check if a RaodStop really exists.
@@ -215,7 +199,7 @@ static inline void DeleteRoadStop(RoadStop *rs)
rs->used = false;
}
-#define FOR_ALL_ROADSTOPS_FROM(rs, start) for (rs = GetRoadStop(start); rs != NULL; rs = (rs->index + 1 < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1) : NULL) if (IsValidRoadStop(rs))
+#define FOR_ALL_ROADSTOPS_FROM(rs, start) for (rs = GetRoadStop(start); rs != NULL; rs = (rs->index + 1U < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1U) : NULL) if (IsValidRoadStop(rs))
#define FOR_ALL_ROADSTOPS(rs) FOR_ALL_ROADSTOPS_FROM(rs, 0)
/* End of stuff for ROADSTOPS */