OpenTTD Source 20241224-master-gf74b0cf984
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
32static const DrawTileSeqStruct _shipdepot_display_seq_1[] = {
33 TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE8 | (1 << PALETTE_MODIFIER_COLOUR))
35};
36
37static 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))
41};
42
43static const DrawTileSeqStruct _shipdepot_display_seq_3[] = {
44 TILE_SEQ_LINE( 15, 0, 0, 1, 0x10, 0x14, 0xFE9 | (1 << PALETTE_MODIFIER_COLOUR))
46};
47
48static 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))
52};
53
54static 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
65static 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)
69};
70
71static 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)
75};
76
77static 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)
81};
82
83static 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)
87};
88
89static 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)
93};
94
95static 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)
99};
100
101static 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)
105};
106
107static 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)
111};
112
113static 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)
117};
118
119static 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)
123};
124
125static 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)
129};
130
131static 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)
135};
136
137static 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
@ DIAGDIR_END
Used for iterations.
static constexpr uint8_t PALETTE_MODIFIER_COLOUR
this bit is set when a recolouring process is in action
Definition sprites.h:1548
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
Definition sprite.h:25
Ground palette sprite of a tile, together with its sprite layout.
Definition sprite.h:58
#define TILE_SPRITE_LINE(img, dtss)
Constructor macro of a DrawTileSprites structure.
Definition water_land.h:30
#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
#define TILE_SEQ_END()
Constructor macro for a terminating DrawTileSeqStruct entry in an array.
Definition water_land.h:23