summaryrefslogtreecommitdiff
path: root/depot.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-10-28 11:02:37 +0000
committertron <tron@openttd.org>2006-10-28 11:02:37 +0000
commited9d744e4105828b1a47743ca4dec5c8cce16e34 (patch)
tree867284b1ee6e2729c4398a93eb06ddd01ac6004c /depot.h
parentfd9e71999b6ac9e55b2a88f3221ab0e660934953 (diff)
downloadopenttd-ed9d744e4105828b1a47743ca4dec5c8cce16e34.tar.xz
(svn r6976) Use the pool macros for the Depot pool
Diffstat (limited to 'depot.h')
-rw-r--r--depot.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/depot.h b/depot.h
index 614a3faba..c3805ef5f 100644
--- a/depot.h
+++ b/depot.h
@@ -17,23 +17,7 @@ struct Depot {
DepotID index;
};
-extern MemoryPool _depot_pool;
-
-/**
- * Get the pointer to the depot with index 'index'
- */
-static inline Depot *GetDepot(DepotID index)
-{
- return (Depot*)GetItemFromPool(&_depot_pool, index);
-}
-
-/**
- * Get the current size of the DepotPool
- */
-static inline uint16 GetDepotPoolSize(void)
-{
- return _depot_pool.total_items;
-}
+DECLARE_POOL(Depot, Depot, 3, 8000);
/**
* Check if a depot really exists.
@@ -58,7 +42,7 @@ static inline void DeleteDepot(Depot *depot)
void ShowDepotWindow(TileIndex tile, byte type);
-#define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1 < GetDepotPoolSize()) ? GetDepot(d->index + 1) : NULL) if (IsValidDepot(d))
+#define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (IsValidDepot(d))
#define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
#define MIN_SERVINT_PERCENT 5