From c8bed6fa87f7518cf272b11cd21ff2712a7f1cdc Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:32:57 -0700 Subject: [PATCH 1/4] tower rides and slide --- src/openrct2/ride/TrackPaint.cpp | 22 +++++++++++++++++++ src/openrct2/ride/TrackPaint.h | 3 +++ src/openrct2/ride/gentle/ObservationTower.cpp | 10 ++++++--- src/openrct2/ride/gentle/SpiralSlide.cpp | 13 +++++++++-- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 15 +++++++------ src/openrct2/ride/thrill/RotoDrop.cpp | 10 ++++++--- 6 files changed, 58 insertions(+), 15 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 3129a1c031..b2529b4da2 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -119,6 +119,20 @@ const uint32_t floorSpritesCork[] = { SPR_FLOOR_CORK }; +const uint32_t floorSpritesMetal[] = { + SPR_FLOOR_METAL, + SPR_FLOOR_METAL, + SPR_FLOOR_METAL, + SPR_FLOOR_METAL +}; + +const uint32_t floorSpritesMetalB[] = { + SPR_FLOOR_METAL_B, + SPR_FLOOR_METAL_B, + SPR_FLOOR_METAL_B, + SPR_FLOOR_METAL_B +}; + const uint32_t fenceSpritesRope[] = { SPR_FENCE_ROPE_NE, SPR_FENCE_ROPE_SE, @@ -126,6 +140,14 @@ const uint32_t fenceSpritesRope[] = { SPR_FENCE_ROPE_NW }; +const uint32_t fenceSpritesMetal[] = { + SPR_FENCE_METAL_NE, + SPR_FENCE_METAL_SE, + SPR_FENCE_METAL_SW, + SPR_FENCE_METAL_NW +}; + + const uint32_t fenceSpritesMetalB[] = { SPR_FENCE_METAL_B_NE, SPR_FENCE_METAL_B_SE, diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 5f7139116e..6c28ff0e73 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -240,8 +240,11 @@ enum }; extern const uint32_t floorSpritesCork[]; +extern const uint32_t floorSpritesMetal[]; +extern const uint32_t floorSpritesMetalB[]; extern const uint32_t fenceSpritesRope[]; +extern const uint32_t fenceSpritesMetal[]; extern const uint32_t fenceSpritesMetalB[]; extern const uint32_t trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4][3]; diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index ac23f41455..375d460b17 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -94,8 +94,12 @@ static void paint_observation_tower_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor( + session, edges, session->TrackColours[SCHEME_SUPPORTS], height, floorSpritesMetalB, stationObject); if (ride != nullptr) { @@ -106,7 +110,7 @@ static void paint_observation_tower_base( if (trackSequence == 0) { - imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; + uint32_t imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 8e895952f9..caff183ff1 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -12,6 +12,7 @@ #include "../../paint/Supports.h" #include "../Track.h" #include "../TrackPaint.h" +#include "../../object/StationObject.h" enum { @@ -201,8 +202,16 @@ static void paint_spiral_slide( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); // Base - uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + if(stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) + | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + } if (ride != nullptr) { diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 9309b5262e..d9dd4c7ae3 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -24,9 +24,6 @@ enum SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT_TOP = 14566, }; -static constexpr const uint32_t launched_freefall_fence_sprites[] = { SPR_FENCE_METAL_NE, SPR_FENCE_METAL_SE, - SPR_FENCE_METAL_SW, SPR_FENCE_METAL_NW }; - /** * * rct2: 0x006D5FAB @@ -96,19 +93,23 @@ static void paint_launched_freefall_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor( + session, edges, session->TrackColours[SCHEME_SUPPORTS], height, floorSpritesMetal, stationObject); if (ride != nullptr) { track_paint_util_paint_fences( session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, - launched_freefall_fence_sprites, session->CurrentRotation); + fenceSpritesMetal, session->CurrentRotation); } if (trackSequence == 0) { - imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | session->TrackColours[SCHEME_TRACK]; + uint32_t imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); height += 32; diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 0ff5bf1f9f..e2a7f15dd3 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -106,8 +106,12 @@ static void paint_roto_drop_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor( + session, edges, session->TrackColours[SCHEME_SUPPORTS], height, floorSpritesMetalB, stationObject); if (ride != nullptr) { @@ -118,7 +122,7 @@ static void paint_roto_drop_base( if (trackSequence == 0) { - imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) + uint32_t imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); From c248c8fada759c46a3de9874d18f0afaf8c81e42 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:38:37 -0700 Subject: [PATCH 2/4] format spiralslide --- src/openrct2/ride/gentle/SpiralSlide.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index caff183ff1..6e98da0ee9 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -8,11 +8,11 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../Track.h" #include "../TrackPaint.h" -#include "../../object/StationObject.h" enum { @@ -206,7 +206,7 @@ static void paint_spiral_slide( if (ride != nullptr) stationObject = ride_get_station_object(ride); - if(stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; From 77d546f39d7ec5621bf0831cc3f1da5538b38b38 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:56:56 -0700 Subject: [PATCH 3/4] dodgems and flying saucers --- src/openrct2/ride/gentle/Dodgems.cpp | 78 ++++++++++++---------- src/openrct2/ride/gentle/FlyingSaucers.cpp | 12 +++- 2 files changed, 53 insertions(+), 37 deletions(-) diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index c960e9caf2..fc2a81f38b 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../util/Util.h" @@ -47,45 +48,52 @@ static void paint_dodgems( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); - + StationObject* stationObject = nullptr; if (ride != nullptr) - { - track_paint_util_paint_fences( - session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, - dodgems_fence_sprites, session->CurrentRotation); - } + stationObject = ride_get_station_object(ride); - switch (direction) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - case 2: - trackSequence = 15 - trackSequence; - [[fallthrough]]; - case 0: - if ((trackSequence / 4) & 1) - { - paint_dodgems_roof(session, height + 30, 0); - } - else - { - paint_dodgems_roof(session, height + 30, 2); - } - break; + uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); - case 3: - trackSequence = 15 - trackSequence; - [[fallthrough]]; - case 1: - if ((trackSequence / 4) & 1) - { - paint_dodgems_roof(session, height + 30, 1); - } - else - { - paint_dodgems_roof(session, height + 30, 3); - } - break; + if (ride != nullptr) + { + track_paint_util_paint_fences( + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, + dodgems_fence_sprites, session->CurrentRotation); + } + + switch (direction) + { + case 2: + trackSequence = 15 - trackSequence; + [[fallthrough]]; + case 0: + if ((trackSequence / 4) & 1) + { + paint_dodgems_roof(session, height + 30, 0); + } + else + { + paint_dodgems_roof(session, height + 30, 2); + } + break; + + case 3: + trackSequence = 15 - trackSequence; + [[fallthrough]]; + case 1: + if ((trackSequence / 4) & 1) + { + paint_dodgems_roof(session, height + 30, 1); + } + else + { + paint_dodgems_roof(session, height + 30, 3); + } + break; + } } paint_util_set_segment_support_height(session, SEGMENTS_ALL, height + 36, 0x20); diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index bb974de89b..f19348b83b 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../Track.h" @@ -42,8 +43,15 @@ static void paint_flying_saucers( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLYING_SAUCERS_FLOOR | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + uint32_t imageId = SPR_FLYING_SAUCERS_FLOOR | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); + } if (ride != nullptr) { From bb1d3ab6379cdbf9daad3a46963c1973170bc2c0 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Tue, 31 Aug 2021 00:08:03 -0700 Subject: [PATCH 4/4] swinging rides --- src/openrct2/ride/thrill/MagicCarpet.cpp | 11 +- .../ride/thrill/SwingingInverterShip.cpp | 48 +++-- src/openrct2/ride/thrill/SwingingShip.cpp | 175 ++++++++++-------- 3 files changed, 133 insertions(+), 101 deletions(-) diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 44d609520f..36b1e2fc6e 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Entity.h" @@ -237,9 +238,15 @@ static void paint_magic_carpet( metal_a_supports_paint_setup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); - uint32_t imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + uint32_t imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + } break; } diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 4972e34039..faca18d95b 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Entity.h" @@ -129,6 +130,10 @@ static void paint_swinging_inverter_ship( uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; uint32_t imageId; + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + if (relativeTrackSequence != 1 && relativeTrackSequence != 3) { if (direction & 1) @@ -142,27 +147,30 @@ static void paint_swinging_inverter_ship( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); - - switch (direction) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - case 0: - imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); - break; - case 1: - imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); - break; - case 2: - imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height); - break; - case 3: - imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height); - break; + imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + + switch (direction) + { + case 0: + imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); + break; + case 1: + imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); + break; + case 2: + imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height); + break; + case 3: + imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height); + break; + } } } diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 2ee85c3713..a923b133b7 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Entity.h" @@ -184,6 +185,10 @@ static void paint_swinging_ship( uint32_t imageId; bool hasFence; + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + if (relativeTrackSequence == 1 || relativeTrackSequence == 4) { wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); @@ -193,111 +198,123 @@ static void paint_swinging_ship( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); - imageId = SPR_STATION_BASE_A_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + imageId = SPR_STATION_BASE_A_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + } } else { metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); - imageId = SPR_STATION_BASE_A_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + imageId = SPR_STATION_BASE_A_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + } } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - if (direction & 1) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - if (relativeTrackSequence != 1 && relativeTrackSequence != 4) + if (direction & 1) { - hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 2) + if (relativeTrackSequence != 1 && relativeTrackSequence != 4) { - imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) - | session->TrackColours[SCHEME_TRACK]; - } - else - { - imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE) - | session->TrackColours[SCHEME_TRACK]; - } - PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height + 9); - - imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE) - | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); - - hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 3) - { - if (hasFence) + hasFence = track_paint_util_has_fence( + EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 2) { - imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) + | session->TrackColours[SCHEME_TRACK]; + } + else + { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE) + | session->TrackColours[SCHEME_TRACK]; + } + PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height + 9); + + imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE) + | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); + + hasFence = track_paint_util_has_fence( + EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 3) + { + if (hasFence) + { + imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); + } + else + { + imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 23, 31, height + 11 }, { 8, 1, 7 }); + } + + imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 8, 1, 7 }); + } + else if (hasFence) + { + imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } - else - { - imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 23, 31, height + 11 }, { 8, 1, 7 }); - } - - imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 8, 1, 7 }); - } - else if (hasFence) - { - imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } } - } - else - { - if (relativeTrackSequence != 1 && relativeTrackSequence != 4) + else { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 2) + if (relativeTrackSequence != 1 && relativeTrackSequence != 4) { - imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) - | session->TrackColours[SCHEME_TRACK]; - } - else - { - imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE) - | session->TrackColours[SCHEME_TRACK]; - } - PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height + 9); - - imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE) - | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); - - hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 3) - { - if (hasFence) + hasFence = track_paint_util_has_fence( + EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 2) { - imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) + | session->TrackColours[SCHEME_TRACK]; + } + else + { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE) + | session->TrackColours[SCHEME_TRACK]; + } + PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height + 9); + + imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE) + | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); + + hasFence = track_paint_util_has_fence( + EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 3) + { + if (hasFence) + { + imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); + } + else + { + imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 31, 23, height + 11 }, { 1, 8, 7 }); + } + + imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 8, 7 }); + } + else if (hasFence) + { + imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } - else - { - imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 31, 23, height + 11 }, { 1, 8, 7 }); - } - - imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 8, 7 }); - } - else if (hasFence) - { - imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } } } - switch (relativeTrackSequence) { case 1: