diff options
author | frosch <frosch@openttd.org> | 2010-11-20 14:45:52 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-11-20 14:45:52 +0000 |
commit | 38dc34828ea679e4952f9f30361382e29d2f2e06 (patch) | |
tree | 5e495359c9041e1a0a7e9dc2ce96c6570f9787e6 /src/table | |
parent | 3ca5951478c7f647c0ccc859b84a082ff7d4f69a (diff) | |
download | openttd-38dc34828ea679e4952f9f30361382e29d2f2e06.tar.xz |
(svn r21272) -Change [FS#119-ish]: Draw airport fences as groundsprites on runway/taxiway tiles. This makes the usual foundation-glitch a lot less likely to happen.
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/station_land.h | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/src/table/station_land.h b/src/table/station_land.h index 77eb74f1b..ed0339b77 100644 --- a/src/table/station_land.h +++ b/src/table/station_land.h @@ -43,6 +43,16 @@ */ #define TILE_SEQ_CHILD(dx, dy, img, pal) TILE_SEQ_LINE_PAL(dx, dy, (int8)0x80, 0, 0, 0, img, pal) +/** + * Constructor macro for additional ground sprites. + * These need to be at the front of a DrawTileSeqStruct sequence. + * @param dx Offset in x direction + * @param dy Offset in y direction + * @param dz Offset in z direction + * @param img Sprite to draw + */ +#define TILE_SEQ_GROUND(dx, dy, dz, img) TILE_SEQ_CHILD(2 * (dy - dx), dx + dy - dz, 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} } @@ -107,17 +117,22 @@ static const DrawTileSeqStruct _station_display_datas_7[] = { }; static const DrawTileSeqStruct _station_display_fence_nw[] = { - TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north + TILE_SEQ_END() +}; + +static const DrawTileSeqStruct _station_display_fence_ne[] = { + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_END() }; static const DrawTileSeqStruct _station_display_fence_sw[] = { - TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west + TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west TILE_SEQ_END() }; static const DrawTileSeqStruct _station_display_fence_se[] = { - TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) + TILE_SEQ_GROUND( 0, 15, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_END() }; @@ -174,11 +189,6 @@ static const DrawTileSeqStruct _station_display_passenger_tunnel[] = { TILE_SEQ_END() }; -static const DrawTileSeqStruct _station_display_fence_ne[] = { - TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) - TILE_SEQ_END() -}; - static const DrawTileSeqStruct _station_display_radar_1_fence_sw[] = { TILE_SEQ_LINE( 7, 7, 0, 2, 2, 8, SPR_AIRPORT_RADAR_1) TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) @@ -492,36 +502,36 @@ static const DrawTileSeqStruct _station_display_helipad[] = { /* asphalt tile with fences in north and south */ static const DrawTileSeqStruct _station_display_fence_ne_sw[] = { - TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) - TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) + TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_END() }; /* runway tiles with 2 corner fences */ static const DrawTileSeqStruct _station_display_fence_nw_sw[] = { - TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west - TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north + TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north TILE_SEQ_END() }; /* runway tiles with 2 corner fences */ static const DrawTileSeqStruct _station_display_fence_se_sw[] = { - TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west - TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south + TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west + TILE_SEQ_GROUND( 0, 15, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south TILE_SEQ_END() }; /* runway tiles with 2 corner fences */ static const DrawTileSeqStruct _station_display_fence_ne_nw[] = { - TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north - TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east TILE_SEQ_END() }; /* runway tiles with 2 corner fences */ static const DrawTileSeqStruct _station_display_fence_ne_se[] = { - TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east - TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south + TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east + TILE_SEQ_GROUND( 0, 15, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south TILE_SEQ_END() }; |