annotate src/unmovable_map.h @ 14154:e3fe36dfb81e draft

(svn r18702) -Fix [FS#3467]: Enable DrawGroundSpriteAt() to deal with foundations as DrawGroundSprite() does, and use this for drawing one-way-road-signs and clear-land-fences.
author frosch <frosch@openttd.org>
date Sun, 03 Jan 2010 20:55:00 +0000
parents 3f4cc2986131
children a899d4e5ee1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
12778
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
3 /*
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
4 * This file is part of OpenTTD.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
8 */
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11294
diff changeset
9
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
10 /** @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
11
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
12 #ifndef UNMOVABLE_MAP_H
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
13 #define UNMOVABLE_MAP_H
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
14
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
15 #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
16 #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
17
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
18 /** 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
19 enum UnmovableType {
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
20 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
21 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
22 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
23 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
24 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
25 UNMOVABLE_MAX,
6248
0789677a15a0 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents: 5587
diff changeset
26 };
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
27
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
28 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
29 * 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
30 * @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
31 * @pre IsTileType(t, MP_UNMOVABLE)
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
32 * @return the type.
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
33 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
34 static inline UnmovableType GetUnmovableType(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
35 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
36 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
37 return (UnmovableType)_m[t].m5;
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
38 }
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 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
41 * 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
42 * @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
43 * @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
44 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
45 static inline bool IsTransmitterTile(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
46 {
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
47 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
48 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
49
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
50 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
51 * 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
52 * @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
53 * @pre IsTileType(t, MP_UNMOVABLE)
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
54 * @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
55 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
56 static inline bool IsOwnedLand(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
57 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
58 assert(IsTileType(t, MP_UNMOVABLE));
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
59 return GetUnmovableType(t) == UNMOVABLE_OWNED_LAND;
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
60 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
61
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
62 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
63 * 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
64 * @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
65 * @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
66 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
67 static inline bool IsOwnedLandTile(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
68 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
69 return IsTileType(t, MP_UNMOVABLE) && IsOwnedLand(t);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
70 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
71
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
72 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
73 * 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
74 * @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
75 * @pre IsTileType(t, MP_UNMOVABLE)
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
76 * @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
77 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
78 static inline bool IsCompanyHQ(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
79 {
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
80 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
81 return _m[t].m5 == UNMOVABLE_HQ;
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
82 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
83
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
84 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
85 * 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
86 * @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
87 * @pre IsTileType(t, MP_UNMOVABLE)
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
88 * @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
89 */
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
90 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
91 {
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
92 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
93 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
94 }
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
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
96 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
97 * 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
98 * @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
99 * @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
100 */
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
101 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
102 {
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
103 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
104 }
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
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
106 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
107 * 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
108 * @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
109 * @pre IsStatueTile(t)
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
110 * @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
111 */
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
112 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
113 {
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
114 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
115 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
116 }
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
117
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
118 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
119 * 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
120 * @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
121 * @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
122 * @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
123 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
124 static inline byte GetCompanyHQSize(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
125 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
126 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
127 return GB(_m[t].m3, 2, 3);
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
128 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
129
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
130 /**
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
131 * 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
132 * @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
133 * @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
134 * @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
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 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
137 {
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
138 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
139 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
140 }
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
141
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
142 /**
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
143 * 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
144 * 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
145 * @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
146 * @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
147 * @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
148 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
149 static inline byte GetCompanyHQSection(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
150 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
151 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
152 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
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
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 * 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
157 * @param t a tile of the HQ.
13070
1c4c4ae8d716 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos
rubidium <rubidium@openttd.org>
parents: 12778
diff changeset
158 * @param section to be set.
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
159 * @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
160 */
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
161 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
162 {
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
163 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
164 SB(_m[t].m3, 0, 2, section);
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
165 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
166
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
167 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
168 * 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
169 * 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
170 * @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
171 * @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
172 * @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
173 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
174 static inline void EnlargeCompanyHQ(TileIndex t, byte size)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
175 {
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
176 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
177 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
178 if (size <= GetCompanyHQSize(t)) return;
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
179
13175
3f4cc2986131 (svn r17682) -Codechange: remove erroneous space before some commas
rubidium <rubidium@openttd.org>
parents: 13070
diff changeset
180 SetCompanyHQSize(t, size);
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
181 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
182 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
183 SetCompanyHQSize(t + TileDiffXY(1, 1), size);
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
184 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
185
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
186
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
187 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
188 * Make an Unmovable tile.
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
189 * @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
190 * @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
191 * @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
192 * @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
193 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
194 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
195 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
196 SetTileType(t, MP_UNMOVABLE);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
197 SetTileOwner(t, o);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
198 _m[t].m2 = 0;
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
199 _m[t].m3 = 0;
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
200 _m[t].m4 = 0;
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
201 _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
202 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
203 _me[t].m7 = 0;
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
204 }
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
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
207 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
208 * Make a transmitter tile.
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
209 * @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
210 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
211 static inline void MakeTransmitter(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
212 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
213 MakeUnmovable(t, UNMOVABLE_TRANSMITTER, OWNER_NONE);
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
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
216 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
217 * Make a lighthouse tile.
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
218 * @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
219 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
220 static inline void MakeLighthouse(TileIndex t)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
221 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
222 MakeUnmovable(t, UNMOVABLE_LIGHTHOUSE, OWNER_NONE);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
223 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
224
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
225 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
226 * Make a statue tile.
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
227 * @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
228 * @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
229 * @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
230 */
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
231 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
232 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
233 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
234 _m[t].m2 = town_id;
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
235 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
236
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
237 /**
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
238 * Make an 'owned land' tile.
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
239 * @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
240 * @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
241 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
242 static inline void MakeOwnedLand(TileIndex t, Owner o)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
243 {
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
244 MakeUnmovable(t, UNMOVABLE_OWNED_LAND, o);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
245 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
246
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
247 /**
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
248 * 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
249 * @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
250 * @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
251 * @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
252 */
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
253 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
254 {
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
255 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
256 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
257 }
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
258
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 /**
6489
5459e8d2dc0d (svn r9670) -Documentation: add documentation to some the _map files.
rubidium <rubidium@openttd.org>
parents: 6423
diff changeset
260 * 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
261 * @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
262 * @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
263 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
264 static inline void MakeCompanyHQ(TileIndex t, Owner o)
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
265 {
13175
3f4cc2986131 (svn r17682) -Codechange: remove erroneous space before some commas
rubidium <rubidium@openttd.org>
parents: 13070
diff changeset
266 MakeUnmovableHQHelper(t, 0, o);
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
267 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
268 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
269 MakeUnmovableHQHelper(t + TileDiffXY(1, 1), 3, o);
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
270 }
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
271
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
272 #endif /* UNMOVABLE_MAP_H */