From c8bed6fa87f7518cf272b11cd21ff2712a7f1cdc Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:32:57 -0700 Subject: [PATCH] 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 });