summaryrefslogtreecommitdiff
path: root/tile.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-05-22 08:09:40 +0000
committertron <tron@openttd.org>2005-05-22 08:09:40 +0000
commit7d32f912a9d6143d7f832f0ab580cd009095d08d (patch)
treecd2a77b6f37a302a2bd85733b7e1597f5a700f78 /tile.c
parent2b16445f268b2db364e34a7dd6604e2f648a6bd4 (diff)
downloadopenttd-7d32f912a9d6143d7f832f0ab580cd009095d08d.tar.xz
(svn r2360) Use GB and SB in [GS]etMapExtraBits
Diffstat (limited to 'tile.c')
-rw-r--r--tile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tile.c b/tile.c
index f7f79ea84..cc54d1374 100644
--- a/tile.c
+++ b/tile.c
@@ -4,14 +4,13 @@
void SetMapExtraBits(TileIndex tile, byte bits)
{
assert(tile < MapSize());
- _map_extra_bits[tile >> 2] &= ~(3 << ((tile & 3) * 2));
- _map_extra_bits[tile >> 2] |= (bits&3) << ((tile & 3) * 2);
+ SB(_map_extra_bits[tile >> 2], (tile & 3) * 2, 2, bits & 3);
}
uint GetMapExtraBits(TileIndex tile)
{
assert(tile < MapSize());
- return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3;
+ return GB(_map_extra_bits[tile >> 2], (tile & 3) * 2, 2);
}