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 <http://www.gnu.org/licenses/>.
8 /** @file road_land.h Sprite constructs for road depots. */
10 #define TILE_SEQ_LINE(img, pal, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 20, {img, pal} },
11 #define TILE_SEQ_END() { (int8)0x80, 0, 0, 0, 0, 0, {0, 0} }
13 static const DrawTileSeqStruct _road_depot_NE
[] = {
14 TILE_SEQ_LINE(0x584 | (1 << PALETTE_MODIFIER_COLOUR
), PAL_NONE
, 0, 15, 16, 1)
18 static const DrawTileSeqStruct _road_depot_SE
[] = {
19 TILE_SEQ_LINE(0x580 | (1 << PALETTE_MODIFIER_COLOUR
), PAL_NONE
, 0, 0, 1, 16)
20 TILE_SEQ_LINE(0x581 | (1 << PALETTE_MODIFIER_COLOUR
), PAL_NONE
, 15, 0, 1, 16)
24 static const DrawTileSeqStruct _road_depot_SW
[] = {
25 TILE_SEQ_LINE(0x582 | (1 << PALETTE_MODIFIER_COLOUR
), PAL_NONE
, 0, 0, 16, 1)
26 TILE_SEQ_LINE(0x583 | (1 << PALETTE_MODIFIER_COLOUR
), PAL_NONE
, 0, 15, 16, 1)
30 static const DrawTileSeqStruct _road_depot_NW
[] = {
31 TILE_SEQ_LINE(0x585 | (1 << PALETTE_MODIFIER_COLOUR
), PAL_NONE
, 15, 0, 1, 16)
35 static const DrawTileSprites _road_depot
[] = {
36 { {0xA4A, PAL_NONE
}, _road_depot_NE
},
37 { {0xA4A, PAL_NONE
}, _road_depot_SE
},
38 { {0xA4A, PAL_NONE
}, _road_depot_SW
},
39 { {0xA4A, PAL_NONE
}, _road_depot_NW
}
42 /* Sprite layout for level crossings. The SpriteIDs are actually offsets
43 * from the base SpriteID returned from the NewGRF sprite resolver. */
44 static const DrawTileSeqStruct _crossing_layout_ALL
[] = {
45 TILE_SEQ_LINE(2, PAL_NONE
, 0, 0, 3, 3)
46 TILE_SEQ_LINE(4, PAL_NONE
, 0, 13, 3, 3)
47 TILE_SEQ_LINE(6, PAL_NONE
, 13, 0, 3, 3)
48 TILE_SEQ_LINE(8, PAL_NONE
, 13, 13, 3, 3)
52 static const DrawTileSprites _crossing_layout
= {
53 {0, PAL_NONE
}, _crossing_layout_ALL
60 static const SpriteID _road_tile_sprites_1
[16] = {
61 0, 0x546, 0x545, 0x53B, 0x544, 0x534, 0x53E, 0x539,
62 0x543, 0x53C, 0x535, 0x538, 0x53D, 0x537, 0x53A, 0x536
65 static const SpriteID _road_frontwire_sprites_1
[16] = {
66 0, 0x54, 0x55, 0x5B, 0x54, 0x54, 0x5E, 0x5A, 0x55, 0x5C, 0x55, 0x58, 0x5D, 0x57, 0x59, 0x56
69 static const SpriteID _road_backpole_sprites_1
[16] = {
70 0, 0x38, 0x39, 0x40, 0x38, 0x38, 0x43, 0x3E, 0x39, 0x41, 0x39, 0x3C, 0x42, 0x3B, 0x3D, 0x3A
73 #define MAKELINE(a, b, c) { a, b, c },
74 #define ENDLINE { 0, 0, 0 }
76 static const DrawRoadTileStruct _roadside_nothing
[] = {
80 static const DrawRoadTileStruct _road_display_datas2_3
[] = {
85 static const DrawRoadTileStruct _road_display_datas2_5
[] = {
87 MAKELINE(0x57e, 14, 8)
91 static const DrawRoadTileStruct _road_display_datas2_6
[] = {
96 static const DrawRoadTileStruct _road_display_datas2_7
[] = {
101 static const DrawRoadTileStruct _road_display_datas2_9
[] = {
102 MAKELINE(0x57f, 8, 14)
106 static const DrawRoadTileStruct _road_display_datas2_10
[] = {
107 MAKELINE(0x57f, 8, 14)
108 MAKELINE(0x57e, 8, 1)
112 static const DrawRoadTileStruct _road_display_datas2_11
[] = {
113 MAKELINE(0x57f, 8, 14)
117 static const DrawRoadTileStruct _road_display_datas2_12
[] = {
118 MAKELINE(0x57e, 8, 1)
122 static const DrawRoadTileStruct _road_display_datas2_13
[] = {
123 MAKELINE(0x57e, 14, 8)
127 static const DrawRoadTileStruct _road_display_datas2_14
[] = {
128 MAKELINE(0x57e, 8, 1)
132 static const DrawRoadTileStruct _road_display_datas2_19
[] = {
133 MAKELINE(0x1212, 0, 2)
134 MAKELINE(0x1212, 3, 9)
135 MAKELINE(0x1212, 10, 12)
139 static const DrawRoadTileStruct _road_display_datas2_21
[] = {
140 MAKELINE(0x1212, 0, 2)
141 MAKELINE(0x1212, 0, 10)
142 MAKELINE(0x1212, 12, 2)
143 MAKELINE(0x1212, 12, 10)
147 static const DrawRoadTileStruct _road_display_datas2_22
[] = {
148 MAKELINE(0x1212, 10, 0)
149 MAKELINE(0x1212, 3, 3)
150 MAKELINE(0x1212, 0, 10)
154 static const DrawRoadTileStruct _road_display_datas2_23
[] = {
155 MAKELINE(0x1212, 0, 2)
156 MAKELINE(0x1212, 0, 10)
160 static const DrawRoadTileStruct _road_display_datas2_25
[] = {
161 MAKELINE(0x1212, 12, 2)
162 MAKELINE(0x1212, 9, 9)
163 MAKELINE(0x1212, 2, 12)
167 static const DrawRoadTileStruct _road_display_datas2_26
[] = {
168 MAKELINE(0x1212, 2, 0)
169 MAKELINE(0x1212, 10, 0)
170 MAKELINE(0x1212, 2, 12)
171 MAKELINE(0x1212, 10, 12)
175 static const DrawRoadTileStruct _road_display_datas2_27
[] = {
176 MAKELINE(0x1212, 2, 12)
177 MAKELINE(0x1212, 10, 12)
181 static const DrawRoadTileStruct _road_display_datas2_28
[] = {
182 MAKELINE(0x1212, 2, 0)
183 MAKELINE(0x1212, 9, 3)
184 MAKELINE(0x1212, 12, 10)
188 static const DrawRoadTileStruct _road_display_datas2_29
[] = {
189 MAKELINE(0x1212, 12, 2)
190 MAKELINE(0x1212, 12, 10)
194 static const DrawRoadTileStruct _road_display_datas2_30
[] = {
195 MAKELINE(0x1212, 2, 0)
196 MAKELINE(0x1212, 10, 0)
203 static const DrawRoadTileStruct
* const _roadside_none
[] = {
204 _roadside_nothing
, _roadside_nothing
,
205 _roadside_nothing
, _roadside_nothing
,
206 _roadside_nothing
, _roadside_nothing
,
207 _roadside_nothing
, _roadside_nothing
,
208 _roadside_nothing
, _roadside_nothing
,
209 _roadside_nothing
, _roadside_nothing
,
210 _roadside_nothing
, _roadside_nothing
,
211 _roadside_nothing
, _roadside_nothing
214 static const DrawRoadTileStruct
* const _roadside_lamps
[] = {
218 _road_display_datas2_3
,
220 _road_display_datas2_5
,
221 _road_display_datas2_6
,
222 _road_display_datas2_7
,
224 _road_display_datas2_9
,
225 _road_display_datas2_10
,
226 _road_display_datas2_11
,
227 _road_display_datas2_12
,
228 _road_display_datas2_13
,
229 _road_display_datas2_14
,
233 static const DrawRoadTileStruct
* const _roadside_trees
[] = {
237 _road_display_datas2_19
,
239 _road_display_datas2_21
,
240 _road_display_datas2_22
,
241 _road_display_datas2_23
,
244 _road_display_datas2_25
,
245 _road_display_datas2_26
,
246 _road_display_datas2_27
,
247 _road_display_datas2_28
,
248 _road_display_datas2_29
,
249 _road_display_datas2_30
,
253 static const DrawRoadTileStruct
* const * const _road_display_table
[] = {