From 475eed0a56e65e862f60e00fa3277b6191192fc2 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sat, 29 Feb 2020 01:09:06 -0300 Subject: [PATCH] Receive CoordsXY by const ref instead of copy --- .../interface/ViewportInteraction.cpp | 32 ++++++------ src/openrct2-ui/windows/Map.cpp | 4 +- src/openrct2-ui/windows/RideConstruction.cpp | 10 ++-- src/openrct2-ui/windows/TrackDesignPlace.cpp | 45 +++++++++-------- src/openrct2/actions/LandBuyRightsAction.hpp | 2 +- src/openrct2/actions/LandSetRightsAction.hpp | 2 +- src/openrct2/drawing/LightFX.cpp | 2 +- src/openrct2/drawing/LightFX.h | 2 +- src/openrct2/interface/Screenshot.cpp | 2 +- src/openrct2/peep/Staff.cpp | 2 +- src/openrct2/peep/Staff.h | 2 +- src/openrct2/ride/TrackDesign.h | 3 +- src/openrct2/ride/TrackDesignSave.cpp | 30 +++++------ src/openrct2/ride/TrackPaint.cpp | 8 +-- src/openrct2/ride/TrackPaint.h | 6 +-- src/openrct2/ride/transport/Chairlift.cpp | 4 +- src/openrct2/world/Fountain.cpp | 2 +- src/openrct2/world/Fountain.h | 2 +- src/openrct2/world/Map.h | 2 +- src/openrct2/world/TileInspector.cpp | 50 ++++++++++--------- src/openrct2/world/TileInspector.h | 49 +++++++++--------- 21 files changed, 137 insertions(+), 124 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 43d5f9b97e..ecbb59b012 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -39,12 +39,12 @@ #include #include -static void viewport_interaction_remove_scenery(TileElement* tileElement, CoordsXY mapCoords); -static void viewport_interaction_remove_footpath(TileElement* tileElement, CoordsXY mapCoords); -static void viewport_interaction_remove_footpath_item(TileElement* tileElement, CoordsXY mapCoords); -static void viewport_interaction_remove_park_wall(TileElement* tileElement, CoordsXY mapCoords); -static void viewport_interaction_remove_large_scenery(TileElement* tileElement, CoordsXY mapCoords); -static void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsXY mapCoords); +static void viewport_interaction_remove_scenery(TileElement* tileElement, const CoordsXY& mapCoords); +static void viewport_interaction_remove_footpath(TileElement* tileElement, const CoordsXY& mapCoords); +static void viewport_interaction_remove_footpath_item(TileElement* tileElement, const CoordsXY& mapCoords); +static void viewport_interaction_remove_park_wall(TileElement* tileElement, const CoordsXY& mapCoords); +static void viewport_interaction_remove_large_scenery(TileElement* tileElement, const CoordsXY& mapCoords); +static void viewport_interaction_remove_park_entrance(TileElement* tileElement, const CoordsXY& mapCoords); static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords, int32_t maxDistance); /** @@ -503,7 +503,7 @@ int32_t viewport_interaction_right_click(ScreenCoordsXY screenCoords) * * rct2: 0x006E08D2 */ -static void viewport_interaction_remove_scenery(TileElement* tileElement, CoordsXY mapCoords) +static void viewport_interaction_remove_scenery(TileElement* tileElement, const CoordsXY& mapCoords) { auto removeSceneryAction = SmallSceneryRemoveAction( { mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(), @@ -516,7 +516,7 @@ static void viewport_interaction_remove_scenery(TileElement* tileElement, Coords * * rct2: 0x006A614A */ -static void viewport_interaction_remove_footpath(TileElement* tileElement, CoordsXY mapCoords) +static void viewport_interaction_remove_footpath(TileElement* tileElement, const CoordsXY& mapCoords) { rct_window* w; TileElement* tileElement2; @@ -544,7 +544,7 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, Coord * * rct2: 0x006A61AB */ -static void viewport_interaction_remove_footpath_item(TileElement* tileElement, CoordsXY mapCoords) +static void viewport_interaction_remove_footpath_item(TileElement* tileElement, const CoordsXY& mapCoords) { auto footpathSceneryRemoveAction = FootpathSceneryRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }); GameActions::Execute(&footpathSceneryRemoveAction); @@ -554,19 +554,21 @@ static void viewport_interaction_remove_footpath_item(TileElement* tileElement, * * rct2: 0x00666C0E */ -void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsXY mapCoords) +void viewport_interaction_remove_park_entrance(TileElement* tileElement, const CoordsXY& mapCoords) { int32_t rotation = tileElement->GetDirectionWithOffset(1); + auto directedMapCoords = mapCoords; switch (tileElement->AsEntrance()->GetSequenceIndex()) { case 1: - mapCoords += CoordsDirectionDelta[rotation]; + directedMapCoords += CoordsDirectionDelta[rotation]; break; case 2: - mapCoords -= CoordsDirectionDelta[rotation]; + directedMapCoords -= CoordsDirectionDelta[rotation]; break; } - auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }); + auto parkEntranceRemoveAction = ParkEntranceRemoveAction( + { directedMapCoords.x, directedMapCoords.y, tileElement->GetBaseZ() }); GameActions::Execute(&parkEntranceRemoveAction); } @@ -574,7 +576,7 @@ void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsX * * rct2: 0x006E57A9 */ -static void viewport_interaction_remove_park_wall(TileElement* tileElement, CoordsXY mapCoords) +static void viewport_interaction_remove_park_wall(TileElement* tileElement, const CoordsXY& mapCoords) { rct_scenery_entry* sceneryEntry = tileElement->AsWall()->GetEntry(); if (sceneryEntry->wall.scrolling_mode != SCROLLING_MODE_NONE) @@ -593,7 +595,7 @@ static void viewport_interaction_remove_park_wall(TileElement* tileElement, Coor * * rct2: 0x006B88DC */ -static void viewport_interaction_remove_large_scenery(TileElement* tileElement, CoordsXY mapCoords) +static void viewport_interaction_remove_large_scenery(TileElement* tileElement, const CoordsXY& mapCoords) { rct_scenery_entry* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index f01f193641..e9b0848fb0 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1537,7 +1537,7 @@ static constexpr const uint8_t RideColourKey[] = { COLOUR_KEY_RIDE, // }; -static uint16_t map_window_get_pixel_colour_peep(CoordsXY c) +static uint16_t map_window_get_pixel_colour_peep(const CoordsXY& c) { auto* surfaceElement = map_get_surface_element_at(c); if (surfaceElement == nullptr) @@ -1571,7 +1571,7 @@ static uint16_t map_window_get_pixel_colour_peep(CoordsXY c) return colour; } -static uint16_t map_window_get_pixel_colour_ride(CoordsXY c) +static uint16_t map_window_get_pixel_colour_ride(const CoordsXY& c) { Ride* ride; uint16_t colourA = 0; // highlight colour diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 609afde613..82b92480db 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -468,13 +468,13 @@ static void window_ride_construction_draw_track_piece( rct_window* w, rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown, int32_t width, int32_t height); static void sub_6CBCE2( - rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, CoordsXY originCoords, - int32_t originZ); + rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, + const CoordsXY& originCoords, int32_t originZ); static void window_ride_construction_update_map_selection(); static void window_ride_construction_update_possible_ride_configurations(); static void window_ride_construction_update_widgets(rct_window* w); static void window_ride_construction_select_map_tiles( - Ride* ride, int32_t trackType, int32_t trackDirection, CoordsXY tileCoords); + Ride* ride, int32_t trackType, int32_t trackDirection, const CoordsXY& tileCoords); static void window_ride_construction_show_special_track_dropdown(rct_window* w, rct_widget* widget); static void ride_selected_track_set_seat_rotation(int32_t seatRotation); static void loc_6C7502(int32_t al); @@ -2406,7 +2406,7 @@ static TileElement* _backupTileElementArrays[5]; */ static void sub_6CBCE2( rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, - CoordsXY originCoords, int32_t originZ) + const CoordsXY& originCoords, int32_t originZ) { paint_session* session = paint_session_alloc(dpi, 0); trackDirection &= 3; @@ -3342,7 +3342,7 @@ static void window_ride_construction_update_widgets(rct_window* w) } static void window_ride_construction_select_map_tiles( - Ride* ride, int32_t trackType, int32_t trackDirection, CoordsXY tileCoords) + Ride* ride, int32_t trackType, int32_t trackDirection, const CoordsXY& tileCoords) { // If the scenery tool is active, we do not display our tiles as it // will conflict with larger scenery objects selecting tiles diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 0670eda7a0..c4be171847 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -124,9 +124,9 @@ static int32_t window_track_place_get_base_z(int32_t x, int32_t y); static void window_track_place_clear_mini_preview(); static void window_track_place_draw_mini_preview(TrackDesign* td6); static void window_track_place_draw_mini_preview_track( - TrackDesign* td6, int32_t pass, CoordsXY origin, CoordsXY& min, CoordsXY& max); + TrackDesign* td6, int32_t pass, const CoordsXY& origin, const CoordsXY& min, const CoordsXY& max); static void window_track_place_draw_mini_preview_maze( - TrackDesign* td6, int32_t pass, CoordsXY origin, CoordsXY& min, CoordsXY& max); + TrackDesign* td6, int32_t pass, const CoordsXY& origin, const CoordsXY& min, const CoordsXY& max); static LocationXY16 draw_mini_preview_get_pixel_position(int16_t x, int16_t y); static bool draw_mini_preview_is_pixel_in_bounds(LocationXY16 pixel); static uint8_t* draw_mini_preview_get_pixel_ptr(LocationXY16 pixel); @@ -557,12 +557,15 @@ static void window_track_place_draw_mini_preview(TrackDesign* td6) } static void window_track_place_draw_mini_preview_track( - TrackDesign* td6, int32_t pass, CoordsXY origin, CoordsXY& min, CoordsXY& max) + TrackDesign* td6, int32_t pass, const CoordsXY& origin, const CoordsXY& min, const CoordsXY& max) { uint8_t rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3; const rct_preview_track** trackBlockArray = (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_TRACK)) ? TrackBlocks : FlatRideTrackBlocks; + auto mutableOrigin = origin; + auto mutableMin = min; + auto mutableMax = max; for (const auto& trackElement : td6->track_elements) { int32_t trackType = trackElement.type; @@ -575,14 +578,14 @@ static void window_track_place_draw_mini_preview_track( const rct_preview_track* trackBlock = trackBlockArray[trackType]; while (trackBlock->index != 255) { - auto rotatedAndOffsetTrackBlock = origin + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); + auto rotatedAndOffsetTrackBlock = mutableOrigin + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); if (pass == 0) { - min.x = std::min(min.x, rotatedAndOffsetTrackBlock.x); - max.x = std::max(max.x, rotatedAndOffsetTrackBlock.x); - min.y = std::min(min.y, rotatedAndOffsetTrackBlock.y); - max.y = std::max(max.y, rotatedAndOffsetTrackBlock.y); + mutableMin.x = std::min(mutableMin.x, rotatedAndOffsetTrackBlock.x); + mutableMax.x = std::max(mutableMax.x, rotatedAndOffsetTrackBlock.x); + mutableMin.y = std::min(mutableMin.y, rotatedAndOffsetTrackBlock.y); + mutableMax.y = std::max(mutableMax.y, rotatedAndOffsetTrackBlock.y); } else { @@ -620,7 +623,7 @@ static void window_track_place_draw_mini_preview_track( const rct_track_coordinates* track_coordinate = &TrackCoordinates[trackType]; trackType *= 10; - auto rotatedAndOfffsetTrack = origin + CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(rotation); + auto rotatedAndOfffsetTrack = mutableOrigin + CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(rotation); rotation += track_coordinate->rotation_end - track_coordinate->rotation_begin; rotation &= 3; if (track_coordinate->rotation_end & 4) @@ -629,21 +632,21 @@ static void window_track_place_draw_mini_preview_track( } if (!(rotation & 4)) { - origin = rotatedAndOfffsetTrack + CoordsDirectionDelta[rotation]; + mutableOrigin = rotatedAndOfffsetTrack + CoordsDirectionDelta[rotation]; } } // Draw entrance and exit preview. for (const auto& entrance : td6->entrance_elements) { - auto rotatedAndOffsetEntrance = origin + CoordsXY{ entrance.x, entrance.y }.Rotate(rotation); + auto rotatedAndOffsetEntrance = mutableOrigin + CoordsXY{ entrance.x, entrance.y }.Rotate(rotation); if (pass == 0) { - min.x = std::min(min.x, rotatedAndOffsetEntrance.x); - max.x = std::max(max.x, rotatedAndOffsetEntrance.x); - min.y = std::min(min.y, rotatedAndOffsetEntrance.y); - max.y = std::max(max.y, rotatedAndOffsetEntrance.y); + mutableMin.x = std::min(mutableMin.x, rotatedAndOffsetEntrance.x); + mutableMax.x = std::max(mutableMax.x, rotatedAndOffsetEntrance.x); + mutableMin.y = std::min(mutableMin.y, rotatedAndOffsetEntrance.y); + mutableMax.y = std::max(mutableMax.y, rotatedAndOffsetEntrance.y); } else { @@ -666,19 +669,21 @@ static void window_track_place_draw_mini_preview_track( } static void window_track_place_draw_mini_preview_maze( - TrackDesign* td6, int32_t pass, CoordsXY origin, CoordsXY& min, CoordsXY& max) + TrackDesign* td6, int32_t pass, const CoordsXY& origin, const CoordsXY& min, const CoordsXY& max) { uint8_t rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3; + auto mutableMin = min; + auto mutableMax = max; for (const auto& mazeElement : td6->maze_elements) { auto rotatedMazeCoords = origin + CoordsXY{ mazeElement.x * 32, mazeElement.y * 32 }.Rotate(rotation); if (pass == 0) { - min.x = std::min(min.x, rotatedMazeCoords.x); - max.x = std::max(max.x, rotatedMazeCoords.x); - min.y = std::min(min.y, rotatedMazeCoords.y); - max.y = std::max(max.y, rotatedMazeCoords.y); + mutableMin.x = std::min(mutableMin.x, rotatedMazeCoords.x); + mutableMax.x = std::max(mutableMax.x, rotatedMazeCoords.x); + mutableMin.y = std::min(mutableMin.y, rotatedMazeCoords.y); + mutableMax.y = std::max(mutableMax.y, rotatedMazeCoords.y); } else { diff --git a/src/openrct2/actions/LandBuyRightsAction.hpp b/src/openrct2/actions/LandBuyRightsAction.hpp index 6fd3e644c0..ee6e80398b 100644 --- a/src/openrct2/actions/LandBuyRightsAction.hpp +++ b/src/openrct2/actions/LandBuyRightsAction.hpp @@ -117,7 +117,7 @@ private: return res; } - GameActionResult::Ptr map_buy_land_rights_for_tile(const CoordsXY loc, bool isExecuting) const + GameActionResult::Ptr map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const { if (_setting >= static_cast(LandBuyRightSetting::Count)) { diff --git a/src/openrct2/actions/LandSetRightsAction.hpp b/src/openrct2/actions/LandSetRightsAction.hpp index 080877d361..ec1c87c188 100644 --- a/src/openrct2/actions/LandSetRightsAction.hpp +++ b/src/openrct2/actions/LandSetRightsAction.hpp @@ -128,7 +128,7 @@ private: return res; } - GameActionResult::Ptr map_buy_land_rights_for_tile(const CoordsXY loc, bool isExecuting) const + GameActionResult::Ptr map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const { SurfaceElement* surfaceElement = map_get_surface_element_at(loc); if (surfaceElement == nullptr) diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 7d9dc03552..0ad903932d 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -672,7 +672,7 @@ void lightfx_add_3d_light(uint32_t lightID, uint16_t lightIDqualifier, int16_t x } void lightfx_add_3d_light_magic_from_drawing_tile( - CoordsXY mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, uint8_t lightType) + const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, uint8_t lightType) { int16_t x = mapPosition.x + offsetX; int16_t y = mapPosition.y + offsetY; diff --git a/src/openrct2/drawing/LightFX.h b/src/openrct2/drawing/LightFX.h index 2659e50753..75fb5dea09 100644 --- a/src/openrct2/drawing/LightFX.h +++ b/src/openrct2/drawing/LightFX.h @@ -60,7 +60,7 @@ const rct_palette* lightfx_get_palette(); void lightfx_add_3d_light(uint32_t lightID, uint16_t lightIDqualifier, int16_t x, int16_t y, uint16_t z, uint8_t lightType); void lightfx_add_3d_light_magic_from_drawing_tile( - CoordsXY mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, uint8_t lightType); + const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, uint8_t lightType); void lightfx_add_lights_magic_vehicles(); diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index c3691f6bd3..b72b9c4f50 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -289,7 +289,7 @@ static CoordsXY GetEdgeTile(int32_t mapSize, int32_t rotation, EdgeType edgeType } } -static int32_t GetHighestBaseClearanceZ(CoordsXY location) +static int32_t GetHighestBaseClearanceZ(const CoordsXY& location) { int32_t z = 0; auto element = map_get_first_element_at(location); diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 407cee2bed..052d6d25cc 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -400,7 +400,7 @@ bool Staff::IsPatrolAreaSet(const CoordsXY& coords) const return staff_is_patrol_area_set(staff_id, coords.x, coords.y); } -bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, CoordsXY coords) +bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, const CoordsXY& coords) { return staff_is_patrol_area_set(STAFF_MAX_COUNT + type, coords.x, coords.y); } diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 41e848d78a..f539aeecbf 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -82,7 +82,7 @@ bool staff_is_location_on_patrol_edge(Peep* mechanic, int32_t x, int32_t y); bool staff_can_ignore_wide_flag(Peep* mechanic, int32_t x, int32_t y, uint8_t z, TileElement* path); int32_t staff_path_finding(Staff* peep); void staff_reset_stats(); -bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, CoordsXY coords); +bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, const CoordsXY& coords); void staff_set_patrol_area(int32_t staffIndex, int32_t x, int32_t y, bool value); void staff_toggle_patrol_area(int32_t staffIndex, int32_t x, int32_t y); colour_t staff_get_colour(uint8_t staffType); diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 4223e3a616..5947e57358 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -218,7 +218,8 @@ void track_design_save_init(); void track_design_save_reset_scenery(); bool track_design_save_contains_tile_element(const TileElement* tileElement); void track_design_save_select_nearby_scenery(ride_id_t rideIndex); -void track_design_save_select_tile_element(int32_t interactionType, CoordsXY loc, TileElement* tileElement, bool collect); +void track_design_save_select_tile_element( + int32_t interactionType, const CoordsXY& loc, TileElement* tileElement, bool collect); bool track_design_are_entrance_and_exit_placed(); diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 500c2aab47..a2edeebfa5 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -43,8 +43,8 @@ std::vector _trackSavedTileElementsDesc; static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement); static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex, int32_t cx, int32_t cy); -static bool track_design_save_add_tile_element(int32_t interactionType, CoordsXY loc, TileElement* tileElement); -static void track_design_save_remove_tile_element(int32_t interactionType, CoordsXY loc, TileElement* tileElement); +static bool track_design_save_add_tile_element(int32_t interactionType, const CoordsXY& loc, TileElement* tileElement); +static void track_design_save_remove_tile_element(int32_t interactionType, const CoordsXY& loc, TileElement* tileElement); void track_design_save_init() { @@ -56,7 +56,7 @@ void track_design_save_init() * * rct2: 0x006D2B07 */ -void track_design_save_select_tile_element(int32_t interactionType, CoordsXY loc, TileElement* tileElement, bool collect) +void track_design_save_select_tile_element(int32_t interactionType, const CoordsXY& loc, TileElement* tileElement, bool collect) { if (track_design_save_contains_tile_element(tileElement)) { @@ -176,7 +176,7 @@ static bool track_design_save_can_add_tile_element(TileElement* tileElement) * * rct2: 0x006D2F4C */ -static void track_design_save_push_tile_element(CoordsXY loc, TileElement* tileElement) +static void track_design_save_push_tile_element(const CoordsXY& loc, TileElement* tileElement) { if (_trackSavedTileElements.size() < TRACK_MAX_SAVED_TILE_ELEMENTS) { @@ -204,7 +204,7 @@ static void track_design_save_push_tile_element_desc( _trackSavedTileElementsDesc.push_back(item); } -static void track_design_save_add_scenery(CoordsXY loc, SmallSceneryElement* sceneryElement) +static void track_design_save_add_scenery(const CoordsXY& loc, SmallSceneryElement* sceneryElement) { int32_t entryType = sceneryElement->GetEntryIndex(); auto entry = object_entry_get_entry(OBJECT_TYPE_SMALL_SCENERY, entryType); @@ -221,7 +221,7 @@ static void track_design_save_add_scenery(CoordsXY loc, SmallSceneryElement* sce entry, { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags, primaryColour, secondaryColour); } -static void track_design_save_add_large_scenery(CoordsXY loc, LargeSceneryElement* tileElement) +static void track_design_save_add_large_scenery(const CoordsXY& loc, LargeSceneryElement* tileElement) { rct_large_scenery_tile *sceneryTiles, *tile; int32_t direction, sequence; @@ -266,7 +266,7 @@ static void track_design_save_add_large_scenery(CoordsXY loc, LargeSceneryElemen } } -static void track_design_save_add_wall(CoordsXY loc, WallElement* wallElement) +static void track_design_save_add_wall(const CoordsXY& loc, WallElement* wallElement) { int32_t entryType = wallElement->GetEntryIndex(); auto entry = object_entry_get_entry(OBJECT_TYPE_WALLS, entryType); @@ -283,7 +283,7 @@ static void track_design_save_add_wall(CoordsXY loc, WallElement* wallElement) entry, { loc.x, loc.y, wallElement->GetBaseZ() }, flags, primaryColour, secondaryColour); } -static void track_design_save_add_footpath(CoordsXY loc, PathElement* pathElement) +static void track_design_save_add_footpath(const CoordsXY& loc, PathElement* pathElement) { int32_t entryType = pathElement->GetPathEntryIndex(); auto entry = object_entry_get_entry(OBJECT_TYPE_PATHS, entryType); @@ -304,7 +304,7 @@ static void track_design_save_add_footpath(CoordsXY loc, PathElement* pathElemen * * rct2: 0x006D2B3C */ -static bool track_design_save_add_tile_element(int32_t interactionType, CoordsXY loc, TileElement* tileElement) +static bool track_design_save_add_tile_element(int32_t interactionType, const CoordsXY& loc, TileElement* tileElement) { if (!track_design_save_can_add_tile_element(tileElement)) { @@ -334,7 +334,7 @@ static bool track_design_save_add_tile_element(int32_t interactionType, CoordsXY * * rct2: 0x006D2F78 */ -static void track_design_save_pop_tile_element(CoordsXY loc, TileElement* tileElement) +static void track_design_save_pop_tile_element(const CoordsXY& loc, TileElement* tileElement) { map_invalidate_tile_full(loc); @@ -384,7 +384,7 @@ static void track_design_save_pop_tile_element_desc(const rct_object_entry* entr } } -static void track_design_save_remove_scenery(CoordsXY loc, SmallSceneryElement* sceneryElement) +static void track_design_save_remove_scenery(const CoordsXY& loc, SmallSceneryElement* sceneryElement) { int32_t entryType = sceneryElement->GetEntryIndex(); auto entry = object_entry_get_entry(OBJECT_TYPE_SMALL_SCENERY, entryType); @@ -397,7 +397,7 @@ static void track_design_save_remove_scenery(CoordsXY loc, SmallSceneryElement* track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags); } -static void track_design_save_remove_large_scenery(CoordsXY loc, LargeSceneryElement* tileElement) +static void track_design_save_remove_large_scenery(const CoordsXY& loc, LargeSceneryElement* tileElement) { rct_large_scenery_tile *sceneryTiles, *tile; int32_t direction, sequence; @@ -439,7 +439,7 @@ static void track_design_save_remove_large_scenery(CoordsXY loc, LargeSceneryEle } } -static void track_design_save_remove_wall(CoordsXY loc, WallElement* wallElement) +static void track_design_save_remove_wall(const CoordsXY& loc, WallElement* wallElement) { int32_t entryType = wallElement->GetEntryIndex(); auto entry = object_entry_get_entry(OBJECT_TYPE_WALLS, entryType); @@ -452,7 +452,7 @@ static void track_design_save_remove_wall(CoordsXY loc, WallElement* wallElement track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, wallElement->GetBaseZ() }, flags); } -static void track_design_save_remove_footpath(CoordsXY loc, PathElement* pathElement) +static void track_design_save_remove_footpath(const CoordsXY& loc, PathElement* pathElement) { int32_t entryType = pathElement->GetPathEntryIndex(); auto entry = object_entry_get_entry(OBJECT_TYPE_PATHS, entryType); @@ -473,7 +473,7 @@ static void track_design_save_remove_footpath(CoordsXY loc, PathElement* pathEle * * rct2: 0x006D2B3C */ -static void track_design_save_remove_tile_element(int32_t interactionType, CoordsXY loc, TileElement* tileElement) +static void track_design_save_remove_tile_element(int32_t interactionType, const CoordsXY& loc, TileElement* tileElement) { switch (interactionType) { diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index dbb4496aa1..7d299a1cd2 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -257,8 +257,8 @@ void track_paint_util_paint_floor( } void track_paint_util_paint_fences( - paint_session* session, uint8_t edges, CoordsXY position, const TileElement* tileElement, Ride* ride, uint32_t colourFlags, - uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation) + paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, Ride* ride, + uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation) { uint32_t imageId; @@ -885,8 +885,8 @@ void track_paint_util_draw_station_platform( } void track_paint_util_draw_pier( - paint_session* session, Ride* ride, const StationObject* stationObj, CoordsXY position, uint8_t direction, int32_t height, - const TileElement* tileElement, uint8_t rotation) + paint_session* session, Ride* ride, const StationObject* stationObj, const CoordsXY& position, uint8_t direction, + int32_t height, const TileElement* tileElement, uint8_t rotation) { bool hasFence; uint32_t imageId; diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index b6fb5d6bf9..bb08632f8e 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -283,8 +283,8 @@ bool track_paint_util_has_fence( void track_paint_util_paint_floor( paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4]); void track_paint_util_paint_fences( - paint_session* session, uint8_t edges, CoordsXY position, const TileElement* tileElement, Ride* ride, uint32_t colourFlags, - uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation); + paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, Ride* ride, + uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation); bool track_paint_util_draw_station_covers( paint_session* session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height); bool track_paint_util_draw_station_covers_2( @@ -305,7 +305,7 @@ void track_paint_util_draw_station_inverted( uint8_t stationVariant); bool track_paint_util_should_paint_supports(const CoordsXY& position); void track_paint_util_draw_pier( - paint_session* session, Ride* ride, const StationObject* stationObject, CoordsXY position, uint8_t direction, + paint_session* session, Ride* ride, const StationObject* stationObject, const CoordsXY& position, uint8_t direction, int32_t height, const TileElement* tileElement, uint8_t rotation); void track_paint_util_draw_station_metal_supports(paint_session* session, uint8_t direction, uint16_t height, uint32_t colour); void track_paint_util_draw_station_metal_supports_2( diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 88dd7866e7..7d8be87768 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -132,7 +132,7 @@ static const TileElement* chairlift_paint_util_map_get_track_element_at_from_rid }; static bool chairlift_paint_util_is_first_track( - ride_id_t rideIndex, const TileElement* tileElement, CoordsXY pos, uint8_t trackType) + ride_id_t rideIndex, const TileElement* tileElement, const CoordsXY& pos, uint8_t trackType) { if (tileElement->AsTrack()->GetTrackType() != TRACK_ELEM_BEGIN_STATION) { @@ -152,7 +152,7 @@ static bool chairlift_paint_util_is_first_track( } static bool chairlift_paint_util_is_last_track( - ride_id_t rideIndex, const TileElement* tileElement, CoordsXY pos, uint8_t trackType) + ride_id_t rideIndex, const TileElement* tileElement, const CoordsXY& pos, uint8_t trackType) { if (tileElement->AsTrack()->GetTrackType() != TRACK_ELEM_END_STATION) { diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index 74b020a344..0de687c430 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -80,7 +80,7 @@ const uint8_t _fountainPatternFlags[] = { FOUNTAIN_FLAG::FAST // FAST_RANDOM_CHASERS }; -void JumpingFountain::StartAnimation(const int32_t newType, const CoordsXY newLoc, const TileElement* tileElement) +void JumpingFountain::StartAnimation(const int32_t newType, const CoordsXY& newLoc, const TileElement* tileElement) { int32_t randomIndex; auto newZ = tileElement->GetBaseZ(); diff --git a/src/openrct2/world/Fountain.h b/src/openrct2/world/Fountain.h index 7956c6edeb..4a9b028c1f 100644 --- a/src/openrct2/world/Fountain.h +++ b/src/openrct2/world/Fountain.h @@ -22,7 +22,7 @@ struct JumpingFountain : SpriteGeneric uint16_t Iteration; void Update(); - static void StartAnimation(int32_t newType, const CoordsXY newLoc, const TileElement* tileElement); + static void StartAnimation(int32_t newType, const CoordsXY& newLoc, const TileElement* tileElement); private: int32_t GetType() const; diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index fa25a30fd0..96810bd641 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -52,7 +52,7 @@ struct CoordsXYE : public CoordsXY { } - constexpr CoordsXYE(CoordsXY c, TileElement* _e) + constexpr CoordsXYE(const CoordsXY& c, TileElement* _e) : CoordsXY(c) , element(_e) { diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index f6d9d44908..3e9d629a3e 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -36,7 +36,7 @@ uint32_t windowTileInspectorTileY; int32_t windowTileInspectorElementCount = 0; int32_t windowTileInspectorSelectedIndex; -static bool map_swap_elements_at(CoordsXY loc, int16_t first, int16_t second) +static bool map_swap_elements_at(const CoordsXY& loc, int16_t first, int16_t second) { TileElement* const firstElement = map_get_nth_element_at(loc, first); TileElement* const secondElement = map_get_nth_element_at(loc, second); @@ -79,7 +79,7 @@ static bool map_swap_elements_at(CoordsXY loc, int16_t first, int16_t second) * @param elementIndex The nth element on this tile * Returns 0 on success, MONEY_UNDEFINED otherwise. */ -GameActionResult::Ptr tile_inspector_insert_corrupt_at(CoordsXY loc, int16_t elementIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_insert_corrupt_at(const CoordsXY& loc, int16_t elementIndex, bool isExecuting) { // Make sure there is enough space for the new element if (!map_check_free_elements_and_reorganise(1)) @@ -147,7 +147,7 @@ GameActionResult::Ptr tile_inspector_insert_corrupt_at(CoordsXY loc, int16_t ele * @param y The y coordinate of the tile * @param elementIndex The nth element on this tile */ -GameActionResult::Ptr tile_inspector_remove_element_at(CoordsXY loc, int16_t elementIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_remove_element_at(const CoordsXY& loc, int16_t elementIndex, bool isExecuting) { if (isExecuting) { @@ -183,7 +183,7 @@ GameActionResult::Ptr tile_inspector_remove_element_at(CoordsXY loc, int16_t ele return std::make_unique(); } -GameActionResult::Ptr tile_inspector_swap_elements_at(CoordsXY loc, int16_t first, int16_t second, bool isExecuting) +GameActionResult::Ptr tile_inspector_swap_elements_at(const CoordsXY& loc, int16_t first, int16_t second, bool isExecuting) { if (isExecuting) { @@ -211,7 +211,7 @@ GameActionResult::Ptr tile_inspector_swap_elements_at(CoordsXY loc, int16_t firs return std::make_unique(); } -GameActionResult::Ptr tile_inspector_rotate_element_at(CoordsXY loc, int32_t elementIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_rotate_element_at(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { if (isExecuting) { @@ -292,7 +292,7 @@ GameActionResult::Ptr tile_inspector_rotate_element_at(CoordsXY loc, int32_t ele return std::make_unique(); } -GameActionResult::Ptr tile_inspector_paste_element_at(CoordsXY loc, TileElement element, bool isExecuting) +GameActionResult::Ptr tile_inspector_paste_element_at(const CoordsXY& loc, TileElement element, bool isExecuting) { // Make sure there is enough space for the new element if (!map_check_free_elements_and_reorganise(1)) @@ -350,7 +350,7 @@ GameActionResult::Ptr tile_inspector_paste_element_at(CoordsXY loc, TileElement return std::make_unique(); } -GameActionResult::Ptr tile_inspector_sort_elements_at(CoordsXY loc, bool isExecuting) +GameActionResult::Ptr tile_inspector_sort_elements_at(const CoordsXY& loc, bool isExecuting) { if (isExecuting) { @@ -410,7 +410,7 @@ GameActionResult::Ptr tile_inspector_sort_elements_at(CoordsXY loc, bool isExecu } GameActionResult::Ptr tile_inspector_any_base_height_offset( - CoordsXY loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting) + const CoordsXY& loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting) { TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); if (tileElement == nullptr) @@ -467,7 +467,7 @@ GameActionResult::Ptr tile_inspector_any_base_height_offset( return std::make_unique(); } -GameActionResult::Ptr tile_inspector_surface_show_park_fences(CoordsXY loc, bool showFences, bool isExecuting) +GameActionResult::Ptr tile_inspector_surface_show_park_fences(const CoordsXY& loc, bool showFences, bool isExecuting) { auto* const surfaceelement = map_get_surface_element_at(loc); @@ -495,7 +495,7 @@ GameActionResult::Ptr tile_inspector_surface_show_park_fences(CoordsXY loc, bool return std::make_unique(); } -GameActionResult::Ptr tile_inspector_surface_toggle_corner(CoordsXY loc, int32_t cornerIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_surface_toggle_corner(const CoordsXY& loc, int32_t cornerIndex, bool isExecuting) { auto* const surfaceElement = map_get_surface_element_at(loc); @@ -562,7 +562,7 @@ GameActionResult::Ptr tile_inspector_surface_toggle_corner(CoordsXY loc, int32_t return std::make_unique(); } -GameActionResult::Ptr tile_inspector_surface_toggle_diagonal(CoordsXY loc, bool isExecuting) +GameActionResult::Ptr tile_inspector_surface_toggle_diagonal(const CoordsXY& loc, bool isExecuting) { auto* const surfaceElement = map_get_surface_element_at(loc); @@ -600,7 +600,7 @@ GameActionResult::Ptr tile_inspector_surface_toggle_diagonal(CoordsXY loc, bool return std::make_unique(); } -GameActionResult::Ptr tile_inspector_path_set_sloped(CoordsXY loc, int32_t elementIndex, bool sloped, bool isExecuting) +GameActionResult::Ptr tile_inspector_path_set_sloped(const CoordsXY& loc, int32_t elementIndex, bool sloped, bool isExecuting) { TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); @@ -624,7 +624,7 @@ GameActionResult::Ptr tile_inspector_path_set_sloped(CoordsXY loc, int32_t eleme return std::make_unique(); } -GameActionResult::Ptr tile_inspector_path_set_broken(CoordsXY loc, int32_t elementIndex, bool broken, bool isExecuting) +GameActionResult::Ptr tile_inspector_path_set_broken(const CoordsXY& loc, int32_t elementIndex, bool broken, bool isExecuting) { TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); @@ -648,7 +648,8 @@ GameActionResult::Ptr tile_inspector_path_set_broken(CoordsXY loc, int32_t eleme return std::make_unique(); } -GameActionResult::Ptr tile_inspector_path_toggle_edge(CoordsXY loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_path_toggle_edge( + const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) { TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); @@ -673,7 +674,7 @@ GameActionResult::Ptr tile_inspector_path_toggle_edge(CoordsXY loc, int32_t elem return std::make_unique(); } -GameActionResult::Ptr tile_inspector_entrance_make_usable(CoordsXY loc, int32_t elementIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_entrance_make_usable(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { TileElement* const entranceElement = map_get_nth_element_at(loc, elementIndex); @@ -713,7 +714,8 @@ GameActionResult::Ptr tile_inspector_entrance_make_usable(CoordsXY loc, int32_t return std::make_unique(); } -GameActionResult::Ptr tile_inspector_wall_set_slope(CoordsXY loc, int32_t elementIndex, int32_t slopeValue, bool isExecuting) +GameActionResult::Ptr tile_inspector_wall_set_slope( + const CoordsXY& loc, int32_t elementIndex, int32_t slopeValue, bool isExecuting) { TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); @@ -741,7 +743,7 @@ GameActionResult::Ptr tile_inspector_wall_set_slope(CoordsXY loc, int32_t elemen // Changes the height of all track elements that belong to the same track piece // Broxzier: Copied from track_remove and stripped of unneeded code, but I think this should be smaller GameActionResult::Ptr tile_inspector_track_base_height_offset( - CoordsXY loc, int32_t elementIndex, int8_t offset, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, int8_t offset, bool isExecuting) { if (offset == 0) return std::make_unique(); @@ -840,7 +842,7 @@ GameActionResult::Ptr tile_inspector_track_base_height_offset( // Sets chainlift, optionally for an entire track block // Broxzier: Basically a copy of the above function, with just two different lines... should probably be combined somehow GameActionResult::Ptr tile_inspector_track_set_chain( - CoordsXY loc, int32_t elementIndex, bool entireTrackBlock, bool setChain, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, bool entireTrackBlock, bool setChain, bool isExecuting) { TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); @@ -947,7 +949,7 @@ GameActionResult::Ptr tile_inspector_track_set_chain( } GameActionResult::Ptr tile_inspector_track_set_block_brake( - CoordsXY loc, int32_t elementIndex, bool blockBrake, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, bool blockBrake, bool isExecuting) { TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); @@ -972,7 +974,7 @@ GameActionResult::Ptr tile_inspector_track_set_block_brake( } GameActionResult::Ptr tile_inspector_track_set_indestructible( - CoordsXY loc, int32_t elementIndex, bool isIndestructible, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, bool isIndestructible, bool isExecuting) { TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); @@ -997,7 +999,7 @@ GameActionResult::Ptr tile_inspector_track_set_indestructible( } GameActionResult::Ptr tile_inspector_scenery_set_quarter_location( - CoordsXY loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) { TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); @@ -1023,7 +1025,7 @@ GameActionResult::Ptr tile_inspector_scenery_set_quarter_location( } GameActionResult::Ptr tile_inspector_scenery_set_quarter_collision( - CoordsXY loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) { TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); @@ -1047,7 +1049,7 @@ GameActionResult::Ptr tile_inspector_scenery_set_quarter_collision( } GameActionResult::Ptr tile_inspector_banner_toggle_blocking_edge( - CoordsXY loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) + const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) { TileElement* const bannerElement = map_get_nth_element_at(loc, elementIndex); @@ -1069,7 +1071,7 @@ GameActionResult::Ptr tile_inspector_banner_toggle_blocking_edge( return std::make_unique(); } -GameActionResult::Ptr tile_inspector_corrupt_clamp(CoordsXY loc, int32_t elementIndex, bool isExecuting) +GameActionResult::Ptr tile_inspector_corrupt_clamp(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { TileElement* const corruptElement = map_get_nth_element_at(loc, elementIndex); diff --git a/src/openrct2/world/TileInspector.h b/src/openrct2/world/TileInspector.h index 05a24484c9..b5531fc436 100644 --- a/src/openrct2/world/TileInspector.h +++ b/src/openrct2/world/TileInspector.h @@ -28,33 +28,36 @@ enum TILE_INSPECTOR_ELEMENT_TYPE class GameActionResult; using GameActionResultPtr = std::unique_ptr; -GameActionResultPtr tile_inspector_insert_corrupt_at(CoordsXY loc, int16_t elementIndex, bool isExecuting); -GameActionResultPtr tile_inspector_remove_element_at(CoordsXY loc, int16_t elementIndex, bool isExecuting); -GameActionResultPtr tile_inspector_swap_elements_at(CoordsXY loc, int16_t first, int16_t second, bool isExecuting); -GameActionResultPtr tile_inspector_rotate_element_at(CoordsXY loc, int32_t elementIndex, bool isExecuting); -GameActionResultPtr tile_inspector_paste_element_at(CoordsXY loc, TileElement element, bool isExecuting); -GameActionResultPtr tile_inspector_sort_elements_at(CoordsXY loc, bool isExecuting); +GameActionResultPtr tile_inspector_insert_corrupt_at(const CoordsXY& loc, int16_t elementIndex, bool isExecuting); +GameActionResultPtr tile_inspector_remove_element_at(const CoordsXY& loc, int16_t elementIndex, bool isExecuting); +GameActionResultPtr tile_inspector_swap_elements_at(const CoordsXY& loc, int16_t first, int16_t second, bool isExecuting); +GameActionResultPtr tile_inspector_rotate_element_at(const CoordsXY& loc, int32_t elementIndex, bool isExecuting); +GameActionResultPtr tile_inspector_paste_element_at(const CoordsXY& loc, TileElement element, bool isExecuting); +GameActionResultPtr tile_inspector_sort_elements_at(const CoordsXY& loc, bool isExecuting); GameActionResultPtr tile_inspector_any_base_height_offset( - CoordsXY loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting); -GameActionResultPtr tile_inspector_surface_show_park_fences(CoordsXY loc, bool enabled, bool isExecuting); -GameActionResultPtr tile_inspector_surface_toggle_corner(CoordsXY loc, int32_t cornerIndex, bool isExecuting); -GameActionResultPtr tile_inspector_surface_toggle_diagonal(CoordsXY loc, bool isExecuting); -GameActionResultPtr tile_inspector_path_set_sloped(CoordsXY loc, int32_t elementIndex, bool sloped, bool isExecuting); -GameActionResultPtr tile_inspector_path_set_broken(CoordsXY loc, int32_t elementIndex, bool broken, bool isExecuting); -GameActionResultPtr tile_inspector_path_toggle_edge(CoordsXY loc, int32_t elementIndex, int32_t cornerIndex, bool isExecuting); -GameActionResultPtr tile_inspector_entrance_make_usable(CoordsXY loc, int32_t elementIndex, bool isExecuting); -GameActionResultPtr tile_inspector_wall_set_slope(CoordsXY loc, int32_t elementIndex, int32_t slopeValue, bool isExecuting); + const CoordsXY& loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting); +GameActionResultPtr tile_inspector_surface_show_park_fences(const CoordsXY& loc, bool enabled, bool isExecuting); +GameActionResultPtr tile_inspector_surface_toggle_corner(const CoordsXY& loc, int32_t cornerIndex, bool isExecuting); +GameActionResultPtr tile_inspector_surface_toggle_diagonal(const CoordsXY& loc, bool isExecuting); +GameActionResultPtr tile_inspector_path_set_sloped(const CoordsXY& loc, int32_t elementIndex, bool sloped, bool isExecuting); +GameActionResultPtr tile_inspector_path_set_broken(const CoordsXY& loc, int32_t elementIndex, bool broken, bool isExecuting); +GameActionResultPtr tile_inspector_path_toggle_edge( + const CoordsXY& loc, int32_t elementIndex, int32_t cornerIndex, bool isExecuting); +GameActionResultPtr tile_inspector_entrance_make_usable(const CoordsXY& loc, int32_t elementIndex, bool isExecuting); +GameActionResultPtr tile_inspector_wall_set_slope( + const CoordsXY& loc, int32_t elementIndex, int32_t slopeValue, bool isExecuting); GameActionResultPtr tile_inspector_track_base_height_offset( - CoordsXY loc, int32_t elementIndex, int8_t offset, bool isExecuting); -GameActionResultPtr tile_inspector_track_set_block_brake(CoordsXY loc, int32_t elementIndex, bool blockBrake, bool isExecuting); + const CoordsXY& loc, int32_t elementIndex, int8_t offset, bool isExecuting); +GameActionResultPtr tile_inspector_track_set_block_brake( + const CoordsXY& loc, int32_t elementIndex, bool blockBrake, bool isExecuting); GameActionResultPtr tile_inspector_track_set_indestructible( - CoordsXY loc, int32_t elementIndex, bool isIndestructible, bool isExecuting); + const CoordsXY& loc, int32_t elementIndex, bool isIndestructible, bool isExecuting); GameActionResultPtr tile_inspector_track_set_chain( - CoordsXY loc, int32_t elementIndex, bool entireTrackBlock, bool setChain, bool isExecuting); + const CoordsXY& loc, int32_t elementIndex, bool entireTrackBlock, bool setChain, bool isExecuting); GameActionResultPtr tile_inspector_scenery_set_quarter_location( - CoordsXY loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting); + const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting); GameActionResultPtr tile_inspector_scenery_set_quarter_collision( - CoordsXY loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting); + const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting); GameActionResultPtr tile_inspector_banner_toggle_blocking_edge( - CoordsXY loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting); -GameActionResultPtr tile_inspector_corrupt_clamp(CoordsXY loc, int32_t elementIndex, bool isExecuting); + const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting); +GameActionResultPtr tile_inspector_corrupt_clamp(const CoordsXY& loc, int32_t elementIndex, bool isExecuting);