From 85e1326832ce6a57ae5f6ccfcd8a597cce6b3204 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 18 Dec 2021 22:27:10 +0100 Subject: [PATCH] Pass Ride ref to track_paint_util_draw_pier() --- src/openrct2/ride/TrackPaint.cpp | 10 +++++----- src/openrct2/ride/TrackPaint.h | 2 +- src/openrct2/ride/water/BoatHire.cpp | 4 ++-- src/openrct2/ride/water/SubmarineRide.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 7a8e2406e4..9fbfdec9ed 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -895,7 +895,7 @@ void track_paint_util_draw_narrow_station_platform( } void track_paint_util_draw_pier( - paint_session* session, const Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, + paint_session* session, const Ride& ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, int32_t height, const TrackElement& trackElement, uint8_t rotation) { if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -906,7 +906,7 @@ void track_paint_util_draw_pier( if (direction & 1) { - hasFence = track_paint_util_has_fence(EDGE_NE, position, trackElement, *ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, session->CurrentRotation); imageId = (hasFence ? SPR_STATION_PIER_EDGE_NE_FENCED : SPR_STATION_PIER_EDGE_NE) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 1 }, { 2, 0, height }); @@ -915,7 +915,7 @@ void track_paint_util_draw_pier( imageId = SPR_STATION_PIER_EDGE_SW | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 24, 0, height }, { 8, 32, 1 }); - hasFence = track_paint_util_has_fence(EDGE_SW, position, trackElement, *ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_STATION_PIER_FENCE_SW | session->TrackColours[SCHEME_SUPPORTS]; @@ -925,7 +925,7 @@ void track_paint_util_draw_pier( } else { - hasFence = track_paint_util_has_fence(EDGE_NW, position, trackElement, *ride, rotation); + hasFence = track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, rotation); imageId = (hasFence ? SPR_STATION_PIER_EDGE_NW_FENCED : SPR_STATION_PIER_EDGE_NW) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 1 }, { 0, 2, height }); @@ -934,7 +934,7 @@ void track_paint_util_draw_pier( imageId = SPR_STATION_PIER_EDGE_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 24, height }, { 32, 8, 1 }); - hasFence = track_paint_util_has_fence(EDGE_SE, position, trackElement, *ride, rotation); + hasFence = track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, rotation); if (hasFence) { imageId = SPR_STATION_PIER_FENCE_SE | session->TrackColours[SCHEME_SUPPORTS]; diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 1735938979..5c72068a28 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -308,7 +308,7 @@ void track_paint_util_draw_station_inverted( uint8_t stationVariant); bool track_paint_util_should_paint_supports(const CoordsXY& position); void track_paint_util_draw_pier( - paint_session* session, const Ride* ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, + paint_session* session, const Ride& ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, int32_t height, const TrackElement& trackElement, uint8_t rotation); void track_paint_util_draw_station_metal_supports( paint_session* session, Direction direction, uint16_t height, uint32_t colour); diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index ba0b90e403..89696854c8 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -71,13 +71,13 @@ static void paint_boat_hire_station( { paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); + session, *ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } else { paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); + session, *ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index d872f21e84..db7e2d070a 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -90,7 +90,7 @@ static void submarine_ride_paint_track_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); + session, *ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } else { @@ -99,7 +99,7 @@ static void submarine_ride_paint_track_station( paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); + session, *ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);