mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 09:29:10 +00:00
(svn r2360) Use GB and SB in [GS]etMapExtraBits
This commit is contained in:
5
tile.c
5
tile.c
@@ -4,14 +4,13 @@
|
|||||||
void SetMapExtraBits(TileIndex tile, byte bits)
|
void SetMapExtraBits(TileIndex tile, byte bits)
|
||||||
{
|
{
|
||||||
assert(tile < MapSize());
|
assert(tile < MapSize());
|
||||||
_map_extra_bits[tile >> 2] &= ~(3 << ((tile & 3) * 2));
|
SB(_map_extra_bits[tile >> 2], (tile & 3) * 2, 2, bits & 3);
|
||||||
_map_extra_bits[tile >> 2] |= (bits&3) << ((tile & 3) * 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint GetMapExtraBits(TileIndex tile)
|
uint GetMapExtraBits(TileIndex tile)
|
||||||
{
|
{
|
||||||
assert(tile < MapSize());
|
assert(tile < MapSize());
|
||||||
return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3;
|
return GB(_map_extra_bits[tile >> 2], (tile & 3) * 2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user