OpenTTD Source 20260311-master-g511d3794ce
road_land.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#define TILE_SEQ_LINE(img, pal, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 20, {img, pal} },
11
12static const DrawTileSeqStruct _road_depot_NE[] = {
13 TILE_SEQ_LINE(0x584 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)
14};
15
16static const DrawTileSeqStruct _road_depot_SE[] = {
17 TILE_SEQ_LINE(0x580 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 1, 16)
18 TILE_SEQ_LINE(0x581 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 15, 0, 1, 16)
19};
20
21static const DrawTileSeqStruct _road_depot_SW[] = {
22 TILE_SEQ_LINE(0x582 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 1)
23 TILE_SEQ_LINE(0x583 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)
24};
25
26static const DrawTileSeqStruct _road_depot_NW[] = {
27 TILE_SEQ_LINE(0x585 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 15, 0, 1, 16)
28};
29
30static const DrawTileSpriteSpan _road_depot[] = {
31 { {0xA4A, PAL_NONE}, _road_depot_NE },
32 { {0xA4A, PAL_NONE}, _road_depot_SE },
33 { {0xA4A, PAL_NONE}, _road_depot_SW },
34 { {0xA4A, PAL_NONE}, _road_depot_NW }
35};
36
42 TILE_SEQ_LINE(2, PAL_NONE, 0, 0, 3, 3)
43 TILE_SEQ_LINE(4, PAL_NONE, 0, 13, 3, 3)
44 TILE_SEQ_LINE(6, PAL_NONE, 13, 0, 3, 3)
45 TILE_SEQ_LINE(8, PAL_NONE, 13, 13, 3, 3)
46};
47
48static const DrawTileSpriteSpan _crossing_layout = {
49 {0, PAL_NONE}, _crossing_layout_ALL
50};
51
52static const DrawTileSeqStruct _crossing_layout_SW_ALL[] = {
53 TILE_SEQ_LINE(6, PAL_NONE, 13, 0, 3, 3)
54 TILE_SEQ_LINE(8, PAL_NONE, 13, 13, 3, 3)
55};
56
57static const DrawTileSpriteSpan _crossing_layout_SW = {
58 {0, PAL_NONE}, _crossing_layout_SW_ALL
59};
60
61static const DrawTileSeqStruct _crossing_layout_NW_ALL[] = {
62 TILE_SEQ_LINE(2, PAL_NONE, 0, 0, 3, 3)
63 TILE_SEQ_LINE(6, PAL_NONE, 13, 0, 3, 3)
64};
65
66static const DrawTileSpriteSpan _crossing_layout_NW = {
67 {0, PAL_NONE}, _crossing_layout_NW_ALL
68};
69
70static const DrawTileSeqStruct _crossing_layout_NE_ALL[] = {
71 TILE_SEQ_LINE(2, PAL_NONE, 0, 0, 3, 3)
72 TILE_SEQ_LINE(4, PAL_NONE, 0, 13, 3, 3)
73};
74
75static const DrawTileSpriteSpan _crossing_layout_NE = {
76 {0, PAL_NONE}, _crossing_layout_NE_ALL
77};
78
79static const DrawTileSeqStruct _crossing_layout_SE_ALL[] = {
80 TILE_SEQ_LINE(4, PAL_NONE, 0, 13, 3, 3)
81 TILE_SEQ_LINE(8, PAL_NONE, 13, 13, 3, 3)
82};
83
84static const DrawTileSpriteSpan _crossing_layout_SE = {
85 {0, PAL_NONE}, _crossing_layout_SE_ALL
86};
87
88#undef TILE_SEQ_LINE
89
90
91static const SpriteID _road_tile_sprites_1[16] = {
92 0, 0x546, 0x545, 0x53B, 0x544, 0x534, 0x53E, 0x539,
93 0x543, 0x53C, 0x535, 0x538, 0x53D, 0x537, 0x53A, 0x536
94};
95
96static const SpriteID _road_backpole_sprites_1[16] = {
97 0, 0x54, 0x55, 0x5B, 0x54, 0x54, 0x5E, 0x5A, 0x55, 0x5C, 0x55, 0x58, 0x5D, 0x57, 0x59, 0x56
98};
99
100static const SpriteID _road_frontwire_sprites_1[16] = {
101 0, 0x38, 0x39, 0x40, 0x38, 0x38, 0x43, 0x3E, 0x39, 0x41, 0x39, 0x3C, 0x42, 0x3B, 0x3D, 0x3A
102};
103
104#define MAKELINE(a, b, c) { a, b, c },
105#define ENDLINE { 0, 0, 0 }
106
107static const DrawRoadTileStruct _roadside_nothing[] = {
108 ENDLINE
109};
110
111static const DrawRoadTileStruct _road_display_datas2_3[] = {
112 MAKELINE(0x57f, 1, 8)
113 ENDLINE
114};
115
116static const DrawRoadTileStruct _road_display_datas2_5[] = {
117 MAKELINE(0x57f, 1, 8)
118 MAKELINE(0x57e, 14, 8)
119 ENDLINE
120};
121
122static const DrawRoadTileStruct _road_display_datas2_6[] = {
123 MAKELINE(0x57e, 8, 1)
124 ENDLINE
125};
126
127static const DrawRoadTileStruct _road_display_datas2_7[] = {
128 MAKELINE(0x57f, 1, 8)
129 ENDLINE
130};
131
132static const DrawRoadTileStruct _road_display_datas2_9[] = {
133 MAKELINE(0x57f, 8, 14)
134 ENDLINE
135};
136
137static const DrawRoadTileStruct _road_display_datas2_10[] = {
138 MAKELINE(0x57f, 8, 14)
139 MAKELINE(0x57e, 8, 1)
140 ENDLINE
141};
142
143static const DrawRoadTileStruct _road_display_datas2_11[] = {
144 MAKELINE(0x57f, 8, 14)
145 ENDLINE
146};
147
148static const DrawRoadTileStruct _road_display_datas2_12[] = {
149 MAKELINE(0x57e, 8, 1)
150 ENDLINE
151};
152
153static const DrawRoadTileStruct _road_display_datas2_13[] = {
154 MAKELINE(0x57e, 14, 8)
155 ENDLINE
156};
157
158static const DrawRoadTileStruct _road_display_datas2_14[] = {
159 MAKELINE(0x57e, 8, 1)
160 ENDLINE
161};
162
163static const DrawRoadTileStruct _road_display_datas2_19[] = {
164 MAKELINE(0x1212, 0, 2)
165 MAKELINE(0x1212, 3, 9)
166 MAKELINE(0x1212, 10, 12)
167 ENDLINE
168};
169
170static const DrawRoadTileStruct _road_display_datas2_21[] = {
171 MAKELINE(0x1212, 0, 2)
172 MAKELINE(0x1212, 0, 10)
173 MAKELINE(0x1212, 12, 2)
174 MAKELINE(0x1212, 12, 10)
175 ENDLINE
176};
177
178static const DrawRoadTileStruct _road_display_datas2_22[] = {
179 MAKELINE(0x1212, 10, 0)
180 MAKELINE(0x1212, 3, 3)
181 MAKELINE(0x1212, 0, 10)
182 ENDLINE
183};
184
185static const DrawRoadTileStruct _road_display_datas2_23[] = {
186 MAKELINE(0x1212, 0, 2)
187 MAKELINE(0x1212, 0, 10)
188 ENDLINE
189};
190
191static const DrawRoadTileStruct _road_display_datas2_25[] = {
192 MAKELINE(0x1212, 12, 2)
193 MAKELINE(0x1212, 9, 9)
194 MAKELINE(0x1212, 2, 12)
195 ENDLINE
196};
197
198static const DrawRoadTileStruct _road_display_datas2_26[] = {
199 MAKELINE(0x1212, 2, 0)
200 MAKELINE(0x1212, 10, 0)
201 MAKELINE(0x1212, 2, 12)
202 MAKELINE(0x1212, 10, 12)
203 ENDLINE
204};
205
206static const DrawRoadTileStruct _road_display_datas2_27[] = {
207 MAKELINE(0x1212, 2, 12)
208 MAKELINE(0x1212, 10, 12)
209 ENDLINE
210};
211
212static const DrawRoadTileStruct _road_display_datas2_28[] = {
213 MAKELINE(0x1212, 2, 0)
214 MAKELINE(0x1212, 9, 3)
215 MAKELINE(0x1212, 12, 10)
216 ENDLINE
217};
218
219static const DrawRoadTileStruct _road_display_datas2_29[] = {
220 MAKELINE(0x1212, 12, 2)
221 MAKELINE(0x1212, 12, 10)
222 ENDLINE
223};
224
225static const DrawRoadTileStruct _road_display_datas2_30[] = {
226 MAKELINE(0x1212, 2, 0)
227 MAKELINE(0x1212, 10, 0)
228 ENDLINE
229};
230
231#undef MAKELINE
232#undef ENDLINE
233
234static const DrawRoadTileStruct * const _roadside_none[] = {
235 _roadside_nothing, _roadside_nothing,
236 _roadside_nothing, _roadside_nothing,
237 _roadside_nothing, _roadside_nothing,
238 _roadside_nothing, _roadside_nothing,
239 _roadside_nothing, _roadside_nothing,
240 _roadside_nothing, _roadside_nothing,
241 _roadside_nothing, _roadside_nothing,
242 _roadside_nothing, _roadside_nothing
243};
244
245static const DrawRoadTileStruct * const _roadside_lamps[] = {
246 _roadside_nothing,
247 _roadside_nothing,
248 _roadside_nothing,
249 _road_display_datas2_3,
250 _roadside_nothing,
251 _road_display_datas2_5,
252 _road_display_datas2_6,
253 _road_display_datas2_7,
254 _roadside_nothing,
255 _road_display_datas2_9,
256 _road_display_datas2_10,
257 _road_display_datas2_11,
258 _road_display_datas2_12,
259 _road_display_datas2_13,
260 _road_display_datas2_14,
261 _roadside_nothing,
262};
263
264static const DrawRoadTileStruct * const _roadside_trees[] = {
265 _roadside_nothing,
266 _roadside_nothing,
267 _roadside_nothing,
268 _road_display_datas2_19,
269 _roadside_nothing,
270 _road_display_datas2_21,
271 _road_display_datas2_22,
272 _road_display_datas2_23,
273
274 _roadside_nothing,
275 _road_display_datas2_25,
276 _road_display_datas2_26,
277 _road_display_datas2_27,
278 _road_display_datas2_28,
279 _road_display_datas2_29,
280 _road_display_datas2_30,
281 _roadside_nothing,
282};
283
284static const DrawRoadTileStruct * const * const _road_display_table[] = {
285 _roadside_none,
286 _roadside_none,
287 _roadside_none,
288 _roadside_lamps,
289 _roadside_none,
290 _roadside_trees,
291};
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
static const DrawTileSeqStruct _crossing_layout_ALL[]
Sprite layout for level crossings.
Definition road_land.h:41
static constexpr uint8_t PALETTE_MODIFIER_COLOUR
this bit is set when a recolouring process is in action
Definition sprites.h:1562
#define TILE_SEQ_LINE(dx, dy, dz, sx, sy, sz, img)
Constructor macro for an image without a palette in a DrawTileSeqStruct array.
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
Definition sprite.h:33
Ground palette sprite of a tile, together with its sprite layout.
Definition sprite.h:76