summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-07-10 13:04:04 +0000
committerfrosch <frosch@openttd.org>2011-07-10 13:04:04 +0000
commita7f7a978250009beb4f6453c145c7425cbcb57ce (patch)
tree9900a75be94b69838566a0cf1330164d860af146 /src/table
parentd4dbe95274b636e22d98e9981f178aec128fa491 (diff)
downloadopenttd-a7f7a978250009beb4f6453c145c7425cbcb57ce.tar.xz
(svn r22646) -Codechange: Simplify MP_WATER map accessors, esp. for locks and depots. (based on patched by adf88 and michi_cc)
Diffstat (limited to 'src/table')
-rw-r--r--src/table/water_land.h50
1 files changed, 30 insertions, 20 deletions
diff --git a/src/table/water_land.h b/src/table/water_land.h
index c09941384..d3cb0a3f9 100644
--- a/src/table/water_land.h
+++ b/src/table/water_land.h
@@ -53,11 +53,15 @@ static const DrawTileSeqStruct _shipdepot_display_seq_4[] = {
TILE_SEQ_END()
};
-static const DrawTileSprites _shipdepot_display_data[] = {
- TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_1)
- TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_2)
- TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_3)
- TILE_SPRITE_LINE(0xFDD, _shipdepot_display_seq_4)
+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[] = {
@@ -132,21 +136,27 @@ static const DrawTileSeqStruct _lock_display_seq_3t[] = {
TILE_SEQ_END()
};
-static const DrawTileSprites _lock_display_data[] = {
- TILE_SPRITE_LINE(1, _lock_display_seq_0)
- TILE_SPRITE_LINE(0, _lock_display_seq_1)
- TILE_SPRITE_LINE(2, _lock_display_seq_2)
- TILE_SPRITE_LINE(3, _lock_display_seq_3)
-
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_0b)
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_1b)
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_2b)
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_3b)
-
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_0t)
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_1t)
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_2t)
- TILE_SPRITE_LINE(0xFDD, _lock_display_seq_3t)
+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