| author | miham |
| Tue, 09 May 2006 06:56:09 +0000 | |
| changeset 3791 | caa92ffecb02 |
| parent 3773 | 0019b5f70ea9 |
| child 3794 | f72053a38797 |
| permissions | -rw-r--r-- |
| 2186 | 1 |
/* $Id$ */ |
2 |
||
|
1209
2e00193652b2
(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 |
|
2e00193652b2
(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
a6d140a6a4de
(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
79cb56d80a3a
(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
2e00193652b2
(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" |
|
3636
a36cc46e754d
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents:
3379
diff
changeset
|
8 |
#include "slope.h" |
|
1035
812f837ee03f
(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
|
9 |
|
|
1944
dd9cba5fab2a
(svn r2450) * Codechange: Replaced all uses of the arrays in tile.h with calls to the associated wrapper functions.
matthijs
parents:
1942
diff
changeset
|
10 |
typedef enum TileTypes {
|
|
1214
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
11 |
MP_CLEAR, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
12 |
MP_RAILWAY, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
13 |
MP_STREET, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
14 |
MP_HOUSE, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
15 |
MP_TREES, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
16 |
MP_STATION, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
17 |
MP_WATER, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
18 |
MP_VOID, // invisible tiles at the SW and SE border |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
19 |
MP_INDUSTRY, |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
20 |
MP_TUNNELBRIDGE, |
|
2125
edc17858f9f6
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
ludde
parents:
2085
diff
changeset
|
21 |
MP_UNMOVABLE, |
|
1214
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
22 |
} TileType; |
|
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
23 |
|
|
3379
50b253bb9819
(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 |
typedef enum TropicZones {
|
|
50b253bb9819
(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_INVALID = 0, |
|
50b253bb9819
(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_DESERT = 1, |
|
50b253bb9819
(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_RAINFOREST = 2, |
|
50b253bb9819
(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
|
28 |
} TropicZone; |
| 1211 | 29 |
|
|
3636
a36cc46e754d
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents:
3379
diff
changeset
|
30 |
Slope GetTileh(uint n, uint w, uint e, uint s, uint *h); |
|
a36cc46e754d
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents:
3379
diff
changeset
|
31 |
Slope GetTileSlope(TileIndex tile, uint *h); |
|
1335
a5f223b9f549
(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
tron
parents:
1333
diff
changeset
|
32 |
uint GetTileZ(TileIndex tile); |
|
3773
0019b5f70ea9
(svn r4765) Add GetTileMaxZ(), which returns the height of the highest corner of a tile, and use it to simplify the code in a few places
tron
parents:
3636
diff
changeset
|
33 |
uint GetTileMaxZ(TileIndex tile); |
|
1335
a5f223b9f549
(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
tron
parents:
1333
diff
changeset
|
34 |
|
|
3636
a36cc46e754d
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents:
3379
diff
changeset
|
35 |
static inline bool CorrectZ(Slope tileh) |
|
1394
79cb56d80a3a
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents:
1335
diff
changeset
|
36 |
{
|
|
79cb56d80a3a
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents:
1335
diff
changeset
|
37 |
/* tile height must be corrected if the north corner is not raised, but |
|
79cb56d80a3a
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents:
1335
diff
changeset
|
38 |
* any other corner is. These are the cases 1 till 7 */ |
|
79cb56d80a3a
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents:
1335
diff
changeset
|
39 |
return IS_INT_INSIDE(tileh, 1, 8); |
|
79cb56d80a3a
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents:
1335
diff
changeset
|
40 |
} |
|
79cb56d80a3a
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
tron
parents:
1335
diff
changeset
|
41 |
|
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1041
diff
changeset
|
42 |
static inline uint TileHeight(TileIndex tile) |
|
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1041
diff
changeset
|
43 |
{
|
|
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1041
diff
changeset
|
44 |
assert(tile < MapSize()); |
|
2049
538e73c53f54
(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
|
45 |
return GB(_m[tile].type_height, 0, 4); |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1041
diff
changeset
|
46 |
} |
|
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1041
diff
changeset
|
47 |
|
|
1059
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
48 |
static inline void SetTileHeight(TileIndex tile, uint height) |
|
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
49 |
{
|
|
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
50 |
assert(tile < MapSize()); |
|
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
51 |
assert(height < 16); |
|
2049
538e73c53f54
(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
|
52 |
SB(_m[tile].type_height, 0, 4, height); |
|
1059
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
53 |
} |
|
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
54 |
|
|
1041
94db182c3614
(svn r1542) Rename TileHeight to TilePixelHeight, because this is what it actually returns
tron
parents:
1035
diff
changeset
|
55 |
static inline uint TilePixelHeight(TileIndex tile) |
|
1035
812f837ee03f
(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
|
56 |
{
|
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1041
diff
changeset
|
57 |
return TileHeight(tile) * 8; |
|
1035
812f837ee03f
(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
|
58 |
} |
|
812f837ee03f
(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 |
|
|
1214
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
60 |
static inline TileType GetTileType(TileIndex tile) |
|
1035
812f837ee03f
(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 |
{
|
|
812f837ee03f
(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 |
assert(tile < MapSize()); |
|
2049
538e73c53f54
(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
|
63 |
return GB(_m[tile].type_height, 4, 4); |
|
1035
812f837ee03f
(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 |
} |
|
812f837ee03f
(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 |
|
|
1214
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
66 |
static inline void SetTileType(TileIndex tile, TileType type) |
|
1059
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
67 |
{
|
|
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
68 |
assert(tile < MapSize()); |
|
2900
a15ccc6a9b39
(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
|
69 |
/* Allow only MP_VOID to be set to border tiles. This code is put here since |
|
a15ccc6a9b39
(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
|
70 |
* it seems there is a bug that violates this somewhere. (Formely know as |
|
a15ccc6a9b39
(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
|
71 |
* the "old ship pf" bug, which presented a case in which this broke). It |
|
a15ccc6a9b39
(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 |
* can be removed as soon as the bug is squashed. */ |
|
a15ccc6a9b39
(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 |
assert((TileX(tile) < MapMaxX() && TileY(tile) < MapMaxY()) || type == MP_VOID); |
|
2049
538e73c53f54
(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
|
74 |
SB(_m[tile].type_height, 4, 4, type); |
|
1059
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
75 |
} |
|
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
76 |
|
|
1214
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
77 |
static inline bool IsTileType(TileIndex tile, TileType type) |
|
1035
812f837ee03f
(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
|
78 |
{
|
|
1214
8262981ac274
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
tron
parents:
1211
diff
changeset
|
79 |
return GetTileType(tile) == type; |
|
1035
812f837ee03f
(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
|
80 |
} |
|
812f837ee03f
(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 |
|
|
2125
edc17858f9f6
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
ludde
parents:
2085
diff
changeset
|
82 |
|
| 1333 | 83 |
static inline Owner GetTileOwner(TileIndex tile) |
|
1330
5d76a0522a11
(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
|
84 |
{
|
| 1333 | 85 |
assert(tile < MapSize()); |
|
1898
0b84ad3a8c92
(svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents:
1852
diff
changeset
|
86 |
assert(!IsTileType(tile, MP_HOUSE)); |
|
0b84ad3a8c92
(svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents:
1852
diff
changeset
|
87 |
assert(!IsTileType(tile, MP_VOID)); |
|
0b84ad3a8c92
(svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents:
1852
diff
changeset
|
88 |
assert(!IsTileType(tile, MP_INDUSTRY)); |
|
0b84ad3a8c92
(svn r2404) assert that GetTileOwner() isn't called for tiles, which don't store owner information
tron
parents:
1852
diff
changeset
|
89 |
|
|
2360
4e4ebe18e448
(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
|
90 |
return _m[tile].m1; |
|
1330
5d76a0522a11
(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
|
91 |
} |
|
5d76a0522a11
(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
|
92 |
|
| 1902 | 93 |
static inline void SetTileOwner(TileIndex tile, Owner owner) |
94 |
{
|
|
95 |
assert(tile < MapSize()); |
|
96 |
assert(!IsTileType(tile, MP_HOUSE)); |
|
97 |
assert(!IsTileType(tile, MP_VOID)); |
|
98 |
assert(!IsTileType(tile, MP_INDUSTRY)); |
|
99 |
||
|
2360
4e4ebe18e448
(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
|
100 |
_m[tile].m1 = owner; |
| 1902 | 101 |
} |
102 |
||
|
1330
5d76a0522a11
(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
|
103 |
static inline bool IsTileOwner(TileIndex tile, Owner owner) |
|
5d76a0522a11
(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
|
104 |
{
|
|
5d76a0522a11
(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
|
105 |
return GetTileOwner(tile) == owner; |
|
5d76a0522a11
(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 |
} |
|
5d76a0522a11
(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 |
|
|
3379
50b253bb9819
(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
|
108 |
/** |
|
50b253bb9819
(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
|
109 |
* Set the tropic zone |
|
50b253bb9819
(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
|
110 |
* @param tile the tile to set the zone of |
|
50b253bb9819
(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 |
* @param type the new type |
|
50b253bb9819
(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 |
* @pre assert(tile < MapSize()); |
|
50b253bb9819
(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 |
*/ |
|
50b253bb9819
(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 |
static inline void SetTropicZone(TileIndex tile, TropicZone type) |
|
50b253bb9819
(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 |
{
|
|
50b253bb9819
(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 |
assert(tile < MapSize()); |
|
50b253bb9819
(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 |
SB(_m[tile].extra, 0, 2, type); |
|
50b253bb9819
(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 |
} |
|
50b253bb9819
(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 |
|
|
50b253bb9819
(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 |
/** |
|
50b253bb9819
(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 |
* Get the tropic zone |
|
50b253bb9819
(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 |
* @param tile the tile to get the zone of |
|
50b253bb9819
(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 |
* @pre assert(tile < MapSize()); |
|
50b253bb9819
(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 |
* @return the zone type |
|
50b253bb9819
(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 |
*/ |
|
50b253bb9819
(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 |
static inline TropicZone GetTropicZone(TileIndex tile) |
|
50b253bb9819
(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 |
{
|
|
50b253bb9819
(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 |
assert(tile < MapSize()); |
|
50b253bb9819
(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 |
return (TropicZone)GB(_m[tile].extra, 0, 2); |
|
50b253bb9819
(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 |
} |
|
2436
7d5df545bd5d
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2360
diff
changeset
|
131 |
#endif /* TILE_H */ |