Mercurial > hg > openttd
annotate src/unmovable_map.h @ 11294:63f980601558 draft
(svn r15643) -Fix [FS#2711]: be more strict with zeroing unused map array bits
author | smatz <smatz@openttd.org> |
---|---|
date | Sun, 08 Mar 2009 16:10:39 +0000 |
parents | 457ecd1afb4b |
children | bc7926153e19 |
rev | line source |
---|---|
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
2 |
9111
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
8210
diff
changeset
|
3 /** @file unmovable_map.h Map accessors for unmovable tiles. */ |
6423
72ac8bfaa32f
(svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas <belugas@openttd.org>
parents:
6257
diff
changeset
|
4 |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
5 #ifndef UNMOVABLE_MAP_H |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
6 #define UNMOVABLE_MAP_H |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
7 |
8210
2191f47ab047
(svn r11773) -Codechange: move some non-clear-land functions from clear_cmd.cpp to a more correct location.
rubidium <rubidium@openttd.org>
parents:
7954
diff
changeset
|
8 #include "core/bitmath_func.hpp" |
2191f47ab047
(svn r11773) -Codechange: move some non-clear-land functions from clear_cmd.cpp to a more correct location.
rubidium <rubidium@openttd.org>
parents:
7954
diff
changeset
|
9 #include "tile_map.h" |
2191f47ab047
(svn r11773) -Codechange: move some non-clear-land functions from clear_cmd.cpp to a more correct location.
rubidium <rubidium@openttd.org>
parents:
7954
diff
changeset
|
10 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
11 /** Types of unmovable structure */ |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
5587
diff
changeset
|
12 enum UnmovableType { |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
13 UNMOVABLE_TRANSMITTER = 0, ///< The large antenna |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
14 UNMOVABLE_LIGHTHOUSE = 1, ///< The nice lighthouse |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
15 UNMOVABLE_STATUE = 2, ///< Statue in towns |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
16 UNMOVABLE_OWNED_LAND = 3, ///< Owned land 'flag' |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
17 UNMOVABLE_HQ = 4, ///< HeadQuarter of a player |
11052
457ecd1afb4b
(svn r15392) -Codechange: move the spec getter to a place where it's only required, without the use of extern
belugas <belugas@openttd.org>
parents:
10953
diff
changeset
|
18 UNMOVABLE_MAX, |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
5587
diff
changeset
|
19 }; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
20 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
21 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
22 * Gets the UnmovableType of the given unmovable tile |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
23 * @param t the tile to get the type from. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
24 * @pre IsTileType(t, MP_UNMOVABLE) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
25 * @return the type. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
26 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
27 static inline UnmovableType GetUnmovableType(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
28 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
29 assert(IsTileType(t, MP_UNMOVABLE)); |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
30 return (UnmovableType)_m[t].m5; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
31 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
32 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
33 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
34 * Does the given tile have a transmitter? |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
35 * @param t the tile to inspect. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
36 * @return true if and only if the tile has a transmitter. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
37 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
38 static inline bool IsTransmitterTile(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
39 { |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
40 return IsTileType(t, MP_UNMOVABLE) && GetUnmovableType(t) == UNMOVABLE_TRANSMITTER; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
41 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
42 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
43 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
44 * Is this unmovable tile an 'owned land' tile? |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
45 * @param t the tile to inspect. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
46 * @pre IsTileType(t, MP_UNMOVABLE) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
47 * @return true if and only if the tile is an 'owned land' tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
48 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
49 static inline bool IsOwnedLand(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
50 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
51 assert(IsTileType(t, MP_UNMOVABLE)); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
52 return GetUnmovableType(t) == UNMOVABLE_OWNED_LAND; |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
53 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
54 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
55 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
56 * Is the given tile (pre-)owned by someone (the little flags)? |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
57 * @param t the tile to inspect. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
58 * @return true if and only if the tile is an 'owned land' tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
59 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
60 static inline bool IsOwnedLandTile(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
61 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
62 return IsTileType(t, MP_UNMOVABLE) && IsOwnedLand(t); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
63 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
64 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
65 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
66 * Is this unmovable tile a HQ tile? |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
67 * @param t the tile to inspect. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
68 * @pre IsTileType(t, MP_UNMOVABLE) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
69 * @return true if and only if the tile is a HQ tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
70 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
71 static inline bool IsCompanyHQ(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
72 { |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
73 assert(IsTileType(t, MP_UNMOVABLE)); |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
74 return _m[t].m5 == UNMOVABLE_HQ; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
75 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
76 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
77 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
78 * Is this unmovable tile a statue? |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
79 * @param t the tile to inspect. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
80 * @pre IsTileType(t, MP_UNMOVABLE) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
81 * @return true if and only if the tile is a statue. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
82 */ |
6257
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
83 static inline bool IsStatue(TileIndex t) |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
84 { |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
85 assert(IsTileType(t, MP_UNMOVABLE)); |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
86 return GetUnmovableType(t) == UNMOVABLE_STATUE; |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
87 } |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
88 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
89 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
90 * Is the given tile a statue? |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
91 * @param t the tile to inspect. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
92 * @return true if and only if the tile is a statue. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
93 */ |
6257
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
94 static inline bool IsStatueTile(TileIndex t) |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
95 { |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
96 return IsTileType(t, MP_UNMOVABLE) && IsStatue(t); |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
97 } |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
98 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
99 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
100 * Get the town of the given statue tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
101 * @param t the tile of the statue. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
102 * @pre IsStatueTile(t) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
103 * @return the town the given statue is in. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
104 */ |
6257
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
105 static inline TownID GetStatueTownID(TileIndex t) |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
106 { |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
107 assert(IsStatueTile(t)); |
6257
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
108 return _m[t].m2; |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
109 } |
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
110 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
111 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
112 * Get the 'stage' of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
113 * @param t a tile of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
114 * @pre IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
115 * @return the 'stage' of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
116 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
117 static inline byte GetCompanyHQSize(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
118 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
119 assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
120 return GB(_m[t].m3, 2, 3); |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
121 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
122 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
123 /** |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
124 * Set the 'stage' of the HQ. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
125 * @param t a tile of the HQ. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
126 * @param size the actual stage of the HQ |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
127 * @pre IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t) |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
128 */ |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
129 static inline void SetCompanyHQSize(TileIndex t, uint8 size) |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
130 { |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
131 assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
132 SB(_m[t].m3, 2, 3, size); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
133 } |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
134 |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
135 /** |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
136 * Get the 'section' of the HQ. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
137 * The scetion is in fact which side of teh HQ the tile represent |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
138 * @param t a tile of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
139 * @pre IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t) |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
140 * @return the 'section' of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
141 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
142 static inline byte GetCompanyHQSection(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
143 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
144 assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
145 return GB(_m[t].m3, 0, 2); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
146 } |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
147 |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
148 /** |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
149 * Set the 'section' of the HQ. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
150 * @param t a tile of the HQ. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
151 * param section to be set. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
152 * @pre IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t) |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
153 */ |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
154 static inline void SetCompanyHQSection(TileIndex t, uint8 section) |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
155 { |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
156 assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
157 SB(_m[t].m3, 0, 2, section); |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
158 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
159 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
160 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
161 * Enlarge the given HQ to the given size. If the new size |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
162 * is larger than the current size, nothing happens. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
163 * @param t the tile of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
164 * @param size the new size of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
165 * @pre t is the northern tile of the HQ |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
166 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
167 static inline void EnlargeCompanyHQ(TileIndex t, byte size) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
168 { |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
169 assert(GetCompanyHQSection(t) == 0); |
10953
8471fdb63daa
(svn r15292) -Fix(r15290): Incrementing something that is already set to the correct value is a bit of a no-no
belugas <belugas@openttd.org>
parents:
10951
diff
changeset
|
170 assert(size <= 4); |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
171 if (size <= GetCompanyHQSize(t)) return; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
172 |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
173 SetCompanyHQSize(t , size); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
174 SetCompanyHQSize(t + TileDiffXY(0, 1), size); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
175 SetCompanyHQSize(t + TileDiffXY(1, 0), size); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
176 SetCompanyHQSize(t + TileDiffXY(1, 1), size); |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
177 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
178 |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
179 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
180 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
181 * Make an Unmovable tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
182 * @note do not use this function directly. Use one of the other Make* functions. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
183 * @param t the tile to make unmovable. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
184 * @param u the unmovable type of the tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
185 * @param o the new owner of the tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
186 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
187 static inline void MakeUnmovable(TileIndex t, UnmovableType u, Owner o) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
188 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
189 SetTileType(t, MP_UNMOVABLE); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
190 SetTileOwner(t, o); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
191 _m[t].m2 = 0; |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
192 _m[t].m3 = 0; |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
193 _m[t].m4 = 0; |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
194 _m[t].m5 = u; |
11294
63f980601558
(svn r15643) -Fix [FS#2711]: be more strict with zeroing unused map array bits
smatz <smatz@openttd.org>
parents:
11052
diff
changeset
|
195 SB(_m[t].m6, 2, 4, 0); |
63f980601558
(svn r15643) -Fix [FS#2711]: be more strict with zeroing unused map array bits
smatz <smatz@openttd.org>
parents:
11052
diff
changeset
|
196 _me[t].m7 = 0; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
197 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
198 |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
199 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
200 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
201 * Make a transmitter tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
202 * @param t the tile to make a transmitter. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
203 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
204 static inline void MakeTransmitter(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
205 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
206 MakeUnmovable(t, UNMOVABLE_TRANSMITTER, OWNER_NONE); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
207 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
208 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
209 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
210 * Make a lighthouse tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
211 * @param t the tile to make a transmitter. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
212 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
213 static inline void MakeLighthouse(TileIndex t) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
214 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
215 MakeUnmovable(t, UNMOVABLE_LIGHTHOUSE, OWNER_NONE); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
216 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
217 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
218 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
219 * Make a statue tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
220 * @param t the tile to make a statue. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
221 * @param o the owner of the statue. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
222 * @param town_id the town the statue was built in. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
223 */ |
6257
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
224 static inline void MakeStatue(TileIndex t, Owner o, TownID town_id) |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
225 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
226 MakeUnmovable(t, UNMOVABLE_STATUE, o); |
6257
d7d39048e2ee
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
truelight <truelight@openttd.org>
parents:
6248
diff
changeset
|
227 _m[t].m2 = town_id; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
228 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
229 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
230 /** |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
231 * Make an 'owned land' tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
232 * @param t the tile to make an 'owned land' tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
233 * @param o the owner of the land. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
234 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
235 static inline void MakeOwnedLand(TileIndex t, Owner o) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
236 { |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
237 MakeUnmovable(t, UNMOVABLE_OWNED_LAND, o); |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
238 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
239 |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
240 /** |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
241 * Make a HeadQuarter tile after making it an Unmovable |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
242 * @param t the tile to make an HQ. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
243 * @param section the part of the HQ this one will be. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
244 * @param o the new owner of the tile. |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
245 */ |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
246 static inline void MakeUnmovableHQHelper(TileIndex t, uint8 section, Owner o) |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
247 { |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
248 MakeUnmovable(t, UNMOVABLE_HQ, o); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
249 SetCompanyHQSection(t, section); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
250 } |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
251 |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
252 /** |
6489
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
253 * Make an HQ with the give tile as it's northern tile. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
254 * @param t the tile to make the northern tile of a HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
255 * @param o the owner of the HQ. |
5459e8d2dc0d
(svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents:
6423
diff
changeset
|
256 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
257 static inline void MakeCompanyHQ(TileIndex t, Owner o) |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
258 { |
10951
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
259 MakeUnmovableHQHelper(t , 0, o); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
260 MakeUnmovableHQHelper(t + TileDiffXY(0, 1), 1, o); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
261 MakeUnmovableHQHelper(t + TileDiffXY(1, 0), 2, o); |
5077f19e169c
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
belugas <belugas@openttd.org>
parents:
10012
diff
changeset
|
262 MakeUnmovableHQHelper(t + TileDiffXY(1, 1), 3, o); |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
263 } |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
264 |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
265 #endif /* UNMOVABLE_MAP_H */ |