tile.h
author belugas
Thu, 30 Mar 2006 19:16:44 +0000
changeset 3379 ea8aa9e71328
parent 3279 7c642c5c501c
child 3636 d87b21df2944
permissions -rw-r--r--
(svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2125
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2125
diff changeset
     2
1209
a1ac96655b79 (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
tron
parents: 1202
diff changeset
     3
#ifndef TILE_H
a1ac96655b79 (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
tron
parents: 1202
diff changeset
     4
#define TILE_H
926
bd4312619522 (svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents: 909
diff changeset
     5
1394
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
     6
#include "macros.h"
1209
a1ac96655b79 (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
tron
parents: 1202
diff changeset
     7
#include "map.h"
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
     8
1944
012fa5e69118 (svn r2450) * Codechange: Replaced all uses of the arrays in tile.h with calls to the associated wrapper functions.
matthijs
parents: 1942
diff changeset
     9
typedef enum TileTypes {
1214
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    10
	MP_CLEAR,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    11
	MP_RAILWAY,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    12
	MP_STREET,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    13
	MP_HOUSE,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    14
	MP_TREES,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    15
	MP_STATION,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    16
	MP_WATER,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    17
	MP_VOID, // invisible tiles at the SW and SE border
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    18
	MP_INDUSTRY,
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    19
	MP_TUNNELBRIDGE,
2125
3098398bf7ff (svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
ludde
parents: 2085
diff changeset
    20
	MP_UNMOVABLE,
1214
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    21
} TileType;
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    22
3379
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
    23
typedef enum TropicZones {
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
    24
	TROPICZONE_INVALID = 0,
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
    25
	TROPICZONE_DESERT = 1,
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
    26
	TROPICZONE_RAINFOREST = 2,
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
    27
} TropicZone;
1211
6f2f723e5c36 (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents: 1209
diff changeset
    28
3279
7c642c5c501c (svn r3992) -Fix: Rewrote the code to determine whether a rail-tile can be terraformed.
celestar
parents: 3184
diff changeset
    29
uint GetTileh(uint n, uint w, uint e, uint s, uint *h);
1335
a635854c23b6 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
tron
parents: 1333
diff changeset
    30
uint GetTileSlope(TileIndex tile, uint *h);
a635854c23b6 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
tron
parents: 1333
diff changeset
    31
uint GetTileZ(TileIndex tile);
a635854c23b6 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
tron
parents: 1333
diff changeset
    32
1394
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    33
static inline bool CorrectZ(uint tileh)
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    34
{
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    35
	/* tile height must be corrected if the north corner is not raised, but
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    36
	 * any other corner is. These are the cases 1 till 7 */
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    37
	return IS_INT_INSIDE(tileh, 1, 8);
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    38
}
449e84bdc04e (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents: 1335
diff changeset
    39
1044
9b73df700a7c (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents: 1041
diff changeset
    40
static inline uint TileHeight(TileIndex tile)
9b73df700a7c (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents: 1041
diff changeset
    41
{
9b73df700a7c (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents: 1041
diff changeset
    42
	assert(tile < MapSize());
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 1967
diff changeset
    43
	return GB(_m[tile].type_height, 0, 4);
1044
9b73df700a7c (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents: 1041
diff changeset
    44
}
9b73df700a7c (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents: 1041
diff changeset
    45
2085
ae9e92ffe168 (svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
celestar
parents: 2049
diff changeset
    46
static inline bool IsSteepTileh(uint tileh)
ae9e92ffe168 (svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
celestar
parents: 2049
diff changeset
    47
{
ae9e92ffe168 (svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
celestar
parents: 2049
diff changeset
    48
	return (tileh & 0x10);
ae9e92ffe168 (svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
celestar
parents: 2049
diff changeset
    49
}
ae9e92ffe168 (svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
celestar
parents: 2049
diff changeset
    50
1059
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    51
static inline void SetTileHeight(TileIndex tile, uint height)
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    52
{
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    53
	assert(tile < MapSize());
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    54
	assert(height < 16);
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 1967
diff changeset
    55
	SB(_m[tile].type_height, 0, 4, height);
1059
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    56
}
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    57
1041
be151b7bc909 (svn r1542) Rename TileHeight to TilePixelHeight, because this is what it actually returns
tron
parents: 1035
diff changeset
    58
static inline uint TilePixelHeight(TileIndex tile)
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    59
{
1044
9b73df700a7c (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents: 1041
diff changeset
    60
	return TileHeight(tile) * 8;
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    61
}
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    62
1214
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    63
static inline TileType GetTileType(TileIndex tile)
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    64
{
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    65
	assert(tile < MapSize());
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 1967
diff changeset
    66
	return GB(_m[tile].type_height, 4, 4);
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    67
}
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    68
1214
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    69
static inline void SetTileType(TileIndex tile, TileType type)
1059
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    70
{
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    71
	assert(tile < MapSize());
2900
722c18106949 (svn r3455) * Assert against modifying the outer border of a map into anything but MP_VOID. This might detect a bug that has been there for quite some time, if it hasn't been fixed already.
matthijs
parents: 2493
diff changeset
    72
	/* Allow only MP_VOID to be set to border tiles. This code is put here since
722c18106949 (svn r3455) * Assert against modifying the outer border of a map into anything but MP_VOID. This might detect a bug that has been there for quite some time, if it hasn't been fixed already.
matthijs
parents: 2493
diff changeset
    73
	 * it seems there is a bug that violates this somewhere. (Formely know as
722c18106949 (svn r3455) * Assert against modifying the outer border of a map into anything but MP_VOID. This might detect a bug that has been there for quite some time, if it hasn't been fixed already.
matthijs
parents: 2493
diff changeset
    74
	 * the "old ship pf" bug, which presented a case in which this broke). It
722c18106949 (svn r3455) * Assert against modifying the outer border of a map into anything but MP_VOID. This might detect a bug that has been there for quite some time, if it hasn't been fixed already.
matthijs
parents: 2493
diff changeset
    75
	 * can be removed as soon as  the bug is squashed. */
722c18106949 (svn r3455) * Assert against modifying the outer border of a map into anything but MP_VOID. This might detect a bug that has been there for quite some time, if it hasn't been fixed already.
matthijs
parents: 2493
diff changeset
    76
	assert((TileX(tile) < MapMaxX() && TileY(tile) < MapMaxY()) || type == MP_VOID);
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 1967
diff changeset
    77
	SB(_m[tile].type_height, 4, 4, type);
1059
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    78
}
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1044
diff changeset
    79
1214
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    80
static inline bool IsTileType(TileIndex tile, TileType type)
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    81
{
1214
33e07bbb7779 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents: 1211
diff changeset
    82
	return GetTileType(tile) == type;
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    83
}
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 979
diff changeset
    84
2125
3098398bf7ff (svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
ludde
parents: 2085
diff changeset
    85
1333
9ac74f431ed2 (svn r1837) GetTileOwner returns Owner, not bool
tron
parents: 1330
diff changeset
    86
static inline Owner GetTileOwner(TileIndex tile)
1330
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
    87
{
1333
9ac74f431ed2 (svn r1837) GetTileOwner returns Owner, not bool
tron
parents: 1330
diff changeset
    88
	assert(tile < MapSize());
1898
b9fe2a5b7e13 (svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents: 1852
diff changeset
    89
	assert(!IsTileType(tile, MP_HOUSE));
b9fe2a5b7e13 (svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents: 1852
diff changeset
    90
	assert(!IsTileType(tile, MP_VOID));
b9fe2a5b7e13 (svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents: 1852
diff changeset
    91
	assert(!IsTileType(tile, MP_INDUSTRY));
b9fe2a5b7e13 (svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents: 1852
diff changeset
    92
2360
09e42e4ee139 (svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
tron
parents: 2186
diff changeset
    93
	return _m[tile].m1;
1330
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
    94
}
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
    95
1902
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
    96
static inline void SetTileOwner(TileIndex tile, Owner owner)
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
    97
{
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
    98
	assert(tile < MapSize());
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
    99
	assert(!IsTileType(tile, MP_HOUSE));
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
   100
	assert(!IsTileType(tile, MP_VOID));
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
   101
	assert(!IsTileType(tile, MP_INDUSTRY));
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
   102
2360
09e42e4ee139 (svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
tron
parents: 2186
diff changeset
   103
	_m[tile].m1 = owner;
1902
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
   104
}
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1898
diff changeset
   105
1330
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
   106
static inline bool IsTileOwner(TileIndex tile, Owner owner)
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
   107
{
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
   108
	return GetTileOwner(tile) == owner;
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
   109
}
8a67d04016ce (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents: 1214
diff changeset
   110
3379
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   111
/**
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   112
 * Set the tropic zone
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   113
 * @param tile the tile to set the zone of
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   114
 * @param type the new type
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   115
 * @pre assert(tile < MapSize());
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   116
 */
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   117
static inline void SetTropicZone(TileIndex tile, TropicZone type)
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   118
{
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   119
	assert(tile < MapSize());
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   120
	SB(_m[tile].extra, 0, 2, type);
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   121
}
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   122
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   123
/**
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   124
 * Get the tropic zone
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   125
 * @param tile the tile to get the zone of
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   126
 * @pre assert(tile < MapSize());
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   127
 * @return the zone type
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   128
 */
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   129
static inline TropicZone GetTropicZone(TileIndex tile)
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   130
{
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   131
	assert(tile < MapSize());
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   132
	return (TropicZone)GB(_m[tile].extra, 0, 2);
ea8aa9e71328 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear.
belugas
parents: 3279
diff changeset
   133
}
2436
177cb6a8339f (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2360
diff changeset
   134
#endif /* TILE_H */