(svn r2360) Use GB and SB in [GS]etMapExtraBits
authortron
Sun, 22 May 2005 08:09:40 +0000
changeset 1854 8e246ac3d172
parent 1853 2c2f5699e75f
child 1855 caf6d1396112
(svn r2360) Use GB and SB in [GS]etMapExtraBits
tile.c
--- a/tile.c	Sun May 22 07:43:18 2005 +0000
+++ b/tile.c	Sun May 22 08:09:40 2005 +0000
@@ -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);
 }