diff options
author | rubidium <rubidium@openttd.org> | 2008-01-13 13:36:01 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-01-13 13:36:01 +0000 |
commit | 5c4150d304242d224d5974f79d5461ff3090cea3 (patch) | |
tree | ec37405dba3eeb85aaeaa7e2ed2433812d3061d6 /src/town.h | |
parent | b0c34f4d6275a0dc1b8639b5529e37233240f6e2 (diff) | |
download | openttd-5c4150d304242d224d5974f79d5461ff3090cea3.tar.xz |
(svn r11832) -Codechange: get rid of (quite) some VARDEFs.
Diffstat (limited to 'src/town.h')
-rw-r--r-- | src/town.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/town.h b/src/town.h index 16f852a77..c80fa9a13 100644 --- a/src/town.h +++ b/src/town.h @@ -198,7 +198,7 @@ struct HouseSpec { const struct GRFFile *grffile; ///< grf file that introduced this house }; -VARDEF HouseSpec _house_specs[HOUSE_MAX]; +extern HouseSpec _house_specs[HOUSE_MAX]; uint32 GetWorldPopulation(); @@ -239,8 +239,6 @@ enum { bool CheckforTownRating(uint32 flags, Town *t, byte type); -VARDEF const Town** _town_sort; - static inline HouseSpec *GetHouseSpecs(HouseID house_id) { assert(house_id < HOUSE_MAX); @@ -257,8 +255,6 @@ static inline bool IsValidTownID(TownID index) return index < GetTownPoolSize() && GetTown(index)->IsValid(); } -VARDEF uint _total_towns; - static inline TownID GetMaxTownIndex() { /* TODO - This isn't the real content of the function, but @@ -271,6 +267,8 @@ static inline TownID GetMaxTownIndex() static inline uint GetNumTowns() { + extern uint _total_towns; + return _total_towns; } @@ -296,16 +294,17 @@ static inline Town *GetRandomTown() return GetTown(index); } -Town* CalcClosestTownFromTile(TileIndex tile, uint threshold); +Town *CalcClosestTownFromTile(TileIndex tile, uint threshold); #define FOR_ALL_TOWNS_FROM(t, start) for (t = GetTown(start); t != NULL; t = (t->index + 1U < GetTownPoolSize()) ? GetTown(t->index + 1U) : NULL) if (t->IsValid()) #define FOR_ALL_TOWNS(t) FOR_ALL_TOWNS_FROM(t, 0) -VARDEF bool _town_sort_dirty; -VARDEF byte _town_sort_order; +extern bool _town_sort_dirty; +extern byte _town_sort_order; +extern const Town **_town_sort; -VARDEF Town *_cleared_town; -VARDEF int _cleared_town_rating; +extern Town *_cleared_town; +extern int _cleared_town_rating; uint OriginalTileRandomiser(uint x, uint y); void ResetHouses(); |