changeset 1854:7a0ce7d2056d draft

(svn r2360) Use GB and SB in [GS]etMapExtraBits
author tron <tron@openttd.org>
date Sun, 22 May 2005 08:09:40 +0000
parents f37c0a881cd8
children d695b1fc8024
files tile.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
 }