summaryrefslogtreecommitdiff
path: root/depot.h
diff options
context:
space:
mode:
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