OpenTTD Source 20250911-master-gfe9093df96
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
27#define TILE_SPRITE_LINE(img, dtss) { {img, PAL_NONE}, dtss },
28
29static const DrawTileSeqStruct _shipdepot_display_ne_seq[] = {
30 TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE8 | (1 << PALETTE_MODIFIER_COLOUR))
31};
32
33static const DrawTileSeqStruct _shipdepot_display_sw_seq[] = {
34 TILE_SEQ_LINE( 0, 0, 0, 16, 1, 0x14, 0xFEA)
35 TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE6 | (1 << PALETTE_MODIFIER_COLOUR))
36};
37
38static const DrawTileSeqStruct _shipdepot_display_nw_seq[] = {
39 TILE_SEQ_LINE( 15, 0, 0, 1, 0x10, 0x14, 0xFE9 | (1 << PALETTE_MODIFIER_COLOUR))
40};
41
42static const DrawTileSeqStruct _shipdepot_display_se_seq[] = {
43 TILE_SEQ_LINE( 0, 0, 0, 1, 16, 0x14, 0xFEB)
44 TILE_SEQ_LINE( 15, 0, 0, 1, 16, 0x14, 0xFE7 | (1 << PALETTE_MODIFIER_COLOUR))
45};
46
47static const DrawTileSpriteSpan _shipdepot_display_data[][DEPOT_PART_END] = {
48 { // AXIS_X
49 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_ne_seq) // DEPOT_PART_NORTH
50 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_sw_seq) // DEPOT_PART_SOUTH
51 },
52 { // AXIS_Y
53 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_nw_seq) // DEPOT_PART_NORTH
54 TILE_SPRITE_LINE(0xFDD, _shipdepot_display_se_seq) // DEPOT_PART_SOUTH
55 },
56};
57
58static constexpr uint8_t LOCK_HEIGHT_LOWER_REAR = 6;
59static constexpr uint8_t LOCK_HEIGHT_LOWER_FRONT = 10;
60static constexpr uint8_t LOCK_HEIGHT_MIDDLE_REAR = 6;
61static constexpr uint8_t LOCK_HEIGHT_MIDDLE_FRONT = 10;
62static constexpr uint8_t LOCK_HEIGHT_UPPER_REAR = 6;
63static constexpr uint8_t LOCK_HEIGHT_UPPER_FRONT = 6;
64
65static const DrawTileSeqStruct _lock_display_middle_ne_seq[] = {
68};
69
70static const DrawTileSeqStruct _lock_display_middle_se_seq[] = {
73};
74
75static const DrawTileSeqStruct _lock_display_middle_sw_seq[] = {
78};
79
80static const DrawTileSeqStruct _lock_display_middle_nw_seq[] = {
83};
84
85static const DrawTileSeqStruct _lock_display_lower_ne_seq[] = {
88};
89
90static const DrawTileSeqStruct _lock_display_lower_se_seq[] = {
93};
94
95static const DrawTileSeqStruct _lock_display_lower_sw_seq[] = {
98};
99
100static const DrawTileSeqStruct _lock_display_lower_nw_seq[] = {
102 TILE_SEQ_LINE(15, 0, 0, 1, TILE_SIZE, LOCK_HEIGHT_LOWER_FRONT, 12 + 3)
103};
104
105static const DrawTileSeqStruct _lock_display_upper_ne_seq[] = {
107 TILE_SEQ_LINE(0, 15, 0, TILE_SIZE, 1, LOCK_HEIGHT_UPPER_FRONT, 20 + 1)
108};
109
110static const DrawTileSeqStruct _lock_display_upper_se_seq[] = {
113};
114
115static const DrawTileSeqStruct _lock_display_upper_sw_seq[] = {
117 TILE_SEQ_LINE(0, 15, 0, TILE_SIZE, 1, LOCK_HEIGHT_UPPER_FRONT, 20 + 2)
118};
119
120static const DrawTileSeqStruct _lock_display_upper_nw_seq[] = {
121 TILE_SEQ_LINE( 0, 0, 0, 1, TILE_SIZE, LOCK_HEIGHT_UPPER_REAR, 16 + 3)
122 TILE_SEQ_LINE(15, 0, 0, 1, TILE_SIZE, LOCK_HEIGHT_UPPER_FRONT, 20 + 3)
123};
124
125static const DrawTileSpriteSpan _lock_display_data[][DIAGDIR_END] = {
126 { // LOCK_PART_MIDDLE
127 TILE_SPRITE_LINE(1, _lock_display_middle_ne_seq) // NE
128 TILE_SPRITE_LINE(0, _lock_display_middle_se_seq) // SE
129 TILE_SPRITE_LINE(2, _lock_display_middle_sw_seq) // SW
130 TILE_SPRITE_LINE(3, _lock_display_middle_nw_seq) // NW
131 },
132
133 { // LOCK_PART_LOWER
134 TILE_SPRITE_LINE(0xFDD, _lock_display_lower_ne_seq) // NE
135 TILE_SPRITE_LINE(0xFDD, _lock_display_lower_se_seq) // SE
136 TILE_SPRITE_LINE(0xFDD, _lock_display_lower_sw_seq) // SW
137 TILE_SPRITE_LINE(0xFDD, _lock_display_lower_nw_seq) // NW
138 },
139
140 { // LOCK_PART_UPPER
141 TILE_SPRITE_LINE(0xFDD, _lock_display_upper_ne_seq) // NE
142 TILE_SPRITE_LINE(0xFDD, _lock_display_upper_se_seq) // SE
143 TILE_SPRITE_LINE(0xFDD, _lock_display_upper_sw_seq) // SW
144 TILE_SPRITE_LINE(0xFDD, _lock_display_upper_nw_seq) // NW
145 },
146};
147
148#undef TILE_SEQ_LINE
149#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:1554
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:67
static constexpr uint TILE_SIZE
Tile size in world coordinates.
Definition tile_type.h:15
#define TILE_SPRITE_LINE(img, dtss)
Constructor macro of a DrawTileSpriteSpan structure.
Definition water_land.h:27
static constexpr uint8_t LOCK_HEIGHT_UPPER_FRONT
Sub-tile height of front wall of upper part.
Definition water_land.h:63
#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
static constexpr uint8_t LOCK_HEIGHT_LOWER_FRONT
Sub-tile height of front wall of lower part.
Definition water_land.h:59
static constexpr uint8_t LOCK_HEIGHT_MIDDLE_REAR
Sub-tile height of rear wall of middle part.
Definition water_land.h:60
static constexpr uint8_t LOCK_HEIGHT_LOWER_REAR
Sub-tile height of rear wall of lower part.
Definition water_land.h:58
static constexpr uint8_t LOCK_HEIGHT_UPPER_REAR
Sub-tile height of rear wall of upper part.
Definition water_land.h:62
static constexpr uint8_t LOCK_HEIGHT_MIDDLE_FRONT
Sub-tile height of front wall of middle part.
Definition water_land.h:61