From 6c233ac802bdbdd602af01f6d9eece8b225decb9 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 20:59:32 +0300 Subject: [PATCH 01/10] Remove first overload of PaintAddImageAsParent --- src/openrct2/paint/Paint.cpp | 8 --- src/openrct2/paint/Paint.h | 3 -- src/openrct2/paint/Supports.cpp | 49 ++++++++++--------- .../paint/tile_element/Paint.Path.cpp | 2 +- .../paint/tile_element/Paint.Surface.cpp | 4 +- src/openrct2/ride/TrackPaint.cpp | 14 +++--- .../ride/coaster/JuniorRollerCoaster.cpp | 16 +++--- src/openrct2/ride/coaster/WildMouse.cpp | 13 +++-- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 4 +- src/openrct2/ride/gentle/Dodgems.cpp | 2 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 2 +- .../ride/thrill/SwingingInverterShip.cpp | 6 +-- src/openrct2/ride/thrill/SwingingShip.cpp | 24 ++++----- src/openrct2/ride/transport/Monorail.cpp | 12 ++--- src/openrct2/ride/water/LogFlume.cpp | 4 +- src/openrct2/ride/water/SplashBoats.cpp | 4 +- 16 files changed, 74 insertions(+), 93 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index f4d9913b37..fdd116504f 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -727,14 +727,6 @@ paint_struct* PaintAddImageAsParent( return PaintAddImageAsParent(session, image_id, offset, boundBoxSize, offset); } -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset) -{ - return PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }); -} - /** * rct2: 0x00686806, 0x006869B2, 0x00686B6F, 0x00686D31, 0x0098197C * diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 9fbd29d124..6f1c2554eb 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -267,9 +267,6 @@ extern bool gPaintBoundingBoxes; extern bool gPaintBlockedTiles; extern bool gPaintWidePathsAsGhost; -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset); paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); paint_struct* PaintAddImageAsParent( diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index d42d93c05e..8f40666645 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -757,8 +757,8 @@ bool wooden_b_supports_paint_setup( if (baseHeight & 0x10 || heightSteps == 1 || baseHeight + 16 == session->WaterHeight) { PaintAddImageAsParent( - session, WoodenSupportImageIds[supportType].half | imageColourFlags, 0, 0, 32, 32, - ((heightSteps == 1) ? 7 : 12), baseHeight); + session, WoodenSupportImageIds[supportType].half | imageColourFlags, { 0, 0, baseHeight }, + { 32, 32, ((heightSteps == 1) ? 7 : 12) }); heightSteps -= 1; baseHeight += 16; _9E32B1 = true; @@ -766,8 +766,8 @@ bool wooden_b_supports_paint_setup( else { PaintAddImageAsParent( - session, WoodenSupportImageIds[supportType].full | imageColourFlags, 0, 0, 32, 32, - ((heightSteps == 2) ? 23 : 28), baseHeight); + session, WoodenSupportImageIds[supportType].full | imageColourFlags, { 0, 0, baseHeight }, + { 32, 32, ((heightSteps == 2) ? 23 : 28) }); heightSteps -= 2; baseHeight += 32; _9E32B1 = true; @@ -1082,8 +1082,9 @@ bool metal_b_supports_paint_setup( PaintAddImageAsParent( session, _metalSupportTypeToCrossbeamImages[supportType][ebp] | imageColourFlags, - SupportBoundBoxes[originalSegment].x + loc_97B052[ebp].x, SupportBoundBoxes[originalSegment].y + loc_97B052[ebp].y, - _97B062[ebp].x, _97B062[ebp].y, 1, baseHeight); + { SupportBoundBoxes[originalSegment].x + loc_97B052[ebp].x, + SupportBoundBoxes[originalSegment].y + loc_97B052[ebp].y, baseHeight }, + { _97B062[ebp].x, _97B062[ebp].y, 1 }); } int32_t si = baseHeight; @@ -1099,8 +1100,8 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].base_id + imageOffset; PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, 5, - supportSegments[segment].height); + session, imageId | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, supportSegments[segment].height }, { 0, 0, 5 }); baseHeight = supportSegments[segment].height + 6; } @@ -1115,8 +1116,8 @@ bool metal_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (_97B15C[supportType].beam_id + (heightDiff - 1)) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, heightDiff - 1, baseHeight); + session, (_97B15C[supportType].beam_id + (heightDiff - 1)) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1151,8 +1152,8 @@ bool metal_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, - beamLength - 1, baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, + { 0, 0, beamLength - 1 }); baseHeight += beamLength; i++; @@ -1237,7 +1238,8 @@ bool path_a_supports_paint_setup( if (session->Support.slope & 0x20) { // save dx2 - PaintAddImageAsParent(session, (railingEntry->bridge_image + 48) | imageColourFlags, 0, 0, 32, 32, 0, baseHeight - 2); + PaintAddImageAsParent( + session, (railingEntry->bridge_image + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); hasSupports = true; } else if (session->Support.slope & 0x10) @@ -1287,7 +1289,8 @@ bool path_a_supports_paint_setup( { uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 23; - PaintAddImageAsParent(session, imageId | imageColourFlags, 0, 0, 32, 32, ((heightSteps == 1) ? 7 : 12), baseHeight); + PaintAddImageAsParent( + session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 1) ? 7 : 12) }); heightSteps -= 1; baseHeight += 16; hasSupports = true; @@ -1297,7 +1300,7 @@ bool path_a_supports_paint_setup( uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 22; PaintAddImageAsParent( - session, imageId | imageColourFlags, 0, 0, 32, 32, ((heightSteps == 2) ? 23 : 28), baseHeight); + session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 2) ? 23 : 28) }); heightSteps -= 2; baseHeight += 32; hasSupports = true; @@ -1385,8 +1388,8 @@ bool path_b_supports_paint_setup( baseHeight = supportSegments[segment].height; PaintAddImageAsParent( - session, (railingEntry->bridge_image + 37 + imageOffset) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, 5, baseHeight); + session, (railingEntry->bridge_image + 37 + imageOffset) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, 5 }); baseHeight += 6; } @@ -1404,8 +1407,8 @@ bool path_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, heightDiff - 1, baseHeight); + session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1437,8 +1440,8 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, (z - 1), baseHeight); + session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1455,8 +1458,8 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, (z - 1), - baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, + { 0, 0, (z - 1) }); baseHeight += z; } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 1ce3286ba4..7a4c00666a 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -928,7 +928,7 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE } PaintAddImageAsParent( - session, imageId | patrolColour << 19 | IMAGE_TYPE_REMAP, 16, 16, 1, 1, 0, patrolAreaBaseZ + 2); + session, imageId | patrolColour << 19 | IMAGE_TYPE_REMAP, { 16, 16, patrolAreaBaseZ + 2 }, { 1, 1, 0 }); } } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index ee89107d53..fb6f601787 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1037,7 +1037,7 @@ void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, co image_id += get_height_marker_offset(); image_id -= gMapBaseZ; - PaintAddImageAsParent(session, image_id, 16, 16, 1, 1, 0, height); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 1, 1, 0 }); } bool has_surface = false; @@ -1137,7 +1137,7 @@ void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, co { if ((spawn.x & 0xFFE0) == pos.x && (spawn.y & 0xFFE0) == pos.y) { - PaintAddImageAsParent(session, SPR_TERRAIN_SELECTION_SQUARE_SIMPLE, 0, 0, 32, 32, 16, spawn.z); + PaintAddImageAsParent(session, SPR_TERRAIN_SELECTION_SQUARE_SIMPLE, { 0, 0, spawn.z }, { 32, 32, 16 }); const int32_t offset = (direction_reverse(spawn.direction) + rotation) & 3; const uint32_t image_id = (PEEP_SPAWN_ARROW_0 + offset) | 0x20380000; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index bde96b1845..77389bf673 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1501,10 +1501,9 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_3( } const sprite_bb* spriteBB = &sprites[direction][sprite]; - uint32_t imageId = spriteBB->sprite_id | colourFlags; - PaintAddImageAsParent( - session, imageId, static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->bb_size.x, - spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z), height + spriteBB->offset.z); + const uint32_t imageId = spriteBB->sprite_id | colourFlags; + const auto& offset = spriteBB->offset; + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size); } void track_paint_util_right_quarter_turn_5_tiles_tunnel( @@ -1772,10 +1771,9 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_4( } const sprite_bb* spriteBB = &sprites[direction][sprite]; - uint32_t imageId = spriteBB->sprite_id | colourFlags; - PaintAddImageAsParent( - session, imageId, static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->bb_size.x, - spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z), height + spriteBB->offset.z); + const uint32_t imageId = spriteBB->sprite_id | colourFlags; + const auto& offset = spriteBB->offset; + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size); } void track_paint_util_right_quarter_turn_3_tiles_tunnel( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 9f86c51f2d..3b21211da5 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2732,13 +2732,11 @@ static void junior_rc_s_bend_left_paint_setup( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 1, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 1 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 1, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 1 }); } if (direction == 0 || direction == 2) @@ -2838,13 +2836,11 @@ static void junior_rc_s_bend_right_paint_setup( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 1, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 1 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 1, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 1 }); } if (direction == 0 || direction == 2) @@ -5643,14 +5639,14 @@ static void junior_rc_booster_paint_setup( if (direction & 1) { PaintAddImageAsParent( - session, SPR_JUNIOR_RC_BOOSTER_NE_SW | session->TrackColours[SCHEME_TRACK], 0, 0, 20, 32, 1, height); + session, SPR_JUNIOR_RC_BOOSTER_NE_SW | session->TrackColours[SCHEME_TRACK], { 0, 0, height }, { 20, 32, 1 }); paint_util_push_tunnel_right(session, height, TUNNEL_0); } else { PaintAddImageAsParent( - session, SPR_JUNIOR_RC_BOOSTER_NW_SE | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height); + session, SPR_JUNIOR_RC_BOOSTER_NW_SE | session->TrackColours[SCHEME_TRACK], { 0, 0, height }, { 32, 20, 1 }); paint_util_push_tunnel_left(session, height, TUNNEL_0); } diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 2549271f94..5f92eb6482 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -591,10 +591,10 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( { int32_t part = trackSequence == 0 ? 0 : 1; const sprite_bb* sbb = &imageIds[direction][part]; + const auto& offset = sbb->offset; PaintAddImageAsParent( - session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], static_cast(sbb->offset.x), - static_cast(sbb->offset.y), sbb->bb_size.x, sbb->bb_size.y, static_cast(sbb->bb_size.z), - height + static_cast(sbb->offset.z)); + session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], { offset.x, offset.y, height + offset.z }, + sbb->bb_size); } track_paint_util_right_quarter_turn_3_tiles_25_deg_down_tunnel( @@ -660,9 +660,8 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( int32_t part = trackSequence == 0 ? 0 : 1; const sprite_bb* sbb = &imageIds[direction][part]; PaintAddImageAsParent( - session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], static_cast(sbb->offset.x), - static_cast(sbb->offset.y), sbb->bb_size.x, sbb->bb_size.y, static_cast(sbb->bb_size.z), - height + static_cast(sbb->offset.z)); + session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], + { sbb->offset.x, sbb->offset.y, height + sbb->offset.z }, sbb->bb_size); } track_paint_util_right_quarter_turn_3_tiles_25_deg_up_tunnel(session, height, direction, trackSequence, TUNNEL_1, TUNNEL_2); @@ -736,7 +735,7 @@ static void wild_mouse_track_left_quarter_turn_1( PaintAddImageAsParent(session, imageId, 0, 0, 26, 24, 2, height, 6, 2, height); break; case 1: - PaintAddImageAsParent(session, imageId, 0, 0, 26, 26, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 2 }); break; case 2: PaintAddImageAsParent(session, imageId, 0, 0, 24, 26, 2, height, 2, 6, height); diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index dc54c46659..9887a15241 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -573,13 +573,13 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( PaintAddImageAsParent(session, imageId, 6, 0, 26, 24, 1, height, 6, 2, height); break; case 1: - PaintAddImageAsParent(session, imageId, 0, 0, 26, 26, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 1 }); break; case 2: PaintAddImageAsParent(session, imageId, 0, 6, 24, 26, 1, height, 2, 6, height); break; case 3: - PaintAddImageAsParent(session, imageId, 6, 6, 24, 24, 1, height); + PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); break; } wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 1860010dbe..024dd0c15f 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -31,7 +31,7 @@ static constexpr const uint32_t dodgems_fence_sprites[] = { SPR_DODGEMS_FENCE_TO static void paint_dodgems_roof(paint_session* session, int32_t height, int32_t offset) { uint32_t image_id = (SPR_DODGEMS_ROOF_FRAME + offset) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 0, 0, 32, 32, 2, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 32, 2 }); image_id = (SPR_DODGEMS_ROOF_GLASS + offset) | (EnumValue(FilterPaletteID::PaletteDarken3) << 19) | IMAGE_TYPE_TRANSPARENT; PaintAttachToPreviousPS(session, image_id, 0, 0); diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 3e717b963d..2504d31723 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -241,7 +241,7 @@ static void paint_magic_carpet( } uint32_t imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + 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 7e543f57b0..e8ef655a0d 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -143,17 +143,17 @@ static void paint_swinging_inverter_ship( } imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + 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, 32, 8, 1, height + 9); + 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, 8, 32, 1, height + 9); + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); break; case 2: imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 94d0a48909..ebc1cb3a7c 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -194,7 +194,7 @@ static void paint_swinging_ship( 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, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } else { @@ -202,7 +202,7 @@ static void paint_swinging_ship( 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, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -226,7 +226,7 @@ static void paint_swinging_ship( imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 24, 0, 8, 32, 1, height + 9); + 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) @@ -234,21 +234,21 @@ static void paint_swinging_ship( if (hasFence) { imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 32, 7, height + 11); + 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, 8, 1, 7, height + 11); + 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, 8, 1, 7, height + 11); + 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, 1, 32, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } } } @@ -271,7 +271,7 @@ static void paint_swinging_ship( imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 24, 32, 8, 1, height + 9); + 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) @@ -279,21 +279,21 @@ static void paint_swinging_ship( if (hasFence) { imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 31, 32, 1, 7, height + 11); + 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, 1, 8, 7, height + 11); + 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, 1, 8, 7, height + 11); + 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, 32, 1, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } } } diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 27c1e858b3..ab49c14d16 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -765,13 +765,11 @@ static void paint_monorail_track_s_bend_left( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 3, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 3 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 3, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 3 }); } if (direction == 0 || direction == 2) @@ -871,13 +869,11 @@ static void paint_monorail_track_s_bend_right( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 3, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 3 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 3, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 3 }); } if (direction == 0 || direction == 2) diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 0d73303c22..94130ba46f 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -196,7 +196,7 @@ static void paint_log_flume_track_station( { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; } - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); if (direction & 1) { @@ -755,7 +755,7 @@ static void paint_log_flume_track_on_ride_photo( const TrackElement& trackElement) { uint32_t imageId = SPR_STATION_BASE_D | IMAGE_TYPE_REMAP; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); if (direction & 1) { diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index e85581cb5d..fae611eba4 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -793,7 +793,7 @@ static void paint_splash_boats_station( PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height + 3); imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } else { @@ -802,7 +802,7 @@ static void paint_splash_boats_station( PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3); imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); From 7feea62ab344b63ea94aa407705946c7fc418ce5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 21:45:25 +0300 Subject: [PATCH 02/10] Remove overload of PaintAddImageAsParent with bbox offset --- src/openrct2/paint/Paint.cpp | 10 -- src/openrct2/paint/Paint.h | 4 - src/openrct2/paint/PaintHelpers.cpp | 8 +- src/openrct2/paint/Supports.cpp | 29 ++-- src/openrct2/paint/sprite/Paint.Litter.cpp | 2 +- src/openrct2/paint/sprite/Paint.Peep.cpp | 2 +- .../paint/tile_element/Paint.Banner.cpp | 6 +- .../paint/tile_element/Paint.Entrance.cpp | 13 +- .../paint/tile_element/Paint.LargeScenery.cpp | 3 +- .../paint/tile_element/Paint.Path.cpp | 36 ++--- .../paint/tile_element/Paint.SmallScenery.cpp | 8 +- .../paint/tile_element/Paint.Wall.cpp | 20 +-- src/openrct2/ride/TrackPaint.cpp | 56 +++---- src/openrct2/ride/VehiclePaint.cpp | 5 +- .../ride/coaster/JuniorRollerCoaster.cpp | 143 ++++++++++-------- .../ride/coaster/ReverseFreefallCoaster.cpp | 12 +- src/openrct2/ride/coaster/VirginiaReel.cpp | 27 ++-- src/openrct2/ride/coaster/WildMouse.cpp | 6 +- .../ride/coaster/WoodenRollerCoaster.cpp | 5 +- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 4 +- src/openrct2/ride/gentle/Circus.cpp | 3 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 4 +- src/openrct2/ride/gentle/Dodgems.cpp | 2 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 8 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 4 +- src/openrct2/ride/gentle/MiniGolf.cpp | 41 ++--- src/openrct2/ride/gentle/MiniHelicopters.cpp | 32 ++-- src/openrct2/ride/gentle/MonorailCycles.cpp | 12 +- src/openrct2/ride/gentle/ObservationTower.cpp | 14 +- src/openrct2/ride/gentle/SpaceRings.cpp | 6 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 18 +-- src/openrct2/ride/shops/Facility.cpp | 11 +- src/openrct2/ride/shops/Shop.cpp | 4 +- src/openrct2/ride/thrill/3dCinema.cpp | 3 +- src/openrct2/ride/thrill/Enterprise.cpp | 2 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 14 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 4 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 24 ++- src/openrct2/ride/thrill/RotoDrop.cpp | 14 +- .../ride/thrill/SwingingInverterShip.cpp | 8 +- src/openrct2/ride/thrill/SwingingShip.cpp | 4 +- src/openrct2/ride/thrill/Twist.cpp | 7 +- src/openrct2/ride/transport/Lift.cpp | 6 +- .../ride/transport/MiniatureRailway.cpp | 76 +++++----- src/openrct2/ride/transport/Monorail.cpp | 22 +-- src/openrct2/ride/water/RiverRapids.cpp | 3 +- src/openrct2/ride/water/SplashBoats.cpp | 12 +- src/openrct2/ride/water/SubmarineRide.cpp | 13 +- 48 files changed, 404 insertions(+), 366 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index fdd116504f..63508d5eba 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -761,16 +761,6 @@ paint_struct* PaintAddImageAsParent( return ps; } -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, - int32_t bound_box_offset_y, int32_t bound_box_offset_z) -{ - return PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, - { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); -} - /** * * rct2: 0x00686EF0, 0x00687056, 0x006871C8, 0x0068733C, 0x0098198C diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 6f1c2554eb..83db6e3c7b 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -269,10 +269,6 @@ extern bool gPaintWidePathsAsGhost; paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, - int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); diff --git a/src/openrct2/paint/PaintHelpers.cpp b/src/openrct2/paint/PaintHelpers.cpp index bc934fc77e..994c306c57 100644 --- a/src/openrct2/paint/PaintHelpers.cpp +++ b/src/openrct2/paint/PaintHelpers.cpp @@ -37,14 +37,14 @@ paint_struct* PaintAddImageAsParentRotated( if (direction & 1) { return PaintAddImageAsParent( - session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, - bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); + session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, + { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } else { return PaintAddImageAsParent( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } } diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 8f40666645..38336abb3e 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -607,8 +607,8 @@ bool wooden_a_supports_paint_setup( if (byte_97B23C[special].var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId, 0, 0, bBox.length.x, bBox.length.y, bBox.length.z, z, bBox.offset.x, bBox.offset.y, - bBox.offset.z + z); + session, imageId, { 0, 0, z }, { bBox.length.x, bBox.length.y, bBox.length.z }, + { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); hasSupports = true; } else @@ -701,7 +701,8 @@ bool wooden_b_supports_paint_setup( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; - PaintAddImageAsParent(session, (imageId + 4) | imageColourFlags, 0, 0, 32, 32, 3, baseHeight, 0, 0, baseHeight + 2); + PaintAddImageAsParent( + session, (imageId + 4) | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 3 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; _9E32B1 = true; @@ -792,8 +793,9 @@ bool wooden_b_supports_paint_setup( if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, 0, 0, boundBox.length.x, boundBox.length.y, boundBox.length.z, - baseHeight, boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight); + session, imageId | imageColourFlags, { 0, 0, baseHeight }, + { boundBox.length.x, boundBox.length.y, boundBox.length.z }, + { boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight }); _9E32B1 = true; } else @@ -1182,8 +1184,9 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].beam_id + (beamLength - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, - 0, 0, 0, baseHeight, SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height); + session, imageId | imageColourFlags, + { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height }); baseHeight += beamLength; } } @@ -1259,7 +1262,8 @@ bool path_a_supports_paint_setup( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; - PaintAddImageAsParent(session, (imageId + 4) | imageColourFlags, 0, 0, 32, 32, 11, baseHeight, 0, 0, baseHeight + 2); + PaintAddImageAsParent( + session, (imageId + 4) | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; hasSupports = true; @@ -1319,8 +1323,9 @@ bool path_a_supports_paint_setup( if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, 0, 0, boundBox.length.y, boundBox.length.x, boundBox.length.z, baseHeight, - boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z); + session, imageId | imageColourFlags, { 0, 0, baseHeight }, + { boundBox.length.y, boundBox.length.x, boundBox.length.z }, + { boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z }); hasSupports = true; } else @@ -1488,8 +1493,8 @@ bool path_b_supports_paint_setup( uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, 0, - baseHeight, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, + { 0, 0, 0 }, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }); baseHeight += z; } diff --git a/src/openrct2/paint/sprite/Paint.Litter.cpp b/src/openrct2/paint/sprite/Paint.Litter.cpp index e0fc132747..b06495eebc 100644 --- a/src/openrct2/paint/sprite/Paint.Litter.cpp +++ b/src/openrct2/paint/sprite/Paint.Litter.cpp @@ -83,5 +83,5 @@ template<> void PaintEntity(paint_session* session, const Litter* litter, int32_ // In the following call to PaintAddImageAsParent, we add 4 (instead of 2) to the // bound_box_offset_z to make sure litter is drawn on top of railways - PaintAddImageAsParent(session, image_id, 0, 0, 4, 4, -1, litter->z, -4, -4, litter->z + 4); + PaintAddImageAsParent(session, image_id, { 0, 0, litter->z }, { 4, 4, -1 }, { -4, -4, litter->z + 4 }); } diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 804e6f5026..7083f70fd2 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -80,7 +80,7 @@ template<> void PaintEntity(paint_session* session, const Peep* peep, int32_t im + imageOffset * 4; uint32_t imageId = baseImageId | peep->TshirtColour << 19 | peep->TrousersColour << 24 | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 5); + PaintAddImageAsParent(session, imageId, { 0, 0, peep->z }, { 1, 1, 11 }, { 0, 0, peep->z + 5 }); auto* guest = peep->As(); if (guest != nullptr) { diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index a3b6946732..44cd06cdd7 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -78,12 +78,14 @@ void PaintBanner(paint_session* session, uint8_t direction, int32_t height, cons image_id |= (banner->colour << 19) | IMAGE_TYPE_REMAP; } - PaintAddImageAsParent(session, image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z); + PaintAddImageAsParent( + session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); boundBoxOffset.x = BannerBoundBoxes[direction][1].x; boundBoxOffset.y = BannerBoundBoxes[direction][1].y; image_id++; - PaintAddImageAsParent(session, image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z); + PaintAddImageAsParent( + session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); // Opposite direction direction = direction_reverse(direction); diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 7db9c608ae..42b672386b 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -129,7 +129,7 @@ static void ride_entrance_exit_paint( int16_t lengthY = (direction & 1) ? 28 : 2; int16_t lengthX = (direction & 1) ? 2 : 28; - PaintAddImageAsParent(session, image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { lengthX, lengthY, ah }, { 2, 2, height }); if (transparant_image_id) { @@ -148,7 +148,8 @@ static void ride_entrance_exit_paint( image_id += 4; PaintAddImageAsParent( - session, image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height); + session, image_id, { 0, 0, height }, { lengthX, lengthY, ah }, + { (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height }); if (transparant_image_id) { @@ -260,7 +261,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 if (path_entry != nullptr) { image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; - PaintAddImageAsParent(session, image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 0x1C, 0 }, { 0, 2, height }); } entrance = static_cast(object_entry_get_chunk(ObjectType::ParkEntrance, 0)); @@ -269,7 +270,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 return; } image_id = (entrance->image_id + direction * 3) | ghost_id; - PaintAddImageAsParent(session, image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, 2, 2, height + 32); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 0x1C, 0x1C, 0x2F }, { 2, 2, height + 32 }); if ((direction + 1) & (1 << 1)) break; @@ -322,7 +323,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 return; } image_id = (entrance->image_id + part_index + direction * 3) | ghost_id; - PaintAddImageAsParent(session, image_id, 0, 0, 0x1A, di, 0x4F, height, 3, 3, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 0x1A, di, 0x4F }, { 3, 3, height }); break; } @@ -353,7 +354,7 @@ void PaintEntrance(paint_session* session, uint8_t direction, int32_t height, co uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16); image_id -= gMapBaseZ; - PaintAddImageAsParent(session, image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 1, 1, 0 }, { 31, 31, z + 64 }); } } diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 53f97ed098..88e21ec6b8 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -290,7 +290,8 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh boxlength.y = s98E3C4[esi].length.y; boxlength.z = boxlengthZ; PaintAddImageAsParent( - session, image_id, 0, 0, boxlength.x, boxlength.y, boxlengthZ, height, boxoffset.x, boxoffset.y, boxoffset.z); + session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, + { boxoffset.x, boxoffset.y, boxoffset.z }); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 7a4c00666a..7138dd62b5 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -370,8 +370,8 @@ static void sub_6A4101( case 3: PaintAddImageAsParent(session, 17 + base_image_id, { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( - session, 18 + base_image_id, 28, 0, 1, 28, 7, height, 28, 4, - height + 2); // bound_box_offset_y seems to be a bug + session, 18 + base_image_id, { 28, 0, height }, { 1, 28, 7 }, + { 28, 4, height + 2 }); // bound_box_offset_y seems to be a bug PaintAddImageAsParent(session, 25 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 0, 28, height + 2 }); break; case 4: @@ -403,8 +403,8 @@ static void sub_6A4101( case 12: PaintAddImageAsParent(session, 16 + base_image_id, { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( - session, 19 + base_image_id, 0, 28, 28, 1, 7, height, 4, 28, - height + 2); // bound_box_offset_x seems to be a bug + session, 19 + base_image_id, { 0, 28, height }, { 28, 1, 7 }, + { 4, 28, height + 2 }); // bound_box_offset_x seems to be a bug PaintAddImageAsParent(session, 27 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 28, 0, height + 2 }); break; default: @@ -435,14 +435,14 @@ static void sub_6A4101( // Draw pole in the back PaintAddImageAsParent( - session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z); + session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); // Draw pole in the front and banner boundBoxOffsets.x = BannerBoundBoxes[direction][1].x; boundBoxOffsets.y = BannerBoundBoxes[direction][1].y; imageId++; PaintAddImageAsParent( - session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z); + session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); direction--; // If text shown @@ -559,8 +559,8 @@ static void sub_6A4101( case 3: PaintAddImageAsParent(session, 3 + base_image_id, { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( - session, 4 + base_image_id, 28, 0, 1, 28, 7, height, 28, 4, - height + 2); // bound_box_offset_y seems to be a bug + session, 4 + base_image_id, { 28, 0, height }, { 1, 28, 7 }, + { 28, 4, height + 2 }); // bound_box_offset_y seems to be a bug if (!(drawnCorners & FOOTPATH_CORNER_0)) { PaintAddImageAsParent(session, 11 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 0, 28, height + 2 }); @@ -585,8 +585,8 @@ static void sub_6A4101( case 12: PaintAddImageAsParent(session, 2 + base_image_id, { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( - session, 5 + base_image_id, 0, 28, 28, 1, 7, height, 4, 28, - height + 2); // bound_box_offset_x seems to be a bug + session, 5 + base_image_id, { 0, 28, height }, { 28, 1, 7 }, + { 4, 28, height + 2 }); // bound_box_offset_x seems to be a bug if (!(drawnCorners & FOOTPATH_CORNER_2)) { PaintAddImageAsParent(session, 13 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 28, 0, height + 2 }); @@ -1047,8 +1047,8 @@ void path_paint_box_support( if (!hasSupports || !session->DidPassSurface) { PaintAddImageAsParent( - session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, - height + boundingBoxZOffset); + session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); } else { @@ -1064,8 +1064,8 @@ void path_paint_box_support( } PaintAddImageAsParent( - session, image_id | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, - height + boundingBoxZOffset); + session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) @@ -1194,8 +1194,8 @@ void path_paint_pole_support( if (!hasSupports || !session->DidPassSurface) { PaintAddImageAsParent( - session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, - height + boundingBoxZOffset); + session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); } else { @@ -1213,8 +1213,8 @@ void path_paint_pole_support( } PaintAddImageAsParent( - session, bridgeImage | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, - boundBoxOffset.y, height + boundingBoxZOffset); + session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (pathElement.IsQueue() || pathElement.ShouldDrawPathOverSupports()) diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 7deaac180d..3de63b9e8d 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -159,8 +159,8 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED))) { PaintAddImageAsParent( - session, baseImageid, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, - boxoffset.y, boxoffset.z); + session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, + { boxoffset.x, boxoffset.y, boxoffset.z }); } if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) @@ -326,8 +326,8 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED)) { PaintAddImageAsParent( - session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, - boxoffset.y, boxoffset.z); + session, image_id, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, + { boxoffset.x, boxoffset.y, boxoffset.z }); } else { diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 49ab6dcc09..4bced75a05 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -60,16 +60,16 @@ static void PaintWallDoor( paint_struct* ps; ps = PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsR1.x, boundsR1.y, - static_cast(boundsR1.z), offset.z, boundsR1_.x, boundsR1_.y, boundsR1_.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { boundsR1.x, boundsR1.y, static_cast(boundsR1.z) }, { boundsR1_.x, boundsR1_.y, boundsR1_.z }); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; } ps = PaintAddImageAsParent( - session, imageId + 1, static_cast(offset.x), static_cast(offset.y), boundsR2.x, boundsR2.y, - static_cast(boundsR2.z), offset.z, boundsR2_.x, boundsR2_.y, boundsR2_.z); + session, imageId + 1, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { boundsR2.x, boundsR2.y, static_cast(boundsR2.z) }, { boundsR2_.x, boundsR2_.y, boundsR2_.z }); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -80,8 +80,8 @@ static void PaintWallDoor( paint_struct* ps; ps = PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsL1.x, boundsL1.y, - static_cast(boundsL1.z), offset.z, boundsL1_.x, boundsL1_.y, boundsL1_.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { boundsL1.x, boundsL1.y, static_cast(boundsL1.z) }, { boundsL1_.x, boundsL1_.y, boundsL1_.z }); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -118,8 +118,8 @@ static void PaintWallWall( } PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); if (dword_141F710 == 0) { imageId = baseImageId + dword_141F718; @@ -141,8 +141,8 @@ static void PaintWallWall( } paint_struct* paint = PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); if (paint != nullptr) { paint->tertiary_colour = tertiaryColour; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 77389bf673..52b33096c5 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -830,8 +830,8 @@ bool track_paint_util_draw_station_covers_2( { imageId = (baseImageId & ~IMAGE_TYPE_TRANSPARENT) + imageOffset; PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); uint32_t edi = session->TrackColours[SCHEME_TRACK] & (0b11111 << 19); @@ -845,8 +845,8 @@ bool track_paint_util_draw_station_covers_2( imageId = (baseImageId + imageOffset) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); return true; } @@ -1036,8 +1036,8 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[0], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1047,8 +1047,8 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[1], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1134,8 +1134,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[0], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1145,8 +1145,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[1], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1305,8 +1305,9 @@ void track_paint_util_eighth_to_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[direction][index], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[direction][index] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } constexpr CoordsXY defaultDiagTileOffsets[4] = { @@ -1346,8 +1347,8 @@ void track_paint_util_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = { @@ -1468,8 +1469,8 @@ void track_paint_util_right_quarter_turn_5_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } void track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -1485,9 +1486,10 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( const sprite_bb* spriteBB = &sprites[direction][sprite]; uint32_t imageId = spriteBB->sprite_id | colourFlags; PaintAddImageAsParent( - session, imageId, static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->bb_size.x, - spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z), height + spriteBB->offset.z, spriteBB->bb_offset.x, - spriteBB->bb_offset.y, height + spriteBB->bb_offset.z); + session, imageId, + { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), height + spriteBB->offset.z }, + { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, + { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); } void track_paint_util_right_quarter_turn_5_tiles_paint_3( @@ -1643,8 +1645,8 @@ void track_paint_util_right_quarter_turn_3_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_2( @@ -1754,10 +1756,10 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_3( } const sprite_bb* spriteBB = &sprites[direction][sprite]; PaintAddImageAsParent( - session, spriteBB->sprite_id | colourFlags, static_cast(spriteBB->offset.x), - static_cast(spriteBB->offset.y), spriteBB->bb_size.x, spriteBB->bb_size.y, - static_cast(spriteBB->bb_size.z), spriteBB->offset.z + height, spriteBB->bb_offset.x, spriteBB->bb_offset.y, - height + spriteBB->bb_offset.z); + session, spriteBB->sprite_id | colourFlags, + { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->offset.z + height }, + { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, + { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_4( diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index cd9ddfa79f..64f8c128a6 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -918,7 +918,8 @@ static void vehicle_sprite_paint( image_id |= CONSTRUCTION_MARKER; } paint_struct* ps = PaintAddImageAsParent( - session, image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z); + session, image_id, { 0, 0, z }, { bb.length_x, bb.length_y, bb.length_z }, + { bb.offset_x, bb.offset_y, bb.offset_z + z }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -3144,7 +3145,7 @@ template<> void PaintEntity(paint_session* session, const Vehicle* vehicle, int3 if (vehicle->IsCrashedVehicle) { uint32_t ebx = 22965 + vehicle->animation_frame; - PaintAddImageAsParent(session, ebx, 0, 0, 1, 1, 0, z, 0, 0, z + 2); + PaintAddImageAsParent(session, ebx, { 0, 0, z }, { 1, 1, 0 }, { 0, 0, z + 2 }); return; } diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 3b21211da5..7203e411fc 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2467,9 +2467,10 @@ static void junior_rc_left_bank_paint_setup( image_id = junior_rc_track_pieces_left_bank[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, image_id, 0, 0, junior_rc_left_bank_bound_lengths[direction].x, junior_rc_left_bank_bound_lengths[direction].y, - static_cast(junior_rc_left_bank_bound_lengths[direction].z), height, - junior_rc_left_bank_bound_offsets[direction].x, junior_rc_left_bank_bound_offsets[direction].y, height); + session, image_id, { 0, 0, height }, + { junior_rc_left_bank_bound_lengths[direction].x, junior_rc_left_bank_bound_lengths[direction].y, + static_cast(junior_rc_left_bank_bound_lengths[direction].z) }, + { junior_rc_left_bank_bound_offsets[direction].x, junior_rc_left_bank_bound_offsets[direction].y, height }); if (direction & 1) { @@ -3085,8 +3086,8 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( } if (imageId != 0) PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, 1, - height, boundsOffset.x, boundsOffset.y, height); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); if (direction == 0 && trackSequence == 0) { @@ -3164,8 +3165,8 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( } if (imageId != 0) PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, 1, - height, boundsOffset.x, boundsOffset.y, height); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); if (direction == 0 && trackSequence == 0) { @@ -4958,10 +4959,12 @@ void junior_rc_paint_track_60_deg_up( image_id |= junior_rc_track_pieces_60_deg_up[EnumValue(chainType)][direction]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), junior_rc_60_deg_up_bound_lengths[direction].x, - junior_rc_60_deg_up_bound_lengths[direction].y, junior_rc_60_deg_up_bound_thickness[direction], height, - junior_rc_60_deg_up_bound_offsets[direction].x, junior_rc_60_deg_up_bound_offsets[direction].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_60_deg_up_bound_lengths[direction].x, junior_rc_60_deg_up_bound_lengths[direction].y, + junior_rc_60_deg_up_bound_thickness[direction] }, + { junior_rc_60_deg_up_bound_offsets[direction].x, junior_rc_60_deg_up_bound_offsets[direction].y, height }); switch (direction) { @@ -5034,13 +5037,14 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); if (junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5049,13 +5053,14 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) @@ -5113,13 +5118,14 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); if (junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5128,13 +5134,14 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) @@ -5254,7 +5261,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( session, junior_rc_track_pieces_diag_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK], - -16, -16, 16, 16, 1, height, 0, 0, height); + { -16, -16, height }, { 16, 16, 1 }, { 0, 0, height }); } else { @@ -5286,7 +5293,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( session, junior_rc_track_pieces_diag_25_deg_down_to_60_deg_down[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK], - -16, -16, 16, 16, 1, height, 0, 0, height); + { -16, -16, height }, { 16, 16, 1 }, { 0, 0, height }); } else { @@ -5430,12 +5437,13 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction], height + 24, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height); + session, image_id, + { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x), + static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y), height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, + height }); if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) { @@ -5444,12 +5452,14 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, junior_rc_flat_to_60_deg_up_bound_thickness[direction], - height, junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x), + static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y), height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) @@ -5499,12 +5509,13 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction], height + 24, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height); + session, image_id, + { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].x), + static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].y), height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, + height }); if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) { @@ -5513,12 +5524,14 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, junior_rc_flat_to_60_deg_up_bound_thickness[direction], - height, junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x), + static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y), height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index 91595189b6..8487a3aba5 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -202,13 +202,13 @@ static void paint_reverse_freefall_rc_flat( if (direction & 1) { uint32_t imageId = SPR_REVERSE_FREEFALL_RC_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } else { uint32_t imageId = SPR_REVERSE_FREEFALL_RC_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } @@ -227,7 +227,7 @@ static void paint_reverse_freefall_rc_station( { // height -= 2 (height - 2) imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 1, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); // height += 2 (height) imageId = reverse_freefall_rc_track_pieces_station[direction] | session->TrackColours[SCHEME_TRACK]; @@ -241,7 +241,7 @@ static void paint_reverse_freefall_rc_station( { // height -= 2 (height - 2) imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 1, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); // height += 2 (height) imageId = reverse_freefall_rc_track_pieces_station[direction] | session->TrackColours[SCHEME_TRACK]; @@ -323,7 +323,7 @@ static void paint_reverse_freefall_rc_slope( { floorImageId = SPR_FLOOR_PLANKS | session->TrackColours[SCHEME_SUPPORTS]; } - PaintAddImageAsParent(session, floorImageId, 0, 0, 26, 26, 126, height, 3, 3, height); + PaintAddImageAsParent(session, floorImageId, { 0, 0, height }, { 26, 26, 126 }, { 3, 3, height }); PaintAddImageAsChildRotated( session, direction, supportsImageId, 0, 0, isDirection03 ? 26 : 18, 26, 126, height, isDirection03 ? 3 : 11, 3, height); @@ -365,7 +365,7 @@ static void paint_reverse_freefall_rc_vertical( case 0: supportsImageId = reverse_freefall_rc_track_pieces_vertical_supports[direction] | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, supportsImageId, 0, 0, 26, 26, 79, height, 3, 3, height); + PaintAddImageAsParent(session, supportsImageId, { 0, 0, height }, { 26, 26, 79 }, { 3, 3, height }); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 80, 0x20); break; diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index a503b317d6..ab308cd268 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -182,7 +182,8 @@ void vehicle_visual_virginia_reel( image_id = (image_id & 0x7FFFF) | CONSTRUCTION_MARKER; } PaintAddImageAsParent( - session, image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z); + session, image_id, { 0, 0, z }, { bb->length_x, bb->length_y, bb->length_z }, + { bb->offset_x, bb->offset_y, bb->offset_z + z }); if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost()) { @@ -221,12 +222,12 @@ static void paint_virginia_reel_track_flat( uint32_t imageId = sprites[direction] | session->TrackColours[SCHEME_TRACK]; if (direction & 1) { - PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } else { - PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } @@ -252,11 +253,11 @@ static void paint_virginia_reel_track_25_deg_up( if (direction & 1) { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); } else { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); } if (direction == 1 || direction == 2) @@ -304,27 +305,27 @@ static void paint_virginia_reel_track_flat_to_25_deg_up( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - ps = PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); session->WoodenSupportsPrependTo = ps; wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); break; case 2: - ps = PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); session->WoodenSupportsPrependTo = ps; wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); break; case 3: - PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); @@ -351,11 +352,11 @@ static void paint_virginia_reel_track_25_deg_up_to_flat( if (direction & 1) { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); } else { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); } if (direction == 1 || direction == 2) @@ -421,7 +422,7 @@ static void paint_virginia_reel_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 2 }, { 0, 2, height }); imageId = SPR_VIRGINIA_REEL_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 2, height, 0, 0, height); @@ -431,7 +432,7 @@ static void paint_virginia_reel_station( else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 2 }, { 2, 0, height }); imageId = SPR_VIRGINIA_REEL_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 2, height, 0, 0, height); diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 5f92eb6482..f93c77ea05 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -732,16 +732,16 @@ static void wild_mouse_track_left_quarter_turn_1( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, 0, 0, 26, 24, 2, height, 6, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 24, 2 }, { 6, 2, height }); break; case 1: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 2 }); break; case 2: - PaintAddImageAsParent(session, imageId, 0, 0, 24, 26, 2, height, 2, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 24, 26, 2 }, { 2, 6, height }); break; case 3: - PaintAddImageAsParent(session, imageId, 0, 0, 24, 24, 2, height, 6, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 24, 24, 2 }, { 6, 6, height }); break; } metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -1, height, session->TrackColours[SCHEME_SUPPORTS]); diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index e86761c50f..b3f6b94017 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -428,8 +428,9 @@ static void wooden_rc_track_paint_bb(paint_session* session, const sprite_bb_2* uint32_t railsImageId = bb->sprite_id_b | wooden_rc_get_rails_colour(session); PaintAddImageAsParent( - session, imageId, static_cast(bb->offset.x), static_cast(bb->offset.y), bb->bb_size.x, bb->bb_size.y, - static_cast(bb->bb_size.z), height + bb->offset.z, bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z); + session, imageId, { static_cast(bb->offset.x), static_cast(bb->offset.y), height + bb->offset.z }, + { bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z) }, + { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); PaintAddImageAsChild( session, railsImageId, static_cast(bb->offset.x), static_cast(bb->offset.y), bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z), height + bb->offset.z, bb->bb_offset.x, bb->bb_offset.y, diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index 9887a15241..282fb7bace 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -570,13 +570,13 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, 6, 0, 26, 24, 1, height, 6, 2, height); + PaintAddImageAsParent(session, imageId, { 6, 0, height }, { 26, 24, 1 }, { 6, 2, height }); break; case 1: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 1 }); break; case 2: - PaintAddImageAsParent(session, imageId, 0, 6, 24, 26, 1, height, 2, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 6, height }, { 24, 26, 1 }, { 2, 6, height }); break; case 3: PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index f0896c57c1..00ae90a9ed 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -43,7 +43,8 @@ static void paint_circus_tent( imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim); } - PaintAddImageAsParent(session, imageId | imageColourFlags, al, cl, 24, 24, 47, height + 3, al + 16, cl + 16, height + 3); + PaintAddImageAsParent( + session, imageId | imageColourFlags, { al, cl, height + 3 }, { 24, 24, 47 }, { al + 16, cl + 16, height + 3 }); session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = ViewportInteractionItem::Ride; diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index e8a8ff47e9..32286cb425 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -58,8 +58,8 @@ static void paint_crooked_house_structure( rct_crooked_house_bound_box boundBox = crooked_house_data[segment]; PaintAddImageAsParent( - session, image_id, x_offset, y_offset, boundBox.length_x, boundBox.length_y, 127, height + 3, boundBox.offset_x, - boundBox.offset_y, height + 3); + session, image_id, { x_offset, y_offset, height + 3 }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height + 3 }); } static void paint_crooked_house( diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 024dd0c15f..98c4069b18 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -48,7 +48,7 @@ static void paint_dodgems( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 30, 30, 1, height, 1, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); if (ride != nullptr) { diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index a52c950285..9e2b3b5005 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -93,8 +93,8 @@ static void paint_ferris_wheel_structure( imageId = (22150 + (direction & 1) * 2) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); imageId = (baseImageId + direction * 8 + imageOffset) | imageColourFlags; PaintAddImageAsChild( @@ -175,12 +175,12 @@ static void paint_ferris_wheel( { // Bound box is slightly different from track_paint_util_paint_fences imageId = SPR_FENCE_ROPE_SE | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 }); } if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, rotation)) { imageId = SPR_FENCE_ROPE_SW | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 32, 7, height, 30, 0, height + 2); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 30, 0, height + 2 }); } } diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 5a6d221340..0a6c80e1c3 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -58,8 +58,8 @@ static void paint_haunted_house_structure( uint32_t imageId = (baseImageId + direction) | session->TrackColours[SCHEME_MISC]; haunted_house_bound_box boundBox = haunted_house_data[part]; PaintAddImageAsParent( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); rct_drawpixelinfo* dpi = &session->DPI; if (dpi->zoom_level <= 0 && frameNum != 0) diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index c11a967c34..88cadb74d8 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -451,13 +451,13 @@ static paint_struct* mini_golf_paint_util_7c( if (direction & 1) { return PaintAddImageAsParent( - session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, - bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); + session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, + { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } return PaintAddImageAsParent( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const TrackElement& trackElement) @@ -691,7 +691,7 @@ static void paint_mini_golf_station( if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, -10, 0, 1, 32, 7, height, 0, 0, height + 2); + PaintAddImageAsParent(session, imageId, { -10, 0, height }, { 1, 32, 7 }, { 0, 0, height + 2 }); } bool hasSWFence = track_paint_util_has_fence( @@ -714,7 +714,7 @@ static void paint_mini_golf_station( if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, -10, 32, 1, 7, height, 0, 0, height + 2); + PaintAddImageAsParent(session, imageId, { 0, -10, height }, { 32, 1, 7 }, { 0, 0, height + 2 }); } bool hasSEFence = track_paint_util_has_fence( @@ -859,13 +859,13 @@ static void paint_mini_golf_hole_ab( imageId = sprites[direction][trackSequence][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); if (drewSupports) { imageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = sprites[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -875,7 +875,7 @@ static void paint_mini_golf_hole_ab( { imageId = sprites[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -943,7 +943,8 @@ static void paint_mini_golf_hole_c( break; default: PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); break; } @@ -951,7 +952,7 @@ static void paint_mini_golf_hole_c( { imageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -961,7 +962,7 @@ static void paint_mini_golf_hole_c( { imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -1026,7 +1027,8 @@ static void paint_mini_golf_hole_d( break; default: PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); break; } @@ -1044,7 +1046,7 @@ static void paint_mini_golf_hole_d( { imageId = ((supportType & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -1054,7 +1056,7 @@ static void paint_mini_golf_hole_d( { imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -1119,7 +1121,8 @@ static void paint_mini_golf_hole_e( break; default: PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); break; } @@ -1137,7 +1140,7 @@ static void paint_mini_golf_hole_e( { imageId = ((supportType & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -1147,7 +1150,7 @@ static void paint_mini_golf_hole_e( { imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -1239,7 +1242,7 @@ void vehicle_visual_mini_golf_player( uint32_t image_id = rideEntry->vehicles[0].base_image_id + 1 + ebx; uint32_t peep_palette = peep->TshirtColour << 19 | peep->TrousersColour << 24 | 0x0A0000000; - PaintAddImageAsParent(session, image_id | peep_palette, 0, 0, 1, 1, 11, z, 0, 0, z + 5); + PaintAddImageAsParent(session, image_id | peep_palette, { 0, 0, z }, { 1, 1, 11 }, { 0, 0, z + 5 }); } /** diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 6012898d68..f98551127d 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -26,7 +26,7 @@ static void paint_mini_helicopters_track_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 1, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 1, height, 0, 0, height); @@ -38,7 +38,7 @@ static void paint_mini_helicopters_track_station( else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 1, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 1, height, 0, 0, height); @@ -64,13 +64,13 @@ static void paint_mini_helicopters_track_flat( if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_0); } else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_0); } @@ -97,22 +97,22 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up( { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_0); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_2); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_2); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_0); break; } @@ -138,22 +138,22 @@ static void paint_mini_helicopters_track_25_deg_up( { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); break; } @@ -179,22 +179,22 @@ static void paint_mini_helicopters_track_25_deg_up_to_flat( { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height + 8, TUNNEL_12); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height + 8, TUNNEL_12); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); break; } diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index 6682ad9d8a..5183ec0f20 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -153,13 +153,13 @@ static paint_struct* paint_monorail_cycles_util_7c( if (flip) { return PaintAddImageAsParent( - session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, - bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); + session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, + { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } return PaintAddImageAsParent( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } /** rct2: 0x0088AD48 */ @@ -199,7 +199,7 @@ static void paint_monorail_cycles_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 1, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); imageId = SPR_MONORAIL_CYCLES_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 1, height, 0, 0, height); @@ -211,7 +211,7 @@ static void paint_monorail_cycles_station( else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 1, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); imageId = SPR_MONORAIL_CYCLES_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 1, height, 0, 0, height); diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index 1c1a74da4a..e530d90549 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -65,7 +65,7 @@ void vehicle_visual_observation_tower( { image_id = (image_id & 0x7FFFF) | CONSTRUCTION_MARKER; } - paint_struct* ps = PaintAddImageAsParent(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); + paint_struct* ps = PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -73,7 +73,7 @@ void vehicle_visual_observation_tower( image_id++; - ps = PaintAddImageAsParent(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); + ps = PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -95,7 +95,7 @@ static void paint_observation_tower_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { @@ -107,13 +107,13 @@ static void paint_observation_tower_base( if (trackSequence == 0) { imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 32, 8, 8, height + 32); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 32 }, { 2, 2, 30 }, { 8, 8, height + 32 }); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 64, 8, 8, height + 64); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 64 }, { 2, 2, 30 }, { 8, 8, height + 64 }); paint_util_set_vertical_tunnel(session, height + 96); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -170,7 +170,7 @@ static void paint_observation_tower_section( } uint32_t imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 5c1b6fc94c..e2dc0c6849 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -67,7 +67,7 @@ static void paint_space_rings_structure( } uint32_t imageId = (baseImageId + frameNum) | imageColourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 20, 23, height, -10, -10, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 20, 23 }, { -10, -10, height }); if (vehicle != nullptr && vehicle->num_peeps > 0) { @@ -111,12 +111,12 @@ static void paint_space_rings( if (track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation)) { imageId = SPR_SPACE_RINGS_FENCE_SW | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 2); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 29, 0, height + 2 }); } if (track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, session->CurrentRotation)) { imageId = SPR_SPACE_RINGS_FENCE_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 2); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 2 }); } break; default: diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 7ee8c220be..46ac648aa4 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -60,7 +60,7 @@ static void spiral_slide_paint_tile_right( if (direction == 3) image_id = SPIRAL_SLIDE_RIGHT_R3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 16, 108, height, 16, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 16, 108 }, { 16, 0, height + 3 }); } static void spiral_slide_paint_tile_left( @@ -78,7 +78,7 @@ static void spiral_slide_paint_tile_left( if (direction == 3) image_id = SPIRAL_SLIDE_LEFT_R3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 16, 108, height, 0, 16, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 16, 108 }, { 0, 16, height + 3 }); } static void spiral_slide_paint_tile_front( @@ -93,33 +93,33 @@ static void spiral_slide_paint_tile_front( if (direction == 1) { image_id = SPIRAL_SLIDE_INSIDE_R1 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 2, 16, 108, height, -12, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 2, 16, 108 }, { -12, 0, height + 3 }); } else if (direction == 2) { image_id = SPIRAL_SLIDE_INSIDE_R2 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 2, 108, height, 0, -12, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 2, 108 }, { 0, -12, height + 3 }); } if (direction == 0) { image_id = SPIRAL_SLIDE_CENTRE_R0 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 8, 108, height, 0, 8, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 8, 108 }, { 0, 8, height + 3 }); } else if (direction == 1) { image_id = SPIRAL_SLIDE_CENTRE_R1 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 2, 16, 108, height, 14, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 2, 16, 108 }, { 14, 0, height + 3 }); } else if (direction == 2) { image_id = SPIRAL_SLIDE_CENTRE_R2 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 2, 108, height, 0, 14, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 2, 108 }, { 0, 14, height + 3 }); } else if (direction == 3) { image_id = SPIRAL_SLIDE_CENTRE_R3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 8, 16, 108, height, 8, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 8, 16, 108 }, { 8, 0, height + 3 }); } rct_drawpixelinfo* dpi = &session->DPI; @@ -202,7 +202,7 @@ static void paint_spiral_slide( // Base uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index 5c69526cb0..d8028570f4 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -51,8 +51,8 @@ static void facility_paint_setup( uint32_t foundationImageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_3]; PaintAddImageAsParent( - session, foundationImageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, - height); + session, foundationImageId, { 0, 0, height }, { lengthX, lengthY, 29 }, + { direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height }); // Door image or base PaintAddImageAsChild( @@ -62,19 +62,20 @@ static void facility_paint_setup( { // Door image or base PaintAddImageAsParent( - session, imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height); + session, imageId, { 0, 0, height }, { lengthX, lengthY, 29 }, + { direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height }); } // Base image if door was drawn if (direction == 1) { imageId += 2; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 28, 29, height, 28, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 28, 29 }, { 28, 2, height }); } else if (direction == 2) { imageId += 4; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 2, 29, height, 2, 28, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 2, 29 }, { 2, 28, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index 806e457420..f4311ceb62 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -52,13 +52,13 @@ static void shop_paint_setup( { uint32_t foundationImageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_3]; - PaintAddImageAsParent(session, foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height); + PaintAddImageAsParent(session, foundationImageId, { 0, 0, height }, { 28, 28, 45 }, { 2, 2, height }); PaintAddImageAsChild(session, imageId, 0, 0, 28, 28, 45, height, 2, 2, height); } else { - PaintAddImageAsParent(session, imageId, 0, 0, 28, 28, 45, height, 2, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 28, 45 }, { 2, 2, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 75782a45e9..0546bd9603 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -42,7 +42,8 @@ static void paint_3d_cinema_structure( } uint32_t imageId = (rideEntry->vehicles[0].base_image_id + direction) | imageColourFlags; - PaintAddImageAsParent(session, imageId, xOffset, yOffset, 24, 24, 47, height + 3, xOffset + 16, yOffset + 16, height + 3); + PaintAddImageAsParent( + session, imageId, { xOffset, yOffset, height + 3 }, { 24, 24, 47 }, { xOffset + 16, yOffset + 16, height + 3 }); session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = ViewportInteractionItem::Ride; diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index a66a03451a..e88887aff6 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -53,7 +53,7 @@ static void paint_enterprise_structure( } uint32_t imageId = (baseImageId + imageOffset) | imageColourFlags; - PaintAddImageAsParent(session, imageId, xOffset, yOffset, 24, 24, 48, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { xOffset, yOffset, height }, { 24, 24, 48 }, { 0, 0, height }); rct_drawpixelinfo* dpi = &session->DPI; diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 4632ab5441..4881092781 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -44,11 +44,11 @@ void vehicle_visual_launched_freefall( // Draw back: int32_t baseImage_id = vehicleEntry->base_image_id + ((vehicle->restraints_position / 64) * 2); auto image_id = (baseImage_id + 2) | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); // Draw front: image_id = (baseImage_id + 1) | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); // Draw peeps: if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost()) @@ -97,7 +97,7 @@ static void paint_launched_freefall_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { @@ -109,15 +109,15 @@ static void paint_launched_freefall_base( if (trackSequence == 0) { imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); height += 32; imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); height += 32; imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); paint_util_set_vertical_tunnel(session, height + 32); @@ -171,7 +171,7 @@ static void paint_launched_freefall_tower_section( } uint32_t imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 2504d31723..4b274c6a08 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -85,8 +85,8 @@ static void paint_magic_carpet_frame( if (plane == PLANE_BACK) { PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bbSize.x, bbSize.y, 127, offset.z, - bbOffset.x, bbOffset.y, bbOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bbSize.x, bbSize.y, 127 }, { bbOffset.x, bbOffset.y, bbOffset.z }); } else { diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 6c6471dfed..3a45815cae 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -83,32 +83,38 @@ static void paint_motionsimulator_vehicle( case 0: // Simulator imageId = simulatorImageId; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX, offsetY, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 2, 44, offsetZ, offsetX, offsetY + 32, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 2, 44 }, { offsetX, offsetY + 32, offsetZ }); break; case 1: // Simulator imageId = simulatorImageId; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX, offsetY, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 2, 20, 44, offsetZ, offsetX + 34, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 2, 20, 44 }, { offsetX + 34, offsetY, offsetZ }); break; case 2: // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 2, 44, offsetZ, offsetX, offsetY - 10, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 2, 44 }, { offsetX, offsetY - 10, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY + 5, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX, offsetY + 5, offsetZ }); // Simulator imageId = simulatorImageId; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY + 5, offsetZ); @@ -116,10 +122,12 @@ static void paint_motionsimulator_vehicle( case 3: // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 2, 20, 44, offsetZ, offsetX - 10, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 2, 20, 44 }, { offsetX - 10, offsetY, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX + 5, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX + 5, offsetY, offsetZ }); // Simulator imageId = simulatorImageId; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX + 5, offsetY, offsetZ); diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 730c109e51..3840486e7a 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -52,11 +52,11 @@ void vehicle_visual_roto_drop( // Draw back: image_id = baseImage_id | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); // Draw front: image_id = (baseImage_id + 4) | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); if (vehicle->num_peeps > 0 && !vehicle->IsGhost()) { @@ -107,7 +107,7 @@ static void paint_roto_drop_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { @@ -120,15 +120,15 @@ static void paint_roto_drop_base( { imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 32, 8, 8, height + 32); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 32 }, { 2, 2, 30 }, { 8, 8, height + 32 }); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 64, 8, 8, height + 64); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 64 }, { 2, 2, 30 }, { 8, 8, height + 64 }); paint_util_set_vertical_tunnel(session, height + 96); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -186,7 +186,7 @@ static void paint_roto_drop_tower_section( } uint32_t imageId = SPR_ROTO_DROP_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index e8ef655a0d..4972e34039 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -101,8 +101,8 @@ static void paint_swinging_inverter_ship_structure( if (direction & 2) { PaintAddImageAsParent( - session, vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, vehicleImageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); PaintAddImageAsChild( session, frameImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height); @@ -110,8 +110,8 @@ static void paint_swinging_inverter_ship_structure( else { PaintAddImageAsParent( - session, frameImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, frameImageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); PaintAddImageAsChild( session, vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height); diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index ebc1cb3a7c..f6c5c5774d 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -113,8 +113,8 @@ static void paint_swinging_ship_structure( imageId = swinging_ship_frame_sprites[(direction & 1)][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, xOffset, yOffset, bounds.length_x, bounds.length_y, 80, height, bounds.offset_x, bounds.offset_y, - height); + session, imageId, { xOffset, yOffset, height }, { bounds.length_x, bounds.length_y, 80 }, + { bounds.offset_x, bounds.offset_y, height }); imageId = baseImageId | imageColourFlags; PaintAddImageAsChild( diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 66a6d0141a..53223392d9 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -57,7 +57,8 @@ static void paint_twist_structure( uint32_t structureFrameNum = frameNum % 24; uint32_t imageId = (baseImageId + structureFrameNum) | imageColourFlags; - PaintAddImageAsParent(session, imageId, xOffset, yOffset, 24, 24, 48, height, xOffset + 16, yOffset + 16, height); + PaintAddImageAsParent( + session, imageId, { xOffset, yOffset, height }, { 24, 24, 48 }, { xOffset + 16, yOffset + 16, height }); rct_drawpixelinfo* dpi = &session->DPI; @@ -102,12 +103,12 @@ static void paint_twist( if (track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation)) { imageId = SPR_FENCE_ROPE_SW | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 29, 0, height + 3 }); } if (track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation)) { imageId = SPR_FENCE_ROPE_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 }); } break; default: diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index b811949af0..a246809f4a 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -39,10 +39,10 @@ static void paint_lift_cage(paint_session* session, int8_t index, uint32_t colou uint32_t imageId; imageId = lift_cage_sprites[1 + index][0] | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 2, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 2, 2, height }); imageId = lift_cage_sprites[1 + index][1] | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 28, 28, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 28, 28, height }); } /** rct2: 0x0076C6CC */ @@ -75,7 +75,7 @@ static void paint_lift_base( int32_t edges = edges_3x3[trackSequence]; uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index b3d4cb4e50..1b5558df4c 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -1286,7 +1286,7 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( if (trackSequence == 1 && direction == 0) { uint32_t imageId = SPR_G2_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 8, 8, 2, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 8, 8, 2 }, { 0, 0, height }); } } else @@ -1443,7 +1443,8 @@ static void paint_miniature_railway_track_left_eighth_to_diag( offset = miniature_railway_track_pieces_right_eight_to_orthog_offset[direction][index]; } PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); } } else @@ -1453,7 +1454,8 @@ static void paint_miniature_railway_track_left_eighth_to_diag( CoordsXY offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1583,7 +1585,8 @@ static void paint_miniature_railway_track_right_eighth_to_diag( offset = miniature_railway_track_pieces_left_eight_to_orthog_offset[direction][index]; } PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); } } else @@ -1593,7 +1596,8 @@ static void paint_miniature_railway_track_right_eighth_to_diag( CoordsXY offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1709,8 +1713,8 @@ static void miniature_railway_track_diag_flat( if (isSupported) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height, floorBoundOffset.x, floorBoundOffset.y, height); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); if (drawRail) { PaintAddImageAsChild( @@ -1721,7 +1725,7 @@ static void miniature_railway_track_diag_flat( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, height); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1804,9 +1808,10 @@ static void miniature_railway_track_diag_25_deg_up( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1817,8 +1822,8 @@ static void miniature_railway_track_diag_25_deg_up( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + offsetB[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + offsetB[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1857,8 +1862,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height, floorBoundOffset.x, floorBoundOffset.y, height); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); if (drawRail) { PaintAddImageAsChild( @@ -1869,7 +1874,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, height); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1931,9 +1936,10 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1944,8 +1950,8 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + railOffsets[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + railOffsets[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -2006,9 +2012,10 @@ static void miniature_railway_track_diag_25_deg_down( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2019,8 +2026,8 @@ static void miniature_railway_track_diag_25_deg_down( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + railOffsets[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + railOffsets[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -2080,9 +2087,10 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2093,8 +2101,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + railOffsets[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + railOffsets[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -2131,8 +2139,8 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height, floorBoundOffset.x, floorBoundOffset.y, height); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); if (drawRail) { PaintAddImageAsChild( @@ -2143,7 +2151,7 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, height); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index ab49c14d16..65a534cc6a 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -469,12 +469,12 @@ static void paint_monorail_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 2 }, { 0, 2, height }); } else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 2 }, { 2, 0, height }); } } @@ -1003,7 +1003,7 @@ static void paint_monorail_track_left_eighth_to_diag( uint32_t imageId = ghost_train_track_pieces_left_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; const CoordsXY offset = ghost_train_track_pieces_left_eight_to_diag_offset[direction][index]; const CoordsXY bounds = ghost_train_track_pieces_left_eight_to_diag_bounds[direction][index]; - PaintAddImageAsParent(session, imageId, 0, 0, bounds.x, bounds.y, 2, height, offset.x, offset.y, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { bounds.x, bounds.y, 2 }, { offset.x, offset.y, height }); } switch (trackSequence) @@ -1071,7 +1071,7 @@ static void paint_monorail_track_right_eighth_to_diag( uint32_t imageId = ghost_train_track_pieces_right_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; const CoordsXY offset = ghost_train_track_pieces_right_eight_to_diag_offset[direction][index]; const CoordsXY bounds = ghost_train_track_pieces_right_eight_to_diag_bounds[direction][index]; - PaintAddImageAsParent(session, imageId, 0, 0, bounds.x, bounds.y, 2, height, offset.x, offset.y, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { bounds.x, bounds.y, 2 }, { offset.x, offset.y, height }); } switch (trackSequence) @@ -1170,7 +1170,7 @@ static void paint_monorail_track_diag_flat( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_flat[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1193,7 +1193,7 @@ static void paint_monorail_track_diag_25_deg_up( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1216,7 +1216,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_up( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1239,7 +1239,7 @@ static void paint_monorail_track_diag_25_deg_up_to_flat( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1262,7 +1262,7 @@ static void paint_monorail_track_diag_25_deg_down( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_25_deg_up[(direction + 2) % 4] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1286,7 +1286,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_down( { uint32_t imageId = monorail_track_pieces_diag_25_deg_up_to_flat[(direction + 2) % 4] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1310,7 +1310,7 @@ static void paint_monorail_track_diag_25_deg_down_to_flat( { uint32_t imageId = monorail_track_pieces_diag_flat_to_25_deg_up[(direction + 2) % 4] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index a1424ca583..0b51f32807 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -229,7 +229,8 @@ void vehicle_visual_river_rapids( image_id |= CONSTRUCTION_MARKER; } PaintAddImageAsParent( - session, image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z); + session, image_id, { 0, 0, z }, { bb->length_x, bb->length_y, bb->length_z }, + { bb->offset_x, bb->offset_y, bb->offset_z + z }); if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost()) { diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index fae611eba4..9d4788ac8c 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -749,21 +749,21 @@ static void paint_splash_boats_track_flat( { imageId = (direction == 1 ? SPR_SPLASH_BOATS_FLAT_TOP_NW_SE : SPR_SPLASH_BOATS_FLAT_TOP_SE_NW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 2, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); imageId = (direction == 1 ? SPR_SPLASH_BOATS_FLAT_SIDE_NW_SE : SPR_SPLASH_BOATS_FLAT_SIDE_SE_NW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 32, 26, height, 27, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); } else { imageId = (direction == 0 ? SPR_SPLASH_BOATS_FLAT_TOP_SW_NE : SPR_SPLASH_BOATS_FLAT_TOP_NE_SW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); imageId = (direction == 0 ? SPR_SPLASH_BOATS_FLAT_SIDE_SW_NE : SPR_SPLASH_BOATS_FLAT_SIDE_NE_SW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 1, 26, height, 0, 27, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); @@ -790,7 +790,7 @@ static void paint_splash_boats_station( { uint32_t imageId = (direction == 1 ? SPR_SPLASH_BOATS_FLAT_TOP_NW_SE : SPR_SPLASH_BOATS_FLAT_TOP_SE_NW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height + 3 }); imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); @@ -799,7 +799,7 @@ static void paint_splash_boats_station( { uint32_t imageId = (direction == 0 ? SPR_SPLASH_BOATS_FLAT_TOP_SW_NE : SPR_SPLASH_BOATS_FLAT_TOP_NE_SW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index d98b96186b..0b3a33bcc7 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -62,7 +62,8 @@ void vehicle_visual_submarine( image_id = baseImage_id | imageFlags; paint_struct* ps = PaintAddImageAsParent( - session, image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z); + session, image_id, { 0, 0, z }, { bb.length_x, bb.length_y, bb.length_z }, + { bb.offset_x, bb.offset_y, bb.offset_z + z }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -70,7 +71,7 @@ void vehicle_visual_submarine( image_id = (baseImage_id + 1) | imageFlags; ps = PaintAddImageAsParent( - session, image_id, 0, 0, bb.length_x, bb.length_y, 2, z, bb.offset_x, bb.offset_y, bb.offset_z + z - 10); + session, image_id, { 0, 0, z }, { bb.length_x, bb.length_y, 2 }, { bb.offset_x, bb.offset_y, bb.offset_z + z - 10 }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -94,7 +95,7 @@ static void submarine_ride_paint_track_station( if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, heightLower, 6, 0, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 20, 32, 3 }, { 6, 0, heightLower }); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( @@ -103,7 +104,7 @@ static void submarine_ride_paint_track_station( else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, heightLower, 0, 6, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 32, 20, 3 }, { 0, 6, heightLower }); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( @@ -124,13 +125,13 @@ static void submarine_ride_paint_track_flat( if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, heightLower, 6, 0, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 20, 32, 3 }, { 6, 0, heightLower }); paint_util_push_tunnel_right(session, heightLower, TUNNEL_0); } else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, heightLower, 0, 6, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 32, 20, 3 }, { 0, 6, heightLower }); paint_util_push_tunnel_left(session, heightLower, TUNNEL_0); } From efa9af4610869bdfaba6d61c881bbf91479a23c9 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 22:10:46 +0300 Subject: [PATCH 03/10] Simplify passing args on PaintAddImageAsParent where possible --- .../paint/tile_element/Paint.LargeScenery.cpp | 4 +- .../paint/tile_element/Paint.Path.cpp | 3 +- .../paint/tile_element/Paint.SmallScenery.cpp | 5 +- .../paint/tile_element/Paint.Wall.cpp | 20 +--- src/openrct2/ride/TrackPaint.cpp | 19 ++-- .../ride/coaster/JuniorRollerCoaster.cpp | 103 ++++++------------ 6 files changed, 49 insertions(+), 105 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 88e21ec6b8..ea436e96ce 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -289,9 +289,7 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh boxlength.x = s98E3C4[esi].length.x; boxlength.y = s98E3C4[esi].length.y; boxlength.z = boxlengthZ; - PaintAddImageAsParent( - session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, - { boxoffset.x, boxoffset.y, boxoffset.z }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, boxoffset); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 7138dd62b5..0e3a609b6c 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -441,8 +441,7 @@ static void sub_6A4101( boundBoxOffsets.x = BannerBoundBoxes[direction][1].x; boundBoxOffsets.y = BannerBoundBoxes[direction][1].y; imageId++; - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 21 }, boundBoxOffsets); direction--; // If text shown diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 3de63b9e8d..1ba7d0bc2d 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -159,8 +159,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED))) { PaintAddImageAsParent( - session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, - { boxoffset.x, boxoffset.y, boxoffset.z }); + session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, boxoffset); } if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) @@ -327,7 +326,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height { PaintAddImageAsParent( session, image_id, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, - { boxoffset.x, boxoffset.y, boxoffset.z }); + boxoffset); } else { diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 4bced75a05..6b98e5f20a 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -59,17 +59,13 @@ static void PaintWallDoor( { paint_struct* ps; - ps = PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { boundsR1.x, boundsR1.y, static_cast(boundsR1.z) }, { boundsR1_.x, boundsR1_.y, boundsR1_.z }); + ps = PaintAddImageAsParent(session, imageId, offset, boundsR1, boundsR1_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; } - ps = PaintAddImageAsParent( - session, imageId + 1, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { boundsR2.x, boundsR2.y, static_cast(boundsR2.z) }, { boundsR2_.x, boundsR2_.y, boundsR2_.z }); + ps = PaintAddImageAsParent(session, imageId + 1, offset, boundsR2, boundsR2_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -79,9 +75,7 @@ static void PaintWallDoor( { paint_struct* ps; - ps = PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { boundsL1.x, boundsL1.y, static_cast(boundsL1.z) }, { boundsL1_.x, boundsL1_.y, boundsL1_.z }); + ps = PaintAddImageAsParent(session, imageId, offset, boundsL1, boundsL1_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -117,9 +111,7 @@ static void PaintWallWall( imageId = (imageId & 0x7FFFF) | dword_141F710; } - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); if (dword_141F710 == 0) { imageId = baseImageId + dword_141F718; @@ -140,9 +132,7 @@ static void PaintWallWall( imageId = (imageId & 0x7FFFF) | dword_141F710; } - paint_struct* paint = PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + paint_struct* paint = PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); if (paint != nullptr) { paint->tertiary_colour = tertiaryColour; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 52b33096c5..aadcb94724 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -844,9 +844,7 @@ bool track_paint_util_draw_station_covers_2( } imageId = (baseImageId + imageOffset) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); return true; } @@ -1048,7 +1046,7 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( PaintAddImageAsParent( session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + { boundsLength.x, boundsLength.y, thickness[1] }, boundsOffset); } } @@ -1305,8 +1303,7 @@ void track_paint_util_eighth_to_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[direction][index] }, + session, imageId, { offset.x, offset.y, height }, { boundsLength.x, boundsLength.y, thickness[direction][index] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } @@ -1484,12 +1481,12 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( } const sprite_bb* spriteBB = &sprites[direction][sprite]; - uint32_t imageId = spriteBB->sprite_id | colourFlags; + const uint32_t imageId = spriteBB->sprite_id | colourFlags; + const auto& offset = spriteBB->offset; + const auto& bbOffset = spriteBB->offset; PaintAddImageAsParent( - session, imageId, - { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), height + spriteBB->offset.z }, - { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, - { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); + session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size, + { bbOffset.x, bbOffset.y, height + bbOffset.z }); } void track_paint_util_right_quarter_turn_5_tiles_paint_3( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 7203e411fc..8d5cb5bed1 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2467,10 +2467,8 @@ static void junior_rc_left_bank_paint_setup( image_id = junior_rc_track_pieces_left_bank[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, image_id, { 0, 0, height }, - { junior_rc_left_bank_bound_lengths[direction].x, junior_rc_left_bank_bound_lengths[direction].y, - static_cast(junior_rc_left_bank_bound_lengths[direction].z) }, - { junior_rc_left_bank_bound_offsets[direction].x, junior_rc_left_bank_bound_offsets[direction].y, height }); + session, image_id, { 0, 0, height }, junior_rc_left_bank_bound_lengths[direction], + { junior_rc_left_bank_bound_offsets[direction], height }); if (direction & 1) { @@ -3085,9 +3083,9 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( break; } if (imageId != 0) - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); + { + PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, 1 }, { boundsOffset, height }); + } if (direction == 0 && trackSequence == 0) { @@ -4959,12 +4957,9 @@ void junior_rc_paint_track_60_deg_up( image_id |= junior_rc_track_pieces_60_deg_up[EnumValue(chainType)][direction]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_60_deg_up_bound_lengths[direction].x, junior_rc_60_deg_up_bound_lengths[direction].y, - junior_rc_60_deg_up_bound_thickness[direction] }, - { junior_rc_60_deg_up_bound_offsets[direction].x, junior_rc_60_deg_up_bound_offsets[direction].y, height }); + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_60_deg_up_bound_lengths[direction], junior_rc_60_deg_up_bound_thickness[direction] }, + { junior_rc_60_deg_up_bound_offsets[direction], height }); switch (direction) { @@ -5037,14 +5032,10 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5053,14 +5044,10 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) @@ -5118,14 +5105,10 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5134,14 +5117,10 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) @@ -5437,13 +5416,9 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y), height + 24 }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height }); + session, image_id, { junior_rc_flat_to_60_deg_up_tile_offsets[direction][0], height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) { @@ -5452,14 +5427,9 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y), height }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); + session, image_id, { junior_rc_flat_to_60_deg_up_tile_offsets[direction][1], height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) @@ -5509,13 +5479,9 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].y), height + 24 }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height }); + session, image_id, { junior_rc_60_deg_up_to_flat_tile_offsets[direction][0], height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) { @@ -5524,14 +5490,9 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y), height }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); + session, image_id, { junior_rc_60_deg_up_to_flat_tile_offsets[direction][1], height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) From 7764bb910f77afaa7c6147ac5ae3d464ee0a3194 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 22:56:32 +0300 Subject: [PATCH 04/10] Use CoordsXYZ instead of anonymous struct in unk_supports_desc --- src/openrct2/paint/Supports.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 38336abb3e..636ceba4e2 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -305,12 +305,8 @@ static constexpr const uint16_t* WoodenCurveSupportImageIds[12] = { }; struct unk_supports_desc_bound_box { - struct { - uint8_t x, y, z; - } offset; - struct { - uint8_t x, y, z; - } length; + CoordsXYZ offset; + CoordsXYZ length; }; struct unk_supports_desc { @@ -780,7 +776,7 @@ bool wooden_b_supports_paint_setup( { uint16_t specialIndex = (special - 1) & 0xFFFF; - unk_supports_desc supportsDesc = byte_97B23C[specialIndex]; + const unk_supports_desc& supportsDesc = byte_97B23C[specialIndex]; if (WoodenCurveSupportImageIds[supportType] != nullptr && WoodenCurveSupportImageIds[supportType][specialIndex] != 0 && supportsDesc.var_7 != 0) @@ -788,13 +784,12 @@ bool wooden_b_supports_paint_setup( uint32_t imageId = WoodenCurveSupportImageIds[supportType][specialIndex]; imageId |= imageColourFlags; - unk_supports_desc_bound_box boundBox = supportsDesc.bounding_box; + const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, { 0, 0, baseHeight }, - { boundBox.length.x, boundBox.length.y, boundBox.length.z }, + session, imageId | imageColourFlags, { 0, 0, baseHeight }, boundBox.length, { boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight }); _9E32B1 = true; } From 3d90257dde7a1b326e3da2c887a77dc5ebb9bf87 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:01:57 +0300 Subject: [PATCH 05/10] Simplify more argument passing to PaintAddImageAsParent --- src/openrct2/paint/Supports.cpp | 35 ++++++++----------- .../paint/tile_element/Paint.Banner.cpp | 6 ++-- .../paint/tile_element/Paint.Path.cpp | 15 ++++---- src/openrct2/ride/TrackPaint.cpp | 32 ++++++++--------- .../ride/coaster/JuniorRollerCoaster.cpp | 5 +-- 5 files changed, 40 insertions(+), 53 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 636ceba4e2..3cb7ce746b 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -1079,9 +1079,7 @@ bool metal_b_supports_paint_setup( PaintAddImageAsParent( session, _metalSupportTypeToCrossbeamImages[supportType][ebp] | imageColourFlags, - { SupportBoundBoxes[originalSegment].x + loc_97B052[ebp].x, - SupportBoundBoxes[originalSegment].y + loc_97B052[ebp].y, baseHeight }, - { _97B062[ebp].x, _97B062[ebp].y, 1 }); + { SupportBoundBoxes[originalSegment] + loc_97B052[ebp], baseHeight }, { _97B062[ebp], 1 }); } int32_t si = baseHeight; @@ -1097,8 +1095,7 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].base_id + imageOffset; PaintAddImageAsParent( - session, imageId | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, supportSegments[segment].height }, { 0, 0, 5 }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], supportSegments[segment].height }, { 0, 0, 5 }); baseHeight = supportSegments[segment].height + 6; } @@ -1114,7 +1111,7 @@ bool metal_b_supports_paint_setup( { PaintAddImageAsParent( session, (_97B15C[supportType].beam_id + (heightDiff - 1)) | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1149,8 +1146,7 @@ bool metal_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, - { 0, 0, beamLength - 1 }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, beamLength - 1 }); baseHeight += beamLength; i++; @@ -1179,9 +1175,8 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].beam_id + (beamLength - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, - { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, baseHeight }, { 0, 0, 0 }, - { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height }); + session, imageId | imageColourFlags, { SupportBoundBoxes[originalSegment], baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[originalSegment], height }); baseHeight += beamLength; } } @@ -1312,14 +1307,13 @@ bool path_a_supports_paint_setup( uint32_t imageId = railingEntry->bridge_image + 55 + specialIndex; - unk_supports_desc supportsDesc = byte_98D8D4[specialIndex]; - unk_supports_desc_bound_box boundBox = supportsDesc.bounding_box; + const unk_supports_desc& supportsDesc = byte_98D8D4[specialIndex]; + const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, { 0, 0, baseHeight }, - { boundBox.length.y, boundBox.length.x, boundBox.length.z }, + session, imageId | imageColourFlags, { 0, 0, baseHeight }, boundBox.length, { boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z }); hasSupports = true; } @@ -1408,7 +1402,7 @@ bool path_b_supports_paint_setup( { PaintAddImageAsParent( session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1441,7 +1435,7 @@ bool path_b_supports_paint_setup( PaintAddImageAsParent( session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, (z - 1) }); + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1458,8 +1452,7 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, - { 0, 0, (z - 1) }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1488,8 +1481,8 @@ bool path_b_supports_paint_setup( uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, - { 0, 0, 0 }, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[segment], baseHeight }); baseHeight += z; } diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 44cd06cdd7..9006830aa4 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -78,14 +78,12 @@ void PaintBanner(paint_session* session, uint8_t direction, int32_t height, cons image_id |= (banner->colour << 19) | IMAGE_TYPE_REMAP; } - PaintAddImageAsParent( - session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, boundBoxOffset); boundBoxOffset.x = BannerBoundBoxes[direction][1].x; boundBoxOffset.y = BannerBoundBoxes[direction][1].y; image_id++; - PaintAddImageAsParent( - session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, boundBoxOffset); // Opposite direction direction = direction_reverse(direction); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 0e3a609b6c..b1b3bacf92 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -434,8 +434,7 @@ static void sub_6A4101( uint32_t imageId = (direction << 1) + base_image_id + 28; // Draw pole in the back - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 21 }, boundBoxOffsets); // Draw pole in the front and banner boundBoxOffsets.x = BannerBoundBoxes[direction][1].x; @@ -1046,8 +1045,8 @@ void path_paint_box_support( if (!hasSupports || !session->DidPassSurface) { PaintAddImageAsParent( - session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, - { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); + session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); } else { @@ -1063,8 +1062,8 @@ void path_paint_box_support( } PaintAddImageAsParent( - session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, - { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); + session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) @@ -1212,8 +1211,8 @@ void path_paint_pole_support( } PaintAddImageAsParent( - session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, - { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); + session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (pathElement.IsQueue() || pathElement.ShouldDrawPathOverSupports()) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index aadcb94724..d30bb0b83f 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -829,9 +829,7 @@ bool track_paint_util_draw_station_covers_2( if (baseImageId & IMAGE_TYPE_TRANSPARENT) { imageId = (baseImageId & ~IMAGE_TYPE_TRANSPARENT) + imageOffset; - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); uint32_t edi = session->TrackColours[SCHEME_TRACK] & (0b11111 << 19); @@ -1034,8 +1032,8 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness[0] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1044,9 +1042,7 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXY boundsLength = boundsLengths[direction][index][1]; CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[1] }, boundsOffset); + PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, thickness[1] }, boundsOffset); } } @@ -1132,8 +1128,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness[0] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1143,8 +1139,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness[1] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1344,8 +1340,8 @@ void track_paint_util_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = { @@ -1752,11 +1748,11 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_3( return; } const sprite_bb* spriteBB = &sprites[direction][sprite]; + const auto& offset = spriteBB->offset; + const auto& bbOffset = spriteBB->bb_offset; PaintAddImageAsParent( - session, spriteBB->sprite_id | colourFlags, - { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->offset.z + height }, - { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, - { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); + session, spriteBB->sprite_id | colourFlags, { offset.x, offset.y, offset.z + height }, spriteBB->bb_size, + { bbOffset.x, bbOffset.y, height + bbOffset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_4( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 8d5cb5bed1..46bd0265b5 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -3162,9 +3162,10 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( break; } if (imageId != 0) + { PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); + session, imageId, { offset, height }, { boundsLength.x, boundsLength.y, 1 }, { boundsOffset, height }); + } if (direction == 0 && trackSequence == 0) { From a5d2939108affb27c228feee0737cd9025c5b7e4 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:18:00 +0300 Subject: [PATCH 06/10] Use CoordsXY for rct_crooked_house_bound_box and correct arg passing --- src/openrct2/ride/gentle/CrookedHouse.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 32286cb425..dad4dfda77 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -16,17 +16,15 @@ struct rct_crooked_house_bound_box { - int16_t offset_x; - int16_t offset_y; - int16_t length_x; - int16_t length_y; + CoordsXY offset; + CoordsXY length; }; -static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { { 6, 0, 42, 24 }, - { 0, 0, 0, 0 }, - { -16, -16, 32, 32 }, - { 0, 0, 0, 0 }, // Unused - { 0, 6, 24, 42 } }; +static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { { { 6, 0 }, { 42, 24 } }, + { { 0, 0 }, { 0, 0 } }, + { { -16, -16 }, { 32, 32 } }, + { { 0, 0 }, { 0, 0 } }, // Unused + { { 0, 6 }, { 24, 42 } } }; /** * rct2: 0x0088ABA4 @@ -56,10 +54,9 @@ static void paint_crooked_house_structure( uint32_t image_id = (direction + rideEntry->vehicles[0].base_image_id) | session->TrackColours[SCHEME_MISC]; - rct_crooked_house_bound_box boundBox = crooked_house_data[segment]; + const rct_crooked_house_bound_box& boundBox = crooked_house_data[segment]; PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, height + 3 }, { boundBox.length_x, boundBox.length_y, 127 }, - { boundBox.offset_x, boundBox.offset_y, height + 3 }); + session, image_id, { x_offset, y_offset, height + 3 }, { boundBox.length, 127 }, { boundBox.offset, height + 3 }); } static void paint_crooked_house( From 5f49276d53745dd981d73cdfac0704285e89fcfe Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:22:00 +0300 Subject: [PATCH 07/10] Use CoordsXY for ferris_wheel_bound_box and correct arg passing --- src/openrct2/ride/gentle/FerrisWheel.cpp | 33 +++++++++++------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 9e2b3b5005..c3a0e0e1c6 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -32,18 +32,16 @@ static constexpr const uint8_t edges_1x4_nw_se[] = { struct ferris_wheel_bound_box { - int16_t length_x; - int16_t length_y; - int16_t offset_x; - int16_t offset_y; + CoordsXY length; + CoordsXY offset; }; /** rct2: 0x008A8CA8 */ -static ferris_wheel_bound_box ferris_wheel_data[] = { - { 31, 16, 1, 8 }, - { 16, 31, 8, 1 }, - { 31, 16, 1, 8 }, - { 16, 31, 8, 1 }, +static constexpr ferris_wheel_bound_box ferris_wheel_data[] = { + { { 31, 16 }, { 1, 8 } }, + { { 16, 31 }, { 8, 1 } }, + { { 31, 16 }, { 1, 8 } }, + { { 16, 31 }, { 8, 1 } }, }; /** @@ -89,17 +87,16 @@ static void paint_ferris_wheel_structure( imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim); } - ferris_wheel_bound_box boundBox = ferris_wheel_data[direction]; + const ferris_wheel_bound_box& boundBox = ferris_wheel_data[direction]; imageId = (22150 + (direction & 1) * 2) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, - { boundBox.offset_x, boundBox.offset_y, height }); + session, imageId, { xOffset, yOffset, height }, { boundBox.length, 127 }, { boundBox.offset, height }); imageId = (baseImageId + direction * 8 + imageOffset) | imageColourFlags; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { @@ -115,15 +112,15 @@ static void paint_ferris_wheel_structure( imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[i], vehicle->peep_tshirt_colours[i + 1]); imageId = (baseImageId + 32 + direction * 128 + frameNum) | imageColourFlags; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); } } imageId = (22150 + (direction & 1) * 2 + 1) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = ViewportInteractionItem::Ride; From 77b06cbf9a717605e825c67b9c4106fe9ccad381 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:24:10 +0300 Subject: [PATCH 08/10] Use CoordsXY for haunted_house_bound_box and correct arg passing --- src/openrct2/ride/gentle/HauntedHouse.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 0a6c80e1c3..1c120deba4 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -17,15 +17,14 @@ struct haunted_house_bound_box { - int16_t offset_x; - int16_t offset_y; - int16_t length_x; - int16_t length_y; + CoordsXY offset; + CoordsXY length; }; /** rct2: 0x1428180 */ -static haunted_house_bound_box haunted_house_data[] = { - { 6, 0, 42, 24 }, { 0, 0, 0, 0 }, { -16, -16, 32, 32 }, { 0, 0, 0, 0 }, { 0, 6, 24, 42 }, { 0, 0, 0, 0 }, +static constexpr haunted_house_bound_box haunted_house_data[] = { + { { 6, 0 }, { 42, 24 } }, { { 0, 0 }, { 0, 0 } }, { { -16, -16 }, { 32, 32 } }, + { { 0, 0 }, { 0, 0 } }, { { 0, 6 }, { 24, 42 } }, { { 0, 0 }, { 0, 0 } }, }; /** @@ -56,10 +55,10 @@ static void paint_haunted_house_structure( } uint32_t imageId = (baseImageId + direction) | session->TrackColours[SCHEME_MISC]; - haunted_house_bound_box boundBox = haunted_house_data[part]; + + const haunted_house_bound_box& boundBox = haunted_house_data[part]; PaintAddImageAsParent( - session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, - { boundBox.offset_x, boundBox.offset_y, height }); + session, imageId, { xOffset, yOffset, height }, { boundBox.length, 127 }, { boundBox.offset, height }); rct_drawpixelinfo* dpi = &session->DPI; if (dpi->zoom_level <= 0 && frameNum != 0) @@ -81,8 +80,8 @@ static void paint_haunted_house_structure( } imageId = imageId | session->TrackColours[SCHEME_MISC]; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); } session->CurrentlyDrawnItem = savedTileElement; From 15e32ce5f8cf303cf4061bb499cb8ddd35e6a9e1 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:30:14 +0300 Subject: [PATCH 09/10] Simplify some arg passing on PaintAddImageAsParent --- .../ride/transport/MiniatureRailway.cpp | 42 +++++++------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 1b5558df4c..cb599947e4 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -1442,9 +1442,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( bounds = miniature_railway_track_pieces_right_eight_to_orthog_bounds[direction][index]; offset = miniature_railway_track_pieces_right_eight_to_orthog_offset[direction][index]; } - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); } } else @@ -1453,9 +1451,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( | session->TrackColours[SCHEME_SUPPORTS]; CoordsXY offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1584,9 +1580,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( bounds = miniature_railway_track_pieces_left_eight_to_orthog_bounds[direction][index]; offset = miniature_railway_track_pieces_left_eight_to_orthog_offset[direction][index]; } - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); } } else @@ -1595,9 +1589,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( | session->TrackColours[SCHEME_SUPPORTS]; CoordsXY offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1714,7 +1706,7 @@ static void miniature_railway_track_diag_flat( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); + { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -1809,9 +1801,8 @@ static void miniature_railway_track_diag_25_deg_up( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1863,7 +1854,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); + { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -1937,9 +1928,8 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2013,9 +2003,8 @@ static void miniature_railway_track_diag_25_deg_down( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2088,9 +2077,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2140,7 +2128,7 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); + { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( From 0e08286d88c3ea078b696e2089501b7332d0d545 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 21 Aug 2021 01:01:54 +0300 Subject: [PATCH 10/10] Apply review comments --- src/openrct2/paint/Supports.cpp | 3 +-- .../paint/tile_element/Paint.LargeScenery.cpp | 14 ++++---------- src/openrct2/ride/TrackPaint.cpp | 4 ++-- src/openrct2/ride/coaster/WoodenRollerCoaster.cpp | 5 ++--- src/openrct2/ride/thrill/MagicCarpet.cpp | 4 +--- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 3cb7ce746b..9ac36e4c81 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -603,8 +603,7 @@ bool wooden_a_supports_paint_setup( if (byte_97B23C[special].var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId, { 0, 0, z }, { bBox.length.x, bBox.length.y, bBox.length.z }, - { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); + session, imageId, { 0, 0, z }, bBox.length, { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); hasSupports = true; } else diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index ea436e96ce..1fdaa946e4 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -244,8 +244,6 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh uint32_t dword_F4387C = 0; image_id |= SPRITE_ID_PALETTE_COLOUR_2(tileElement.GetPrimaryColour(), tileElement.GetSecondaryColour()); - CoordsXYZ boxlength; - CoordsXYZ boxoffset; if (gTrackDesignSaveMode) { if (!track_design_save_contains_tile_element(reinterpret_cast(&tileElement))) @@ -283,13 +281,9 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh edi = rol16(edi, direction); esi = (edi & 0xF) | (edi >> 12); } - boxoffset.x = s98E3C4[esi].offset.x; - boxoffset.y = s98E3C4[esi].offset.y; - boxoffset.z = height; - boxlength.x = s98E3C4[esi].length.x; - boxlength.y = s98E3C4[esi].length.y; - boxlength.z = boxlengthZ; - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, boxoffset); + const CoordsXYZ bbLength = { s98E3C4[esi].offset, height }; + const CoordsXYZ bbOffset = { s98E3C4[esi].length, boxlengthZ }; + PaintAddImageAsParent(session, image_id, { 0, 0, height }, bbLength, bbOffset); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); @@ -453,7 +447,7 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; PaintAddImageAsChild( session, scrolling_text_setup(session, STR_SCROLLING_SIGN_TEXT, ft, scroll, scrollMode, textColour), 0, 0, 1, 1, 21, - height + 25, boxoffset.x, boxoffset.y, boxoffset.z); + height + 25, bbOffset.x, bbOffset.y, bbOffset.z); } large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index d30bb0b83f..35efa3bf9c 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1638,8 +1638,8 @@ void track_paint_util_right_quarter_turn_3_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength.x, boundsLength.y, thickness }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_2( diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index b3f6b94017..56fb20dca3 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -428,9 +428,8 @@ static void wooden_rc_track_paint_bb(paint_session* session, const sprite_bb_2* uint32_t railsImageId = bb->sprite_id_b | wooden_rc_get_rails_colour(session); PaintAddImageAsParent( - session, imageId, { static_cast(bb->offset.x), static_cast(bb->offset.y), height + bb->offset.z }, - { bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z) }, - { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); + session, imageId, { bb->offset.x, bb->offset.y, height + bb->offset.z }, + { bb->bb_size.x, bb->bb_size.y, bb->bb_size.z }, { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); PaintAddImageAsChild( session, railsImageId, static_cast(bb->offset.x), static_cast(bb->offset.y), bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z), height + bb->offset.z, bb->bb_offset.x, bb->bb_offset.y, diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 4b274c6a08..44d609520f 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -84,9 +84,7 @@ static void paint_magic_carpet_frame( imageId |= session->TrackColours[SCHEME_TRACK]; if (plane == PLANE_BACK) { - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bbSize.x, bbSize.y, 127 }, { bbOffset.x, bbOffset.y, bbOffset.z }); + PaintAddImageAsParent(session, imageId, offset, { bbSize.x, bbSize.y, 127 }, bbOffset); } else {