author | rubidium |
Thu, 01 Feb 2007 15:49:12 +0000 | |
changeset 5893 | 7e431a4abebb |
parent 5475 | 2e6990a8c7c4 |
child 6181 | 2d0ac0598453 |
permissions | -rw-r--r-- |
3111
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
2 |
|
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
3 |
#ifndef WATER_MAP_H |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
4 |
#define WATER_MAP_H |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
5 |
|
3402
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
6 |
typedef enum WaterTileType { |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
7 |
WATER_CLEAR, |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
8 |
WATER_COAST, |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
9 |
WATER_LOCK, |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
10 |
WATER_DEPOT, |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
11 |
} WaterTileType; |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
12 |
|
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
13 |
typedef enum DepotPart { |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
14 |
DEPOT_NORTH = 0x80, |
3373
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
15 |
DEPOT_SOUTH = 0x81, |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
16 |
DEPOT_END = 0x84, |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
17 |
} DepotPart; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
18 |
|
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
19 |
typedef enum LockPart { |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
20 |
LOCK_MIDDLE = 0x10, |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
21 |
LOCK_LOWER = 0x14, |
3402
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
22 |
LOCK_UPPER = 0x18, |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
23 |
LOCK_END = 0x1C |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
24 |
} LockPart; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
25 |
|
3402
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
26 |
static inline WaterTileType GetWaterTileType(TileIndex t) |
3373
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
27 |
{ |
3402
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
28 |
if (_m[t].m5 == 0) return WATER_CLEAR; |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
29 |
if (_m[t].m5 == 1) return WATER_COAST; |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
30 |
if (IS_INT_INSIDE(_m[t].m5, LOCK_MIDDLE, LOCK_END)) return WATER_LOCK; |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
31 |
|
3424
4a62cc09fd18
(svn r4251) -Fix: Silence a warning in GetWaterTileType
celestar
parents:
3423
diff
changeset
|
32 |
assert(IS_INT_INSIDE(_m[t].m5, DEPOT_NORTH, DEPOT_END)); |
4a62cc09fd18
(svn r4251) -Fix: Silence a warning in GetWaterTileType
celestar
parents:
3423
diff
changeset
|
33 |
return WATER_DEPOT; |
3402
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
34 |
} |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
35 |
|
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
36 |
static inline bool IsWater(TileIndex t) |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
37 |
{ |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
38 |
return GetWaterTileType(t) == WATER_CLEAR; |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
39 |
} |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
40 |
|
3423
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
41 |
static inline bool IsCoast(TileIndex t) |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
42 |
{ |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
43 |
return GetWaterTileType(t) == WATER_COAST; |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
44 |
} |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
45 |
|
3402
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
46 |
static inline bool IsClearWaterTile(TileIndex t) |
812f9dc4baff
(svn r4212) -Codechange: Add and make use of an accessor that retrieves the type of a water tile. Add an enum describing the different water tiles
celestar
parents:
3373
diff
changeset
|
47 |
{ |
3636
a36cc46e754d
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents:
3425
diff
changeset
|
48 |
return IsTileType(t, MP_WATER) && IsWater(t) && GetTileSlope(t, NULL) == SLOPE_FLAT; |
3373
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
49 |
} |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
50 |
|
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
51 |
static inline TileIndex GetOtherShipDepotTile(TileIndex t) |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
52 |
{ |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
53 |
return t + (HASBIT(_m[t].m5, 0) ? -1 : 1) * (HASBIT(_m[t].m5, 1) ? TileDiffXY(0, 1) : TileDiffXY(1, 0)); |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
54 |
} |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
55 |
|
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
56 |
static inline TileIndex IsShipDepot(TileIndex t) |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
57 |
{ |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
58 |
return IS_INT_INSIDE(_m[t].m5, DEPOT_NORTH, DEPOT_END); |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
59 |
} |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
60 |
|
3423
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
61 |
static inline Axis GetShipDepotAxis(TileIndex t) |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
62 |
{ |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
63 |
return (Axis)GB(_m[t].m5, 1, 1); |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
64 |
} |
dab85d82708b
(svn r4250) -Codechange: Further use of map accessors for water tiles
celestar
parents:
3402
diff
changeset
|
65 |
|
3953
e64bbd8598e2
(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots
tron
parents:
3940
diff
changeset
|
66 |
static inline DiagDirection GetShipDepotDirection(TileIndex t) |
e64bbd8598e2
(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots
tron
parents:
3940
diff
changeset
|
67 |
{ |
e64bbd8598e2
(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots
tron
parents:
3940
diff
changeset
|
68 |
return XYNSToDiagDir(GetShipDepotAxis(t), GB(_m[t].m5, 0, 1)); |
e64bbd8598e2
(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots
tron
parents:
3940
diff
changeset
|
69 |
} |
e64bbd8598e2
(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots
tron
parents:
3940
diff
changeset
|
70 |
|
3373
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
71 |
static inline DiagDirection GetLockDirection(TileIndex t) |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
72 |
{ |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
73 |
return (DiagDirection)GB(_m[t].m5, 0, 2); |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
74 |
} |
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
75 |
|
3425
5411e9c8b6c8
(svn r4252) -Codechange: Make more use of map accessors. water_cmd is now map access free
celestar
parents:
3424
diff
changeset
|
76 |
static inline byte GetSection(TileIndex t) |
5411e9c8b6c8
(svn r4252) -Codechange: Make more use of map accessors. water_cmd is now map access free
celestar
parents:
3424
diff
changeset
|
77 |
{ |
5411e9c8b6c8
(svn r4252) -Codechange: Make more use of map accessors. water_cmd is now map access free
celestar
parents:
3424
diff
changeset
|
78 |
assert(GetWaterTileType(t) == WATER_LOCK || GetWaterTileType(t) == WATER_DEPOT); |
5411e9c8b6c8
(svn r4252) -Codechange: Make more use of map accessors. water_cmd is now map access free
celestar
parents:
3424
diff
changeset
|
79 |
return GB(_m[t].m5, 0, 4); |
5411e9c8b6c8
(svn r4252) -Codechange: Make more use of map accessors. water_cmd is now map access free
celestar
parents:
3424
diff
changeset
|
80 |
} |
5411e9c8b6c8
(svn r4252) -Codechange: Make more use of map accessors. water_cmd is now map access free
celestar
parents:
3424
diff
changeset
|
81 |
|
3373
2838aadd3a28
(svn r4172) -Codechange: Added a few accessors to work with ShipDepots and Locks
celestar
parents:
3372
diff
changeset
|
82 |
|
3111
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
83 |
static inline void MakeWater(TileIndex t) |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
84 |
{ |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
85 |
SetTileType(t, MP_WATER); |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
86 |
SetTileOwner(t, OWNER_WATER); |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
87 |
_m[t].m2 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
88 |
_m[t].m3 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
89 |
_m[t].m4 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
90 |
_m[t].m5 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
91 |
} |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
92 |
|
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
93 |
static inline void MakeShore(TileIndex t) |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
94 |
{ |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
95 |
SetTileType(t, MP_WATER); |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
96 |
SetTileOwner(t, OWNER_WATER); |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
97 |
_m[t].m2 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
98 |
_m[t].m3 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
99 |
_m[t].m4 = 0; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
100 |
_m[t].m5 = 1; |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
101 |
} |
750f37699a13
(svn r3714) Add functions to turn tiles into water and shore tiles
tron
parents:
diff
changeset
|
102 |
|
3940
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
103 |
static inline void MakeCanal(TileIndex t, Owner o) |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
104 |
{ |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
105 |
SetTileType(t, MP_WATER); |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
106 |
SetTileOwner(t, o); |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
107 |
_m[t].m2 = 0; |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
108 |
_m[t].m3 = 0; |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
109 |
_m[t].m4 = 0; |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
110 |
_m[t].m5 = 0; |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
111 |
} |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
112 |
|
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
113 |
static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a) |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
114 |
{ |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
115 |
SetTileType(t, MP_WATER); |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
116 |
SetTileOwner(t, o); |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
117 |
_m[t].m2 = 0; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
118 |
_m[t].m3 = 0; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
119 |
_m[t].m4 = 0; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
120 |
_m[t].m5 = base + a * 2; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
121 |
} |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
122 |
|
3940
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
123 |
static inline void MakeLockTile(TileIndex t, Owner o, byte section) |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
124 |
{ |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
125 |
SetTileType(t, MP_WATER); |
3940
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
126 |
SetTileOwner(t, o); |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
127 |
_m[t].m2 = 0; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
128 |
_m[t].m3 = 0; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
129 |
_m[t].m4 = 0; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
130 |
_m[t].m5 = section; |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
131 |
} |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
132 |
|
3940
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
133 |
static inline void MakeLock(TileIndex t, Owner o, DiagDirection d) |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
134 |
{ |
4559
aa0c13e39840
(svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts
Darkvater
parents:
3953
diff
changeset
|
135 |
TileIndexDiff delta = TileOffsByDiagDir(d); |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
136 |
|
3940
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
137 |
MakeLockTile(t, o, LOCK_MIDDLE + d); |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
138 |
MakeLockTile(t - delta, o, LOCK_LOWER + d); |
8965b9bfaabc
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
peter1138
parents:
3636
diff
changeset
|
139 |
MakeLockTile(t + delta, o, LOCK_UPPER + d); |
3372
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
140 |
} |
f6afa98d5219
(svn r4171) -Codechange: Create map accessor functions for creating ship depots and locks. Make use of them
celestar
parents:
3111
diff
changeset
|
141 |
|
4666
172a0cdf28a6
(svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents:
4559
diff
changeset
|
142 |
#endif /* WATER_MAP_H */ |