summaryrefslogtreecommitdiff
path: root/tile.c
blob: f8641ca9858a8c2ee2628e66e0cec00328845dd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "tile.h"

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);
}

uint GetMapExtraBits(TileIndex tile)
{
	assert(tile < MapSize());
	return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3;
}