From 7c30f89a759bfac0830339a0c36de9086b0d9147 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Wed, 18 May 2016 22:57:43 +0200 Subject: [PATCH] Draw fences underground --- src/ride/track_paint.c | 4 ++++ src/ride/water/submarine_ride.c | 24 ++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index c64e5494cf..c636771e60 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -210,6 +210,10 @@ bool track_paint_util_should_paint_supports(rct_xy16 position) bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height) { + if (RCT2_GLOBAL(0x0141E9DB, uint8) & 3) { + return false; + } + uint32 imageId; uint32 baseImageId = entranceStyle->flags; int imageOffset; diff --git a/src/ride/water/submarine_ride.c b/src/ride/water/submarine_ride.c index eba9fc246f..6f61c671a8 100644 --- a/src/ride/water/submarine_ride.c +++ b/src/ride/water/submarine_ride.c @@ -127,14 +127,12 @@ static void submarine_ride_paint_track_station(uint8 rideIndex, uint8 trackSeque imageId = SPR_STATION_PIER_EDGE_SW | RCT2_GLOBAL(0x00F4419C, uint32); sub_98196C(imageId, 24, 0, 8, 32, 1, height, get_current_rotation()); - if (RCT2_GLOBAL(0x0141E9DB, uint8) & 3) { - hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation()); - if (hasFence) { - imageId = SPR_STATION_PIER_FENCE_SW | RCT2_GLOBAL(0x00F4419C, uint32); - sub_98196C(imageId, 31, 0, 1, 32, 7, height + 2, get_current_rotation()); - } - track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height); + hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + imageId = SPR_STATION_PIER_FENCE_SW | RCT2_GLOBAL(0x00F4419C, uint32); + sub_98196C(imageId, 31, 0, 1, 32, 7, height + 2, get_current_rotation()); } + track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height); } else { imageId = SPR_SUBMARINE_RIDE_FLAT_NE_SW | RCT2_GLOBAL(0x00F44198, uint32); @@ -149,14 +147,12 @@ static void submarine_ride_paint_track_station(uint8 rideIndex, uint8 trackSeque imageId = SPR_STATION_PIER_EDGE_SE | RCT2_GLOBAL(0x00F4419C, uint32); sub_98196C(imageId, 0, 24, 32, 8, 1, height, get_current_rotation()); - if (RCT2_GLOBAL(0x0141E9DB, uint8) & 3) { - hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation()); - if (hasFence) { - imageId = SPR_STATION_PIER_FENCE_SE | RCT2_GLOBAL(0x00F4419C, uint32); - sub_98196C(imageId, 0, 31, 32, 1, 7, height + 2, get_current_rotation()); - } - track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height); + hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + imageId = SPR_STATION_PIER_FENCE_SE | RCT2_GLOBAL(0x00F4419C, uint32); + sub_98196C(imageId, 0, 31, 32, 1, 7, height + 2, get_current_rotation()); } + track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height); } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);