tile.c
author truelight
Fri, 04 Feb 2005 13:23:29 +0000
changeset 1279 bc761aad52b3
parent 1213 fc87a2ee4161
child 1335 a5f223b9f549
permissions -rw-r--r--
(svn r1783) -Add: Dynamic vehicles (now up to 64k of vehicles)
1213
fc87a2ee4161 (svn r1717) -Fix: some compilation problems for braindead VS6 and added missing files to project (thx bociusz)
darkvater
parents: 1211
diff changeset
     1
#include "stdafx.h"
1211
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     2
#include "tile.h"
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     3
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     4
void SetMapExtraBits(TileIndex tile, byte bits)
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     5
{
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     6
	assert(tile < MapSize());
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     7
	_map_extra_bits[tile >> 2] &= ~(3 << ((tile & 3) * 2));
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     8
	_map_extra_bits[tile >> 2] |= (bits&3) << ((tile & 3) * 2);
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
     9
}
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
    10
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
    11
uint GetMapExtraBits(TileIndex tile)
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
    12
{
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
    13
	assert(tile < MapSize());
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
    14
	return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3;
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents:
diff changeset
    15
}