summaryrefslogtreecommitdiff
path: root/landscape.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-07 17:40:23 +0000
committertron <tron@openttd.org>2005-01-07 17:40:23 +0000
commit35972e68e144030fa04198ba7f47ccc21ae5dfa4 (patch)
treeb4a2b5890976917c6f844cc28c48a6c17d7aa234 /landscape.c
parent7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4 (diff)
downloadopenttd-35972e68e144030fa04198ba7f47ccc21ae5dfa4.tar.xz
(svn r1415) Move TILE_FROM_XY and TILE_XY to map.h and push TILE_[XY] bits from map.h into map.c.
Now the whole source except map.c is independent of TILE_[XY]_BITS!
Diffstat (limited to 'landscape.c')
-rw-r--r--landscape.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/landscape.c b/landscape.c
index 016d45854..fc085deaf 100644
--- a/landscape.c
+++ b/landscape.c
@@ -454,8 +454,8 @@ uint GetMapExtraBits(uint tile)
#define TILELOOP_BITS 4
#define TILELOOP_SIZE (1 << TILELOOP_BITS)
-#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << TILE_X_BITS))
-#define TILELOOP_CHKMASK (((1 << (TILE_X_BITS - TILELOOP_BITS))-1) << TILELOOP_BITS)
+#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << MapLogX()))
+#define TILELOOP_CHKMASK (((1 << (MapLogX() - TILELOOP_BITS))-1) << TILELOOP_BITS)
void RunTileLoop()
{
@@ -538,7 +538,7 @@ static void GenerateTerrain(int type, int flag)
p = GetSpritePtr((((r >> 24) * _genterrain_tbl_1[type]) >> 8) + _genterrain_tbl_2[type] + 4845);
x = r & MapMaxX();
- y = (r >> TILE_X_BITS) & MapMaxY();
+ y = (r >> MapLogX()) & MapMaxY();
if (x < 2 || y < 2)