summaryrefslogtreecommitdiff
path: root/station.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-10-28 11:48:21 +0000
committertron <tron@openttd.org>2006-10-28 11:48:21 +0000
commitf51d2a3311b56f9390c792324430305585644f0d (patch)
tree3ffe678fb18ee1f4bec34159eb8c4eec6d427815 /station.h
parent470a054c061bbe8d3ec9160a52f79f6314bfa86a (diff)
downloadopenttd-f51d2a3311b56f9390c792324430305585644f0d.tar.xz
(svn r6983) Use the pool macros for the Station 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 91d18839e..6edb573d5 100644
--- a/station.h
+++ b/station.h
@@ -142,23 +142,7 @@ void UpdateAllStationVirtCoord(void);
void RebuildStationLists(void);
void ResortStationLists(void);
-extern MemoryPool _station_pool;
-
-/**
- * Get the pointer to the station with index 'index'
- */
-static inline Station *GetStation(StationID index)
-{
- return (Station*)GetItemFromPool(&_station_pool, index);
-}
-
-/**
- * Get the current size of the StationPool
- */
-static inline uint16 GetStationPoolSize(void)
-{
- return _station_pool.total_items;
-}
+DECLARE_POOL(Station, Station, 6, 1000)
static inline StationID GetStationArraySize(void)
{
@@ -191,7 +175,7 @@ static inline void DeleteStation(Station *st)
st->xy = 0;
}
-#define FOR_ALL_STATIONS_FROM(st, start) for (st = GetStation(start); st != NULL; st = (st->index + 1 < GetStationPoolSize()) ? GetStation(st->index + 1) : NULL) if (IsValidStation(st))
+#define FOR_ALL_STATIONS_FROM(st, start) for (st = GetStation(start); st != NULL; st = (st->index + 1U < GetStationPoolSize()) ? GetStation(st->index + 1U) : NULL) if (IsValidStation(st))
#define FOR_ALL_STATIONS(st) FOR_ALL_STATIONS_FROM(st, 0)