OpenTTD: src/table/object_land.h Source File

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

object_land.h
Go to the documentation of this file.
1 /* $Id: object_land.h 27183 2015-03-13 19:42:49Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
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.
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.
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/>.
8 */
9
12 #define TILE_SEQ_LINE(sz, img) { 0, 0, 0, 16, 16, sz, {img, PAL_NONE} },
13 #define TILE_SEQ_END() { (int8)0x80, 0, 0, 0, 0, 0, {0, 0} }
14
15 static const DrawTileSeqStruct _object_nothing[] = {
16 TILE_SEQ_END()
17 };
18
19 static const DrawTileSeqStruct _object_transmitter_seq[] = {
20 { 7, 7, 0, 2, 2, 70, {SPR_TRANSMITTER, PAL_NONE}},
21 TILE_SEQ_END()
22 };
23
24 static const DrawTileSeqStruct _object_lighthouse_seq[] = {
25 { 4, 4, 0, 7, 7, 61, {SPR_LIGHTHOUSE, PAL_NONE}},
26 TILE_SEQ_END()
27 };
28
29 static const DrawTileSeqStruct _object_statue_seq[] = {
30 { 0, 0, 0, 16, 16, 25, {SPR_STATUE_COMPANY | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE}},
31 TILE_SEQ_END()
32 };
33
34 static const DrawTileSeqStruct _object_owned_land_seq[] = {
35 { 8, 8, 0, 1, 1, 6, {SPR_BOUGHT_LAND | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE}},
36 TILE_SEQ_END()
37 };
38
39 extern const DrawTileSprites _objects[] = {
40 { { SPR_FLAT_2_THIRD_GRASS_TILE, PAL_NONE }, _object_transmitter_seq },
41 { { SPR_FLAT_2_THIRD_GRASS_TILE, PAL_NONE }, _object_lighthouse_seq },
42 { { SPR_CONCRETE_GROUND, PAL_NONE }, _object_statue_seq },
43 { { SPR_FLAT_BARE_LAND, PAL_NONE }, _object_owned_land_seq },
44 };
45
46
47 static const DrawTileSeqStruct _object_hq_medium_north[] = {
48 TILE_SEQ_LINE(20, SPR_MEDIUMHQ_NORTH_WALL | (1 << PALETTE_MODIFIER_COLOUR))
49 TILE_SEQ_END()
50 };
51
52 static const DrawTileSeqStruct _object_hq_medium_east[] = {
53 TILE_SEQ_LINE(20, SPR_MEDIUMHQ_EAST_WALL | (1 << PALETTE_MODIFIER_COLOUR))
54 TILE_SEQ_END()
55 };
56
57 static const DrawTileSeqStruct _object_hq_medium_west[] = {
58 TILE_SEQ_LINE(20, SPR_MEDIUMHQ_WEST_WALL | (1 << PALETTE_MODIFIER_COLOUR))
59 TILE_SEQ_END()
60 };
61
62 static const DrawTileSeqStruct _object_hq_large_north[] = {
63 TILE_SEQ_LINE(50, SPR_LARGEHQ_NORTH_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
64 TILE_SEQ_END()
65 };
66
67 static const DrawTileSeqStruct _object_hq_large_east[] = {
68 TILE_SEQ_LINE(50, SPR_LARGEHQ_EAST_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
69 TILE_SEQ_END()
70 };
71
72 static const DrawTileSeqStruct _object_hq_large_west[] = {
73 TILE_SEQ_LINE(50, SPR_LARGEHQ_WEST_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
74 TILE_SEQ_END()
75 };
76
77 static const DrawTileSeqStruct _object_hq_huge_north[] = {
78 TILE_SEQ_LINE(60, SPR_HUGEHQ_NORTH_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
79 TILE_SEQ_END()
80 };
81
82 static const DrawTileSeqStruct _object_hq_huge_east[] = {
83 TILE_SEQ_LINE(60, SPR_HUGEHQ_EAST_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
84 TILE_SEQ_END()
85 };
86
87 static const DrawTileSeqStruct _object_hq_huge_west[] = {
88 TILE_SEQ_LINE(60, SPR_HUGEHQ_WEST_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
89 TILE_SEQ_END()
90 };
91
92 #undef TILE_SEQ_LINE
93 #undef TILE_SEQ_END
94
95 #define TILE_SPRITE_LINE(img, dtss) { {img | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE}, dtss },
96
97 static const DrawTileSprites _object_hq[] = {
98 TILE_SPRITE_LINE(SPR_TINYHQ_NORTH, _object_nothing)
99 TILE_SPRITE_LINE(SPR_TINYHQ_WEST, _object_nothing)
100 TILE_SPRITE_LINE(SPR_TINYHQ_EAST, _object_nothing)
101 TILE_SPRITE_LINE(SPR_TINYHQ_SOUTH, _object_nothing)
102
103 TILE_SPRITE_LINE(SPR_SMALLHQ_NORTH, _object_nothing)
104 TILE_SPRITE_LINE(SPR_SMALLHQ_WEST, _object_nothing)
105 TILE_SPRITE_LINE(SPR_SMALLHQ_EAST, _object_nothing)
106 TILE_SPRITE_LINE(SPR_SMALLHQ_SOUTH, _object_nothing)
107
108 TILE_SPRITE_LINE(SPR_MEDIUMHQ_NORTH, _object_hq_medium_north)
109 TILE_SPRITE_LINE(SPR_MEDIUMHQ_WEST, _object_hq_medium_west)
110 TILE_SPRITE_LINE(SPR_MEDIUMHQ_EAST, _object_hq_medium_east)
111 TILE_SPRITE_LINE(SPR_MEDIUMHQ_SOUTH, _object_nothing)
112
113 TILE_SPRITE_LINE(SPR_LARGEHQ_NORTH_GROUND, _object_hq_large_north)
114 TILE_SPRITE_LINE(SPR_LARGEHQ_WEST_GROUND, _object_hq_large_west)
115 TILE_SPRITE_LINE(SPR_LARGEHQ_EAST_GROUND, _object_hq_large_east)
116 TILE_SPRITE_LINE(SPR_LARGEHQ_SOUTH, _object_nothing)
117
118 TILE_SPRITE_LINE(SPR_HUGEHQ_NORTH_GROUND, _object_hq_huge_north)
119 TILE_SPRITE_LINE(SPR_HUGEHQ_WEST_GROUND, _object_hq_huge_west)
120 TILE_SPRITE_LINE(SPR_HUGEHQ_EAST_GROUND, _object_hq_huge_east)
121 TILE_SPRITE_LINE(SPR_HUGEHQ_SOUTH, _object_nothing)
122 };
123
124 #undef TILE_SPRITE_LINE
125
126 #define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) { GRFFilePropsBase<2>(), INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, MAX_DAY + 1, flags, {0, 0, 0, 0}, 0, height, 1, gen_amount, true }
127
128 /* Climates
129 * T = Temperate
130 * A = Sub-Arctic
131 * S = Sub-Tropic
132 * Y = Toyland */
133 #define T 1
134 #define A 2
135 #define S 4
136 #define Y 8
137
138 extern const ObjectSpec _original_objects[] = {
139 M(STR_LAI_OBJECT_DESCRIPTION_TRANSMITTER, 0x11, 0, 0, 10, T|A|S , 15, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT),
140 M(STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE, 0x11, 0, 0, 8, T|A , 8, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT | OBJECT_FLAG_SCALE_BY_WATER),
141 M(STR_TOWN_BUILDING_NAME_STATUE_1, 0x11, 0, 0, 5, T|S|A|Y, 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_ONLY_IN_SCENEDIT), // Yes, we disallow building this everywhere. Happens in "special" case!
142 M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND, 0x11, 10, 10, 0, T|S|A|Y, 0, OBJECT_FLAG_AUTOREMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_CLEAR_INCOME | OBJECT_FLAG_HAS_NO_FOUNDATION ), // Only non-silly use case is to use it when you cannot build a station, so disallow bridges
143 M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS, 0x22, 0, 0, 7, T|S|A|Y, 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME),
144 };
145
146 #undef M
147 #undef Y
148 #undef S
149 #undef A
150 #undef T