OpenTTD Source  20240919-master-gdf0233f4c2
water_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 <http://www.gnu.org/licenses/>.
6  */
7 
20 #define TILE_SEQ_LINE(dx, dy, dz, sx, sy, sz, img) { dx, dy, dz, sx, sy, sz, {img, PAL_NONE} },
21 
23 #define TILE_SEQ_END() { (int8_t)0x80, 0, 0, 0, 0, 0, {0, 0} }
24 
30 #define TILE_SPRITE_LINE(img, dtss) { {img, PAL_NONE}, dtss },
31 
32 static const DrawTileSeqStruct _shipdepot_display_seq_1[] = {
33  TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE8 | (1 << PALETTE_MODIFIER_COLOUR))
34  TILE_SEQ_END()
35 };
36 
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))
40  TILE_SEQ_END()
41 };
42 
43 static const DrawTileSeqStruct _shipdepot_display_seq_3[] = {
44  TILE_SEQ_LINE( 15, 0, 0, 1, 0x10, 0x14, 0xFE9 | (1 << PALETTE_MODIFIER_COLOUR))
45  TILE_SEQ_END()
46 };
47 
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))
51  TILE_SEQ_END()
52 };
53 
54 static const DrawTileSprites _shipdepot_display_data[][DEPOT_PART_END] = {
55  { // AXIS_X
56  TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_1) // DEPOT_PART_NORTH
57  TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_2) // DEPOT_PART_SOUTH
58  },
59  { // AXIS_Y
60  TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_3) // DEPOT_PART_NORTH
61  TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_4) // DEPOT_PART_SOUTH
62  },
63 };
64 
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)
68  TILE_SEQ_END()
69 };
70 
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)
74  TILE_SEQ_END()
75 };
76 
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)
80  TILE_SEQ_END()
81 };
82 
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)
86  TILE_SEQ_END()
87 };
88 
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)
92  TILE_SEQ_END()
93 };
94 
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)
98  TILE_SEQ_END()
99 };
100 
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)
104  TILE_SEQ_END()
105 };
106 
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)
110  TILE_SEQ_END()
111 };
112 
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)
116  TILE_SEQ_END()
117 };
118 
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)
122  TILE_SEQ_END()
123 };
124 
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)
128  TILE_SEQ_END()
129 };
130 
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)
134  TILE_SEQ_END()
135 };
136 
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
143  },
144 
145  { // LOCK_PART_LOWER
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
150  },
151 
152  { // LOCK_PART_UPPER
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
157  },
158 };
159 
160 #undef TILE_SEQ_LINE
161 #undef TILE_SEQ_END
162 #undef TILE_SPRITE_LINE
TILE_SPRITE_LINE
#define TILE_SPRITE_LINE(img, dtss)
Constructor macro of a DrawTileSprites structure.
Definition: water_land.h:30
PALETTE_MODIFIER_COLOUR
@ PALETTE_MODIFIER_COLOUR
this bit is set when a recolouring process is in action
Definition: sprites.h:1550
DrawTileSprites
Ground palette sprite of a tile, together with its sprite layout.
Definition: sprite.h:58
TILE_SEQ_END
#define TILE_SEQ_END()
Constructor macro for a terminating DrawTileSeqStruct entry in an array.
Definition: water_land.h:23
DIAGDIR_END
@ DIAGDIR_END
Used for iterations.
Definition: direction_type.h:79
TILE_SEQ_LINE
#define TILE_SEQ_LINE(dx, dy, dz, sx, sy, sz, img)
Constructor macro for an image without a palette in a DrawTileSeqStruct array.
Definition: water_land.h:20
DrawTileSeqStruct
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
Definition: sprite.h:25