summaryrefslogtreecommitdiff
path: root/signs.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-10-28 11:43:56 +0000
committertron <tron@openttd.org>2006-10-28 11:43:56 +0000
commit470a054c061bbe8d3ec9160a52f79f6314bfa86a (patch)
tree126e3edad5bbe386cc2ee8a7a851f576cf1053b8 /signs.h
parent18e56bea7fab7b7c3c57fb53265b049d6c08e8a9 (diff)
downloadopenttd-470a054c061bbe8d3ec9160a52f79f6314bfa86a.tar.xz
(svn r6982) Use the pool macros for the Sign pool
Diffstat (limited to 'signs.h')
-rw-r--r--signs.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/signs.h b/signs.h
index 8ae34f52e..bfcf9d95a 100644
--- a/signs.h
+++ b/signs.h
@@ -16,23 +16,7 @@ typedef struct Sign {
SignID index;
} Sign;
-extern MemoryPool _sign_pool;
-
-/**
- * Get the pointer to the sign with index 'index'
- */
-static inline Sign *GetSign(SignID index)
-{
- return (Sign *)GetItemFromPool(&_sign_pool, index);
-}
-
-/**
- * Get the current size of the SignPool
- */
-static inline uint16 GetSignPoolSize(void)
-{
- return _sign_pool.total_items;
-}
+DECLARE_POOL(Sign, Sign, 2, 16000)
static inline SignID GetSignArraySize(void)
{
@@ -65,7 +49,7 @@ static inline void DeleteSign(Sign *si)
si->str = STR_NULL;
}
-#define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1 < GetSignPoolSize()) ? GetSign(ss->index + 1) : NULL) if (IsValidSign(ss))
+#define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1U < GetSignPoolSize()) ? GetSign(ss->index + 1U) : NULL) if (IsValidSign(ss))
#define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0)
VARDEF bool _sign_sort_dirty;