diff options
author | Darkvater <darkvater@openttd.org> | 2006-04-15 16:07:00 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-04-15 16:07:00 +0000 |
commit | e21b7eebfa519f537b259194cbb065cbb5893597 (patch) | |
tree | 20fc3433a2a5aa948cb993edf6b3d983ef6a99ab | |
parent | 5c9acdb1825b699f9d796b06df728429e0b8a87e (diff) | |
download | openttd-e21b7eebfa519f537b259194cbb065cbb5893597.tar.xz |
(svn r4430) - NewGRF: Use the bridge's sprite layout for drawing high pillars. This fixes newgrf's high-bridge pillars drawing. Also remove the now obsolete _bridge_poles_table which was already integrated into the bridge sprite tables
-rw-r--r-- | table/bridge_land.h | 250 | ||||
-rw-r--r-- | tunnelbridge_cmd.c | 37 |
2 files changed, 10 insertions, 277 deletions
diff --git a/table/bridge_land.h b/table/bridge_land.h index ba81385de..7374ad390 100644 --- a/table/bridge_land.h +++ b/table/bridge_land.h @@ -20,9 +20,6 @@ * <li>X direction, south end, sloped</li> * <li>Y direction, south end, sloped</li></ol> * This is repeated 4 times, for rail, road, monorail, maglev</li> - * <li>_bridge_sprite_table_n_poles. Defines all the sprites needed for the pylons. The first 6 elements are for each - * bridge piece (max 5 currently) in X direction, the next 6 elements are for the bridge pieces in Y direction. - * The last two elements are used for cantilever bridges</li> * </ul> */ @@ -40,25 +37,6 @@ static const PalSpriteID _bridge_sprite_table_2_1[] = { 0x110F | PALETTE_TO_STRUCT_WHITE, 0x1111 | PALETTE_TO_STRUCT_WHITE, 0x110E | PALETTE_TO_STRUCT_WHITE, 0x1110 | PALETTE_TO_STRUCT_WHITE, 0x1113 | PALETTE_TO_STRUCT_WHITE, 0x1115 | PALETTE_TO_STRUCT_WHITE, 0x1112 | PALETTE_TO_STRUCT_WHITE, 0x1114 | PALETTE_TO_STRUCT_WHITE, }; -static const PalSpriteID _bridge_sprite_table_2_poles[] = { - SPR_PILLARS_BASE + 6 * 3 + 3, - SPR_PILLARS_BASE + 6 * 3 + 3, - SPR_PILLARS_BASE + 6 * 3 + 3, - SPR_PILLARS_BASE + 6 * 3 + 3, - SPR_PILLARS_BASE + 6 * 3 + 5, - 0x0, - - SPR_PILLARS_BASE + 6 * 3 + 0, - SPR_PILLARS_BASE + 6 * 3 + 0, - SPR_PILLARS_BASE + 6 * 3 + 0, - SPR_PILLARS_BASE + 6 * 3 + 0, - SPR_PILLARS_BASE + 6 * 3 + 2, - 0x0, - - 0x0, - 0x0, -}; - static const PalSpriteID _bridge_sprite_table_4_0[] = { 0x9A9, 0x99F, 0x9B1, 0x0, 0x9A5, 0x997, 0x9AD, 0x0, 0x99D, 0x99F, 0x9B1, 0x0, 0x995, 0x997, 0x9AD, 0x0, @@ -108,25 +86,6 @@ static const PalSpriteID _bridge_sprite_table_4_6[] = { 0x110F, 0x1111, 0x110E, 0x1110, 0x1113, 0x1115, 0x1112, 0x1114, }; -static const PalSpriteID _bridge_sprite_table_4_poles[] = { - SPR_PILLARS_BASE + 6 * 0 + 3, - SPR_PILLARS_BASE + 6 * 0 + 4, - SPR_PILLARS_BASE + 6 * 0 + 4, - SPR_PILLARS_BASE + 6 * 0 + 3, - SPR_PILLARS_BASE + 6 * 0 + 5, - 0x0, - - SPR_PILLARS_BASE + 6 * 0 + 0, - SPR_PILLARS_BASE + 6 * 0 + 1, - SPR_PILLARS_BASE + 6 * 0 + 1, - SPR_PILLARS_BASE + 6 * 0 + 0, - SPR_PILLARS_BASE + 6 * 0 + 2, - 0x0, - - 0x0, - 0x0, -}; - static const PalSpriteID _bridge_sprite_table_5_0[] = { 0x9A9 | PALETTE_TO_STRUCT_YELLOW, 0x99F | PALETTE_TO_STRUCT_YELLOW, 0x9B1 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x9A5 | PALETTE_TO_STRUCT_YELLOW, 0x997 | PALETTE_TO_STRUCT_YELLOW, 0x9AD | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x99D | PALETTE_TO_STRUCT_YELLOW, 0x99F | PALETTE_TO_STRUCT_YELLOW, 0x9B1 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x995 | PALETTE_TO_STRUCT_YELLOW, 0x997 | PALETTE_TO_STRUCT_YELLOW, 0x9AD | PALETTE_TO_STRUCT_YELLOW, 0x0, @@ -183,25 +142,6 @@ static const PalSpriteID _bridge_sprite_table_5_6[] = { 0x0, SPR_PILLARS_BASE + 2, }; -static const PalSpriteID _bridge_sprite_table_5_poles[] = { - SPR_PILLARS_BASE + 6 * 0 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 4 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 4 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 5 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - 0x0, - - SPR_PILLARS_BASE + 6 * 0 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 1 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 1 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 0 + 2 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - 0x0, - - 0x0, - 0x0, -}; - static const PalSpriteID _bridge_sprite_table_3_0[] = { 0x9A9 | PALETTE_TO_STRUCT_CONCRETE, 0x99F | PALETTE_TO_STRUCT_CONCRETE, 0x9B1 | PALETTE_TO_STRUCT_CONCRETE, 0x0, 0x9A5 | PALETTE_TO_STRUCT_CONCRETE, 0x997 | PALETTE_TO_STRUCT_CONCRETE, 0x9AD | PALETTE_TO_STRUCT_CONCRETE, 0x0, 0x99D | PALETTE_TO_STRUCT_CONCRETE, 0x99F | PALETTE_TO_STRUCT_CONCRETE, 0x9B1 | PALETTE_TO_STRUCT_CONCRETE, 0x0, 0x995 | PALETTE_TO_STRUCT_CONCRETE, 0x997 | PALETTE_TO_STRUCT_CONCRETE, 0x9AD | PALETTE_TO_STRUCT_CONCRETE, 0x0, @@ -252,25 +192,6 @@ static const PalSpriteID _bridge_sprite_table_3_6[] = { 0x0, SPR_PILLARS_BASE + 2, }; -static const PalSpriteID _bridge_sprite_table_3_poles[] = { - SPR_PILLARS_BASE + 6 * 0 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 4 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 4 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 5 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - 0x0, - - SPR_PILLARS_BASE + 6 * 0 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 1 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 1 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - SPR_PILLARS_BASE + 6 * 0 + 2 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_CONCRETE), - 0x0, - - 0x0, - 0x0, -}; - static const PalSpriteID _bridge_sprite_table_1_1[] = { 0x986, 0x988, 0x985, 0x987, 0x98A, 0x98C, 0x989, 0x98B, 0x98E | PALETTE_TO_STRUCT_RED, 0x990 | PALETTE_TO_STRUCT_RED, 0x98D | PALETTE_TO_STRUCT_RED, 0x98F | PALETTE_TO_STRUCT_RED, 0x992 | PALETTE_TO_STRUCT_RED, 0x994 | PALETTE_TO_STRUCT_RED, 0x991 | PALETTE_TO_STRUCT_RED, 0x993 | PALETTE_TO_STRUCT_RED, @@ -278,26 +199,6 @@ static const PalSpriteID _bridge_sprite_table_1_1[] = { 0x110F | PALETTE_TO_STRUCT_RED, 0x1111 | PALETTE_TO_STRUCT_RED, 0x110E | PALETTE_TO_STRUCT_RED, 0x1110 | PALETTE_TO_STRUCT_RED, 0x1113 | PALETTE_TO_STRUCT_RED, 0x1115 | PALETTE_TO_STRUCT_RED, 0x1112 | PALETTE_TO_STRUCT_RED, 0x1114 | PALETTE_TO_STRUCT_RED, }; -static const PalSpriteID _bridge_sprite_table_1_poles[] = { - SPR_PILLARS_BASE + 6 * 3 + 3, - SPR_PILLARS_BASE + 6 * 3 + 4, - SPR_PILLARS_BASE + 6 * 3 + 4, - SPR_PILLARS_BASE + 6 * 3 + 3, - SPR_PILLARS_BASE + 6 * 3 + 5, - 0x0, - - SPR_PILLARS_BASE + 6 * 3 + 0, - SPR_PILLARS_BASE + 6 * 3 + 1, - SPR_PILLARS_BASE + 6 * 3 + 1, - SPR_PILLARS_BASE + 6 * 3 + 0, - SPR_PILLARS_BASE + 6 * 3 + 2, - 0x0, - - 0x0, - 0x0, -}; - - static const PalSpriteID _bridge_sprite_table_6_0[] = { 0x9CD, 0x9D9, 0x0, 0x0, 0x9CE, 0x9DA, 0x0, 0x0, 0x9D3, 0x9D9, 0x0, 0x0, 0x9D4, 0x9DA, 0x0, 0x0, @@ -326,26 +227,6 @@ static const PalSpriteID _bridge_sprite_table_6_3[] = { 0x110F, 0x1111, 0x110E, 0x1110, 0x1113, 0x1115, 0x1112, 0x1114, }; -static const PalSpriteID _bridge_sprite_table_6_poles[] = { - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - - 2526, - 2528, -}; - - static const PalSpriteID _bridge_sprite_table_7_0[] = { 0x9CD | PALETTE_TO_STRUCT_BROWN, 0x9D9 | PALETTE_TO_STRUCT_BROWN, 0x0, 0x0, 0x9CE | PALETTE_TO_STRUCT_BROWN, 0x9DA | PALETTE_TO_STRUCT_BROWN, 0x0, 0x0, 0x9D3 | PALETTE_TO_STRUCT_BROWN, 0x9D9 | PALETTE_TO_STRUCT_BROWN, 0x0, 0x0, 0x9D4 | PALETTE_TO_STRUCT_BROWN, 0x9DA | PALETTE_TO_STRUCT_BROWN, 0x0, 0x0, @@ -374,25 +255,6 @@ static const PalSpriteID _bridge_sprite_table_7_3[] = { 0x110F | PALETTE_TO_STRUCT_BROWN, 0x1111 | PALETTE_TO_STRUCT_BROWN, 0x110E | PALETTE_TO_STRUCT_BROWN, 0x1110 | PALETTE_TO_STRUCT_BROWN, 0x1113 | PALETTE_TO_STRUCT_BROWN, 0x1115 | PALETTE_TO_STRUCT_BROWN, 0x1112 | PALETTE_TO_STRUCT_BROWN, 0x1114 | PALETTE_TO_STRUCT_BROWN, }; -static const PalSpriteID _bridge_sprite_table_7_poles[] = { - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - - 2526, - 2528, -}; - static const PalSpriteID _bridge_sprite_table_8_0[] = { 0x9CD | PALETTE_TO_STRUCT_RED, 0x9D9 | PALETTE_TO_STRUCT_RED, 0x0, 0x0, 0x9CE | PALETTE_TO_STRUCT_RED, 0x9DA | PALETTE_TO_STRUCT_RED, 0x0, 0x0, 0x9D3 | PALETTE_TO_STRUCT_RED, 0x9D9 | PALETTE_TO_STRUCT_RED, 0x0, 0x0, 0x9D4 | PALETTE_TO_STRUCT_RED, 0x9DA | PALETTE_TO_STRUCT_RED, 0x0, 0x0, @@ -421,25 +283,6 @@ static const PalSpriteID _bridge_sprite_table_8_3[] = { 0x110F | PALETTE_TO_STRUCT_RED, 0x1111 | PALETTE_TO_STRUCT_RED, 0x110E | PALETTE_TO_STRUCT_RED, 0x1110 | PALETTE_TO_STRUCT_RED, 0x1113 | PALETTE_TO_STRUCT_RED, 0x1115 | PALETTE_TO_STRUCT_RED, 0x1112 | PALETTE_TO_STRUCT_RED, 0x1114 | PALETTE_TO_STRUCT_RED, }; -static const PalSpriteID _bridge_sprite_table_8_poles[] = { - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - - 2526, - 2528, -}; - static const PalSpriteID _bridge_sprite_table_0_0[] = { 0x9F2, 0x9F6, 0x9F8, 0x0, 0x9F1, 0x9F5, 0x9F7, 0x0, 0x9F4, 0x9F6, 0x9F8, 0x0, 0x9F3, 0x9F5, 0x9F7, 0x0, @@ -454,26 +297,6 @@ static const PalSpriteID _bridge_sprite_table_0_1[] = { 0x112D, 0x112C, 0x112F, 0x112E, 0x1129, 0x1128, 0x112A, 0x112B, }; -static const PalSpriteID _bridge_sprite_table_0_poles[] = { - SPR_PILLARS_BASE + 6 * 1 + 3, - SPR_PILLARS_BASE + 6 * 1 + 3, - SPR_PILLARS_BASE + 6 * 1 + 3, - SPR_PILLARS_BASE + 6 * 1 + 3, - SPR_PILLARS_BASE + 6 * 1 + 5, - 0x0, - - SPR_PILLARS_BASE + 6 * 1 + 0, - SPR_PILLARS_BASE + 6 * 1 + 0, - SPR_PILLARS_BASE + 6 * 1 + 0, - SPR_PILLARS_BASE + 6 * 1 + 0, - SPR_PILLARS_BASE + 6 * 1 + 2, - 0x0, - - 0x0, - 0x0, -}; - - static const PalSpriteID _bridge_sprite_table_1_0[] = { 0x9BD | PALETTE_TO_STRUCT_RED, 0x9C1 | PALETTE_TO_STRUCT_RED, 0x9C9, 0x0, 0x9BE | PALETTE_TO_STRUCT_RED, 0x9C2 | PALETTE_TO_STRUCT_RED, 0x9CA, 0x0, 0x9BF | PALETTE_TO_STRUCT_RED, 0x9C1 | PALETTE_TO_STRUCT_RED, 0x9C9, 0x0, 0x9C0 | PALETTE_TO_STRUCT_RED, 0x9C2 | PALETTE_TO_STRUCT_RED, 0x9CA, 0x0, @@ -509,25 +332,6 @@ static const PalSpriteID _bridge_sprite_table_10_2[] = { 0xA1C, 0xA00, 0xA06, 0x0, 0xA1F, 0xA03, 0xA07, 0x0, }; -static const PalSpriteID _bridge_sprite_table_10_poles[] = { - SPR_PILLARS_BASE + 6 * 2 + 3, - SPR_PILLARS_BASE + 6 * 2 + 3, - SPR_PILLARS_BASE + 6 * 2 + 3, - SPR_PILLARS_BASE + 6 * 2 + 3, - SPR_PILLARS_BASE + 6 * 2 + 5, - 0x0, - - SPR_PILLARS_BASE + 6 * 2 + 0, - SPR_PILLARS_BASE + 6 * 2 + 0, - SPR_PILLARS_BASE + 6 * 2 + 0, - SPR_PILLARS_BASE + 6 * 2 + 0, - SPR_PILLARS_BASE + 6 * 2 + 2, - 0x0, - - 0x0, - 0x0, -}; - static const PalSpriteID _bridge_sprite_table_11_0[] = { 0xA0B | PALETTE_TO_STRUCT_YELLOW, 0xA01 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x0, 0xA0C | PALETTE_TO_STRUCT_YELLOW, 0xA02 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x0, 0xA11 | PALETTE_TO_STRUCT_YELLOW, 0xA01 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x0, 0xA12 | PALETTE_TO_STRUCT_YELLOW, 0xA02 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0x0, @@ -549,25 +353,6 @@ static const PalSpriteID _bridge_sprite_table_11_2[] = { 0xA1C | PALETTE_TO_STRUCT_YELLOW, 0xA00 | PALETTE_TO_STRUCT_YELLOW, 0xA06 | PALETTE_TO_STRUCT_YELLOW, 0x0, 0xA1F | PALETTE_TO_STRUCT_YELLOW, 0xA03 | PALETTE_TO_STRUCT_YELLOW, 0xA07 | PALETTE_TO_STRUCT_YELLOW, 0x0, }; -static const PalSpriteID _bridge_sprite_table_11_poles[] = { - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 5 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - 0x0, - - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - SPR_PILLARS_BASE + 6 * 2 + 2 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_YELLOW), - 0x0, - - 0x0, - 0x0, -}; - static const PalSpriteID _bridge_sprite_table_12_0[] = { 0xA0B | PALETTE_TO_STRUCT_GREY, 0xA01 | PALETTE_TO_STRUCT_GREY, 0x0, 0x0, 0xA0C | PALETTE_TO_STRUCT_GREY, 0xA02 | PALETTE_TO_STRUCT_GREY, 0x0, 0x0, 0xA11 | PALETTE_TO_STRUCT_GREY, 0xA01 | PALETTE_TO_STRUCT_GREY, 0x0, 0x0, 0xA12 | PALETTE_TO_STRUCT_GREY, 0xA02 | PALETTE_TO_STRUCT_GREY, 0x0, 0x0, @@ -589,25 +374,6 @@ static const PalSpriteID _bridge_sprite_table_12_2[] = { 0xA1C | PALETTE_TO_STRUCT_GREY, 0xA00 | PALETTE_TO_STRUCT_GREY, 0xA06 | PALETTE_TO_STRUCT_GREY, 0x0, 0xA1F | PALETTE_TO_STRUCT_GREY, 0xA03 | PALETTE_TO_STRUCT_GREY, 0xA07 | PALETTE_TO_STRUCT_GREY, 0x0, }; -static const PalSpriteID _bridge_sprite_table_12_poles[] = { - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 3 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 5 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - 0x0, - - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 0 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - SPR_PILLARS_BASE + 6 * 2 + 2 + (PALETTE_MODIFIER_COLOR | PALETTE_TO_STRUCT_GREY), - 0x0, - - 0x0, - 0x0, -}; - static const uint32 * const _bridge_sprite_table_2[] = { _bridge_sprite_table_2_0, _bridge_sprite_table_2_0, @@ -753,19 +519,3 @@ static const uint32 * const * const _bridge_sprite_table[MAX_BRIDGES] = { _bridge_sprite_table_11, _bridge_sprite_table_12 }; - -static const uint32 * const _bridge_poles_table[] = { - _bridge_sprite_table_0_poles, - _bridge_sprite_table_1_poles, - _bridge_sprite_table_2_poles, - _bridge_sprite_table_3_poles, - _bridge_sprite_table_4_poles, - _bridge_sprite_table_5_poles, - _bridge_sprite_table_6_poles, - _bridge_sprite_table_7_poles, - _bridge_sprite_table_8_poles, - _bridge_sprite_table_2_poles, - _bridge_sprite_table_10_poles, - _bridge_sprite_table_11_poles, - _bridge_sprite_table_12_poles -}; diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 8d7768919..194ae8675 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -98,6 +98,7 @@ static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table) } } +static inline byte GetBridgeFlags(int index) { return _bridge[index].flags;} /** check if bridge can be built on slope * direction 0 = X-axis, direction 1 = Y-axis @@ -817,30 +818,13 @@ static const byte _bridge_foundations[2][16] = { extern const byte _road_sloped_sprites[14]; -static void DrawBridgePillars(const TileInfo *ti, int x, int y, int z) +static void DrawBridgePillars(PalSpriteID image, const TileInfo *ti, int x, int y, int z) { - Axis axis = GetBridgeAxis(ti->tile); - const PalSpriteID *b; - PalSpriteID image; - int piece; - - b = _bridge_poles_table[GetBridgeType(ti->tile)]; - - // Draw first piece - // (necessary for cantilever bridges) - - image = b[axis == AXIS_X ? 12 : 13]; - piece = GetBridgePiece(ti->tile); - - if (image != 0 && piece != 0) { - if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image); - DrawGroundSpriteAt(image, x, y, z); - } - - image = b[piece + (axis == AXIS_X ? 0 : 6)]; - if (image != 0) { - int back_height, front_height, i=z; + Axis axis = GetBridgeAxis(ti->tile); + bool drawfarpillar = !HASBIT(GetBridgeFlags(GetBridgeType(ti->tile)), 0); + int back_height, front_height; + int i = z; const byte *p; static const byte _tileh_bits[4][8] = { @@ -862,12 +846,11 @@ static void DrawBridgePillars(const TileInfo *ti, int x, int y, int z) } for (; z >= front_height || z >= back_height; z = z - 8) { - if (z >= front_height) { - // front facing pillar + if (z >= front_height) { // front facing pillar AddSortableSpriteToDraw(image, x,y, p[4], p[5], 0x28, z); } - if (z >= back_height && z < i - 8) { - // back facing pillar + + if (drawfarpillar && z >= back_height && z < i - 8) { // back facing pillar AddSortableSpriteToDraw(image, x - p[6], y - p[7], p[4], p[5], 0x28, z); } } @@ -1066,7 +1049,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti) } } else if (_patches.bridge_pillars) { // draw pillars below for high bridges - DrawBridgePillars(ti, x, y, z); + DrawBridgePillars(b[2], ti, x, y, z); } } } |