summaryrefslogtreecommitdiff
path: root/src/table/water_land.h
blob: c1d55de956d329e79543cdca964a3460f8c0cd30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
 * This file is part of OpenTTD.
 * 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.
 * 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.
 * 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/>.
 */

/** @file water_land.h Sprites to use and how to display them for water tiles (depots/locks). */

/**
 * Constructor macro for an image without a palette in a DrawTileSeqStruct array.
 * @param dx  Offset in x direction
 * @param dy  Offset in y direction
 * @param dz  Offset in z direction
 * @param sx  Size in x direction
 * @param sy  Size in y direction
 * @param sz  Size in z direction
 * @param img Sprite to draw
 */
#define TILE_SEQ_LINE(dx, dy, dz, sx, sy, sz, img) { dx, dy, dz, sx, sy, sz, {img, PAL_NONE} },

/** Constructor macro for a terminating DrawTileSeqStruct entry in an array */
#define TILE_SEQ_END() { (int8)0x80, 0, 0, 0, 0, 0, {0, 0} }

/**
 * Constructor macro of a DrawTileSprites structure
 * @param img   Ground sprite without palette of the tile
 * @param dtss  Sequence child sprites of the tile
 */
#define TILE_SPRITE_LINE(img, dtss) { {img, PAL_NONE}, dtss },

static const DrawTileSeqStruct _shipdepot_display_seq_1[] = {
	TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE8 | (1 << PALETTE_MODIFIER_COLOUR))
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _shipdepot_display_seq_2[] = {
	TILE_SEQ_LINE( 0,  0, 0, 16, 1, 0x14, 0xFEA)
	TILE_SEQ_LINE( 0, 15, 0, 16, 1, 0x14, 0xFE6 | (1 << PALETTE_MODIFIER_COLOUR))
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _shipdepot_display_seq_3[] = {
	TILE_SEQ_LINE( 15, 0, 0, 1, 0x10, 0x14, 0xFE9 | (1 << PALETTE_MODIFIER_COLOUR))
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _shipdepot_display_seq_4[] = {
	TILE_SEQ_LINE(  0, 0, 0, 1, 16, 0x14, 0xFEB)
	TILE_SEQ_LINE( 15, 0, 0, 1, 16, 0x14, 0xFE7 | (1 << PALETTE_MODIFIER_COLOUR))
	TILE_SEQ_END()
};

static const DrawTileSprites _shipdepot_display_data[][DEPOT_PART_END] = {
	{ // AXIS_X
		TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_1) // DEPOT_PART_NORTH
		TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_2) // DEPOT_PART_SOUTH
	},
	{ // AXIS_Y
		TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_3) // DEPOT_PART_NORTH
		TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_4) // DEPOT_PART_SOUTH
	},
};

static const DrawTileSeqStruct _lock_display_seq_0[] = {
	TILE_SEQ_LINE( 0,   0, 0, 0x10, 1, 0x14, 0 + 1)
	TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 4 + 1)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_1[] = {
	TILE_SEQ_LINE(   0, 0, 0, 1, 0x10, 0x14, 0)
	TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 4)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_2[] = {
	TILE_SEQ_LINE( 0,   0, 0, 0x10, 1, 0x14, 0 + 2)
	TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 4 + 2)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_3[] = {
	TILE_SEQ_LINE(   0, 0, 0, 1, 0x10, 0x14, 0 + 3)
	TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 4 + 3)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_0b[] = {
	TILE_SEQ_LINE( 0,   0, 0, 0x10, 1, 0x14, 8 + 1)
	TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 12 + 1)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_1b[] = {
	TILE_SEQ_LINE(   0, 0, 0, 0x1, 0x10, 0x14, 8)
	TILE_SEQ_LINE( 0xF, 0, 0, 0x1, 0x10, 0x14, 12)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_2b[] = {
	TILE_SEQ_LINE( 0,   0, 0, 0x10, 1, 0x14, 8 + 2)
	TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 12 + 2)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_3b[] = {
	TILE_SEQ_LINE(   0, 0, 0, 1, 0x10, 0x14, 8 + 3)
	TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 12 + 3)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_0t[] = {
	TILE_SEQ_LINE( 0,   0, 0, 0x10, 1, 0x14, 16 + 1)
	TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 20 + 1)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_1t[] = {
	TILE_SEQ_LINE(   0, 0, 0, 0x1, 0x10, 0x14, 16)
	TILE_SEQ_LINE( 0xF, 0, 0, 0x1, 0x10, 0x14, 20)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_2t[] = {
	TILE_SEQ_LINE( 0,   0, 0, 0x10, 1, 0x14, 16 + 2)
	TILE_SEQ_LINE( 0, 0xF, 0, 0x10, 1, 0x14, 20 + 2)
	TILE_SEQ_END()
};

static const DrawTileSeqStruct _lock_display_seq_3t[] = {
	TILE_SEQ_LINE(   0, 0, 0, 1, 0x10, 0x14, 16 + 3)
	TILE_SEQ_LINE( 0xF, 0, 0, 1, 0x10, 0x14, 20 + 3)
	TILE_SEQ_END()
};

static const DrawTileSprites _lock_display_data[][DIAGDIR_END] = {
	{ // LOCK_PART_MIDDLE
		TILE_SPRITE_LINE(1, _lock_display_seq_0) // NE
		TILE_SPRITE_LINE(0, _lock_display_seq_1) // SE
		TILE_SPRITE_LINE(2, _lock_display_seq_2) // SW
		TILE_SPRITE_LINE(3, _lock_display_seq_3) // NW
	},

	{ // LOCK_PART_LOWER
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_0b) // NE
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_1b) // SE
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_2b) // SW
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_3b) // NW
	},

	{ // LOCK_PART_UPPER
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_0t) // NE
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_1t) // SE
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_2t) // SW
		TILE_SPRITE_LINE(0xFDD, _lock_display_seq_3t) // NW
	},
};

#undef TILE_SEQ_LINE
#undef TILE_SEQ_END
#undef TILE_SPRITE_LINE