summaryrefslogtreecommitdiff
path: root/src/industrytype.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-03-20 14:30:16 +0000
committerfrosch <frosch@openttd.org>2010-03-20 14:30:16 +0000
commit116a5f56a4c1362446bcf921e4436a19057d105e (patch)
treeeeb12e8765bc1997310546c701043efd81c9b410 /src/industrytype.h
parente27e5febb60f1cd2a2c70b100652c9365d97dbbd (diff)
downloadopenttd-116a5f56a4c1362446bcf921e4436a19057d105e.tar.xz
(svn r19481) -Codechange: Turn _industry_counts into a static member of Industry.
Diffstat (limited to 'src/industrytype.h')
-rw-r--r--src/industrytype.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/industrytype.h b/src/industrytype.h
index c3570d785..f45483634 100644
--- a/src/industrytype.h
+++ b/src/industrytype.h
@@ -204,42 +204,6 @@ static inline IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx)
}
}
-extern uint16 _industry_counts[NUM_INDUSTRYTYPES]; // Number of industries per type ingame
-
-/** Increment the count of industries for this type
- * @param type IndustryType to increment
- * @pre type < INVALID_INDUSTRYTYPE */
-static inline void IncIndustryTypeCount(IndustryType type)
-{
- assert(type < INVALID_INDUSTRYTYPE);
- _industry_counts[type]++;
-}
-
-/** Decrement the count of industries for this type
- * @param type IndustryType to decrement
- * @pre type < INVALID_INDUSTRYTYPE */
-static inline void DecIndustryTypeCount(IndustryType type)
-{
- assert(type < INVALID_INDUSTRYTYPE);
- _industry_counts[type]--;
-}
-
-/** get the count of industries for this type
- * @param type IndustryType to query
- * @pre type < INVALID_INDUSTRYTYPE */
-static inline uint8 GetIndustryTypeCount(IndustryType type)
-{
- assert(type < INVALID_INDUSTRYTYPE);
- return min(_industry_counts[type], 0xFF); // callback expects only a byte, so cut it
-}
-
-/** Resets both the total_industries and the _industry_counts
- * This way, we centralize all counts activities */
-static inline void ResetIndustryCounts()
-{
- memset(&_industry_counts, 0, sizeof(_industry_counts));
-}
-
static const uint8 IT_INVALID = 255;
#endif /* INDUSTRYTYPE_H */