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 water_land.h Sprites to use and how to display them for water tiles (depots/locks). */
11 * Constructor macro for an image without a palette in a DrawTileSeqStruct array.
12 * @param dx Offset in x direction
13 * @param dy Offset in y direction
14 * @param dz Offset in z direction
15 * @param sx Size in x direction
16 * @param sy Size in y direction
17 * @param sz Size in z direction
18 * @param img Sprite to draw
20 #define TILE_SEQ_LINE(dx, dy, dz, sx, sy, sz, img) { dx, dy, dz, sx, sy, sz, {img, PAL_NONE} },
22 /** Constructor macro for a terminating DrawTileSeqStruct entry in an array */
23 #define TILE_SEQ_END() { (int8)0x80, 0, 0, 0, 0, 0, {0, 0} }
26 * Constructor macro of a DrawTileSprites structure
27 * @param img Ground sprite without palette of the tile
28 * @param dtss Sequence child sprites of the tile
30 #define TILE_SPRITE_LINE(img, dtss) { {img, PAL_NONE}, dtss },
32 static const DrawTileSeqStruct _shipdepot_display_seq_1
[] = {
33 TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE8 | (1 << PALETTE_MODIFIER_COLOUR
))
37 static const DrawTileSeqStruct _shipdepot_display_seq_2
[] = {
38 TILE_SEQ_LINE( 0, 0, 0, 16, 1, 0x14, 0xFEA)
39 TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE6 | (1 << PALETTE_MODIFIER_COLOUR
))
43 static const DrawTileSeqStruct _shipdepot_display_seq_3
[] = {
44 TILE_SEQ_LINE( 15, 0, 0, 1, 0x10, 0x14, 0xFE9 | (1 << PALETTE_MODIFIER_COLOUR
))
48 static const DrawTileSeqStruct _shipdepot_display_seq_4
[] = {
49 TILE_SEQ_LINE( 0, 0, 0, 1, 16, 0x14, 0xFEB)
50 TILE_SEQ_LINE( 15, 0, 0, 1, 16, 0x14, 0xFE7 | (1 << PALETTE_MODIFIER_COLOUR
))
54 static const DrawTileSprites _shipdepot_display_data
[][DEPOT_PART_END
] = {
56 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_1
) // DEPOT_PART_NORTH
57 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_2
) // DEPOT_PART_SOUTH
60 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_3
) // DEPOT_PART_NORTH
61 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_4
) // DEPOT_PART_SOUTH
65 static const DrawTileSeqStruct _lock_display_seq_0
[] = {
66 TILE_SEQ_LINE( 0, 0, 0, 0x10, 1, 0x14, 0 + 1)
67 TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 4 + 1)
71 static const DrawTileSeqStruct _lock_display_seq_1
[] = {
72 TILE_SEQ_LINE( 0, 0, 0, 1, 0x10, 0x14, 0)
73 TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 4)
77 static const DrawTileSeqStruct _lock_display_seq_2
[] = {
78 TILE_SEQ_LINE( 0, 0, 0, 0x10, 1, 0x14, 0 + 2)
79 TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 4 + 2)
83 static const DrawTileSeqStruct _lock_display_seq_3
[] = {
84 TILE_SEQ_LINE( 0, 0, 0, 1, 0x10, 0x14, 0 + 3)
85 TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 4 + 3)
89 static const DrawTileSeqStruct _lock_display_seq_0b
[] = {
90 TILE_SEQ_LINE( 0, 0, 0, 0x10, 1, 0x14, 8 + 1)
91 TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 12 + 1)
95 static const DrawTileSeqStruct _lock_display_seq_1b
[] = {
96 TILE_SEQ_LINE( 0, 0, 0, 0x1, 0x10, 0x14, 8)
97 TILE_SEQ_LINE( 0xF, 0, 0, 0x1, 0x10, 0x14, 12)
101 static const DrawTileSeqStruct _lock_display_seq_2b
[] = {
102 TILE_SEQ_LINE( 0, 0, 0, 0x10, 1, 0x14, 8 + 2)
103 TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 12 + 2)
107 static const DrawTileSeqStruct _lock_display_seq_3b
[] = {
108 TILE_SEQ_LINE( 0, 0, 0, 1, 0x10, 0x14, 8 + 3)
109 TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 12 + 3)
113 static const DrawTileSeqStruct _lock_display_seq_0t
[] = {
114 TILE_SEQ_LINE( 0, 0, 0, 0x10, 1, 0x14, 16 + 1)
115 TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 20 + 1)
119 static const DrawTileSeqStruct _lock_display_seq_1t
[] = {
120 TILE_SEQ_LINE( 0, 0, 0, 0x1, 0x10, 0x14, 16)
121 TILE_SEQ_LINE( 0xF, 0, 0, 0x1, 0x10, 0x14, 20)
125 static const DrawTileSeqStruct _lock_display_seq_2t
[] = {
126 TILE_SEQ_LINE( 0, 0, 0, 0x10, 1, 0x14, 16 + 2)
127 TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 20 + 2)
131 static const DrawTileSeqStruct _lock_display_seq_3t
[] = {
132 TILE_SEQ_LINE( 0, 0, 0, 1, 0x10, 0x14, 16 + 3)
133 TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 20 + 3)
137 static const DrawTileSprites _lock_display_data
[][DIAGDIR_END
] = {
138 { // LOCK_PART_MIDDLE
139 TILE_SPRITE_LINE(1, _lock_display_seq_0
) // NE
140 TILE_SPRITE_LINE(0, _lock_display_seq_1
) // SE
141 TILE_SPRITE_LINE(2, _lock_display_seq_2
) // SW
142 TILE_SPRITE_LINE(3, _lock_display_seq_3
) // NW
146 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_0b
) // NE
147 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_1b
) // SE
148 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_2b
) // SW
149 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_3b
) // NW
153 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_0t
) // NE
154 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_1t
) // SE
155 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_2t
) // SW
156 TILE_SPRITE_LINE(0xFDD, _lock_display_seq_3t
) // NW
162 #undef TILE_SPRITE_LINE