diff options
author | tron <tron@openttd.org> | 2005-01-16 14:50:01 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-16 14:50:01 +0000 |
commit | 27057ae4b0757e15b38a5327c1229084ad29a38c (patch) | |
tree | 187e8c5437b91c17d0f652b2f0d01e30fbd131b4 /landscape.c | |
parent | 07647737d5d52cb548662ffbec4eca3514090b18 (diff) | |
download | openttd-27057ae4b0757e15b38a5327c1229084ad29a38c.tar.xz |
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
Replace some direct references to _map_type_and_height with TileHeight()/IsTileType()
Diffstat (limited to 'landscape.c')
-rw-r--r-- | landscape.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/landscape.c b/landscape.c index c40dd4c1a..1a490a897 100644 --- a/landscape.c +++ b/landscape.c @@ -53,12 +53,12 @@ uint GetTileSlope(uint tile, int *h) assert(tile < MapSize() && TileX(tile) != MapMaxX() && TileY(tile) != MapMaxY()); - min = a = _map_type_and_height[tile] & 0xF; - b = _map_type_and_height[tile+TILE_XY(1,0)] & 0xF; + min = a = TileHeight(tile); + b = TileHeight(tile + TILE_XY(1,0)); if (min >= b) min = b; - c = _map_type_and_height[tile+TILE_XY(0,1)] & 0xF; + c = TileHeight(tile + TILE_XY(0,1)); if (min >= c) min = c; - d = _map_type_and_height[tile+TILE_XY(1,1)] & 0xF; + d = TileHeight(tile + TILE_XY(1,1)); if (min >= d) min = d; r = 0; @@ -634,14 +634,13 @@ static void CreateDesertOrRainForest() { uint tile; const TileIndexDiffC *data; - byte mt; int i; for (tile = 0; tile != MapSize(); ++tile) { for (data = _make_desert_or_rainforest_data; data != endof(_make_desert_or_rainforest_data); ++data) { - mt = _map_type_and_height[TILE_MASK(tile + ToTileIndexDiff(*data))]; - if ((mt & 0xf) >= 4 || (mt >> 4) == MP_WATER) break; + TileIndex t = tile + ToTileIndexDiff(*data); + if (TileHeight(t) >= 4 || IsTileType(t, MP_WATER)) break; } if (data == endof(_make_desert_or_rainforest_data)) SetMapExtraBits(tile, 1); |