summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-03-30 19:16:44 +0000
committerbelugas <belugas@openttd.org>2006-03-30 19:16:44 +0000
commit80570009dd802e7403983c7e28670e7debd4c57b (patch)
tree0f080a9a7fe135f94c938d4a6178f9175904cc93 /tile.h
parent756212a71e6910919ef854c0f5d9bb35a1e14001 (diff)
downloadopenttd-80570009dd802e7403983c7e28670e7debd4c57b.tar.xz
(svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/tile.h b/tile.h
index e3a0d45d6..81bb6d0a0 100644
--- a/tile.h
+++ b/tile.h
@@ -20,9 +20,11 @@ typedef enum TileTypes {
MP_UNMOVABLE,
} TileType;
-
-void SetMapExtraBits(TileIndex tile, byte flags);
-uint GetMapExtraBits(TileIndex tile);
+typedef enum TropicZones {
+ TROPICZONE_INVALID = 0,
+ TROPICZONE_DESERT = 1,
+ TROPICZONE_RAINFOREST = 2,
+} TropicZone;
uint GetTileh(uint n, uint w, uint e, uint s, uint *h);
uint GetTileSlope(TileIndex tile, uint *h);
@@ -106,4 +108,27 @@ static inline bool IsTileOwner(TileIndex tile, Owner owner)
return GetTileOwner(tile) == owner;
}
+/**
+ * Set the tropic zone
+ * @param tile the tile to set the zone of
+ * @param type the new type
+ * @pre assert(tile < MapSize());
+ */
+static inline void SetTropicZone(TileIndex tile, TropicZone type)
+{
+ assert(tile < MapSize());
+ SB(_m[tile].extra, 0, 2, type);
+}
+
+/**
+ * Get the tropic zone
+ * @param tile the tile to get the zone of
+ * @pre assert(tile < MapSize());
+ * @return the zone type
+ */
+static inline TropicZone GetTropicZone(TileIndex tile)
+{
+ assert(tile < MapSize());
+ return (TropicZone)GB(_m[tile].extra, 0, 2);
+}
#endif /* TILE_H */