Merge pull request #10847 from tupaschoal/const-ref-coords

Prefer const ref to send (Tile)CoordsXY(ZD) over
This commit is contained in:
Michael Steenbeek 2020-03-01 14:38:39 +01:00 committed by GitHub
commit e3f5eb7275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 208 additions and 198 deletions

View File

@ -39,11 +39,11 @@
#include <openrct2/world/Surface.h>
#include <openrct2/world/Wall.h>
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_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, CoordsXY mapCoords);
static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords, int32_t maxDistance);
@ -503,7 +503,7 @@ int32_t viewport_interaction_right_click(const 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);
@ -574,7 +574,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 +593,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();

View File

@ -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

View File

@ -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;
@ -3332,7 +3332,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

View File

@ -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, CoordsXY origin, CoordsXY min, 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, CoordsXY min, 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,7 +557,7 @@ 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, CoordsXY origin, CoordsXY min, CoordsXY max)
{
uint8_t rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3;
@ -666,7 +666,7 @@ 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, CoordsXY min, CoordsXY max)
{
uint8_t rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3;
for (const auto& mazeElement : td6->maze_elements)

View File

@ -25,7 +25,7 @@ private:
public:
BannerPlaceAction() = default;
BannerPlaceAction(CoordsXYZD loc, uint8_t bannerType, BannerIndex bannerIndex, uint8_t primaryColour)
BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, BannerIndex bannerIndex, uint8_t primaryColour)
: _loc(loc)
, _bannerType(bannerType)
, _bannerIndex(bannerIndex)

View File

@ -22,7 +22,7 @@ private:
public:
BannerRemoveAction() = default;
BannerRemoveAction(CoordsXYZD loc)
BannerRemoveAction(const CoordsXYZD& loc)
: _loc(loc)
{
}

View File

@ -24,7 +24,7 @@ private:
public:
BannerSetColourAction() = default;
BannerSetColourAction(CoordsXYZD loc, uint8_t primaryColour)
BannerSetColourAction(const CoordsXYZD& loc, uint8_t primaryColour)
: _loc(loc)
, _primaryColour(primaryColour)
{

View File

@ -32,7 +32,7 @@ private:
public:
FootpathPlaceAction() = default;
FootpathPlaceAction(CoordsXYZ loc, uint8_t slope, uint8_t type, Direction direction = INVALID_DIRECTION)
FootpathPlaceAction(const CoordsXYZ& loc, uint8_t slope, uint8_t type, Direction direction = INVALID_DIRECTION)
: _loc(loc)
, _slope(slope)
, _type(type)

View File

@ -32,7 +32,7 @@ private:
public:
FootpathPlaceFromTrackAction() = default;
FootpathPlaceFromTrackAction(CoordsXYZ loc, uint8_t slope, uint8_t type, uint8_t edges)
FootpathPlaceFromTrackAction(const CoordsXYZ& loc, uint8_t slope, uint8_t type, uint8_t edges)
: _loc(loc)
, _slope(slope)
, _type(type)

View File

@ -29,7 +29,7 @@ private:
public:
FootpathRemoveAction() = default;
FootpathRemoveAction(CoordsXYZ location)
FootpathRemoveAction(const CoordsXYZ& location)
: _loc(location)
{
}

View File

@ -30,7 +30,7 @@ private:
public:
FootpathSceneryPlaceAction() = default;
FootpathSceneryPlaceAction(CoordsXYZ loc, uint8_t pathItemType)
FootpathSceneryPlaceAction(const CoordsXYZ& loc, uint8_t pathItemType)
: _loc(loc)
, _pathItemType(pathItemType)
{

View File

@ -28,7 +28,7 @@ private:
public:
FootpathSceneryRemoveAction() = default;
FootpathSceneryRemoveAction(CoordsXYZ loc)
FootpathSceneryRemoveAction(const CoordsXYZ& loc)
: _loc(loc)
{
}

View File

@ -25,7 +25,7 @@
*
* rct2: 0x00666F4E
*/
money32 park_entrance_place_ghost(CoordsXYZD entranceLoc)
money32 park_entrance_place_ghost(const CoordsXYZD& entranceLoc)
{
park_entrance_remove_ghost();

View File

@ -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<uint8_t>(LandBuyRightSetting::Count))
{

View File

@ -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)

View File

@ -56,7 +56,7 @@ private:
public:
LargeSceneryPlaceAction() = default;
LargeSceneryPlaceAction(CoordsXYZD loc, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
LargeSceneryPlaceAction(const CoordsXYZD& loc, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
: _loc(loc)
, _sceneryType(sceneryType)
, _primaryColour(primaryColour)

View File

@ -32,7 +32,7 @@ private:
public:
LargeSceneryRemoveAction() = default;
LargeSceneryRemoveAction(CoordsXYZD location, uint16_t tileIndex)
LargeSceneryRemoveAction(const CoordsXYZD& location, uint16_t tileIndex)
: _loc(location)
, _tileIndex(tileIndex)
{

View File

@ -25,7 +25,7 @@ private:
public:
LargeScenerySetColourAction() = default;
LargeScenerySetColourAction(CoordsXYZD loc, uint8_t tileIndex, uint8_t primaryColour, uint8_t secondaryColour)
LargeScenerySetColourAction(const CoordsXYZD& loc, uint8_t tileIndex, uint8_t primaryColour, uint8_t secondaryColour)
: _loc(loc)
, _tileIndex(tileIndex)
, _primaryColour(primaryColour)

View File

@ -23,7 +23,7 @@ private:
public:
MazePlaceTrackAction() = default;
MazePlaceTrackAction(CoordsXYZ location, NetworkRideId_t rideIndex, uint16_t mazeEntry)
MazePlaceTrackAction(const CoordsXYZ& location, NetworkRideId_t rideIndex, uint16_t mazeEntry)
: _loc(location)
, _rideIndex(rideIndex)
, _mazeEntry(mazeEntry)

View File

@ -59,7 +59,7 @@ public:
MazeSetTrackAction()
{
}
MazeSetTrackAction(CoordsXYZD location, bool initialPlacement, NetworkRideId_t rideIndex, uint8_t mode)
MazeSetTrackAction(const CoordsXYZD& location, bool initialPlacement, NetworkRideId_t rideIndex, uint8_t mode)
: _loc(location)
, _initialPlacement(initialPlacement)
, _rideIndex(rideIndex)

View File

@ -23,7 +23,7 @@ private:
public:
ParkEntranceRemoveAction() = default;
ParkEntranceRemoveAction(CoordsXYZ loc)
ParkEntranceRemoveAction(const CoordsXYZ& loc)
: _loc(loc)
{
}
@ -93,7 +93,7 @@ public:
}
private:
void ParkEntranceRemoveSegment(CoordsXYZ loc) const
void ParkEntranceRemoveSegment(const CoordsXYZ& loc) const
{
auto entranceElement = map_get_park_entrance_element_at(loc, true);
if (entranceElement == nullptr)

View File

@ -32,7 +32,7 @@ private:
public:
PeepPickupAction() = default;
PeepPickupAction(PeepPickupType type, uint32_t spriteId, CoordsXYZ loc, NetworkPlayerId_t owner)
PeepPickupAction(PeepPickupType type, uint32_t spriteId, const CoordsXYZ& loc, NetworkPlayerId_t owner)
: _type(static_cast<uint8_t>(type))
, _spriteId(spriteId)
, _loc(loc)

View File

@ -31,7 +31,7 @@ public:
PlaceParkEntranceAction()
{
}
PlaceParkEntranceAction(CoordsXYZD location)
PlaceParkEntranceAction(const CoordsXYZD& location)
: _loc(location)
{
}

View File

@ -28,7 +28,7 @@ public:
PlacePeepSpawnAction()
{
}
PlacePeepSpawnAction(CoordsXYZD location)
PlacePeepSpawnAction(const CoordsXYZD& location)
: _location(location)
{
}

View File

@ -230,7 +230,7 @@ public:
return res;
}
static GameActionResult::Ptr TrackPlaceQuery(const CoordsXYZ loc, const bool isExit)
static GameActionResult::Ptr TrackPlaceQuery(const CoordsXYZ& loc, const bool isExit)
{
auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION
: STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION;

View File

@ -30,7 +30,7 @@ private:
public:
RideSetColourSchemeAction() = default;
RideSetColourSchemeAction(CoordsXYZD location, int32_t trackType, uint16_t newColourScheme)
RideSetColourSchemeAction(const CoordsXYZD& location, int32_t trackType, uint16_t newColourScheme)
: _loc(location)
, _trackType(trackType)
, _newColourScheme(newColourScheme)

View File

@ -64,7 +64,7 @@ public:
SmallSceneryPlaceAction() = default;
SmallSceneryPlaceAction(
CoordsXYZD loc, uint8_t quadrant, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
const CoordsXYZD& loc, uint8_t quadrant, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
: _loc(loc)
, _quadrant(quadrant)
, _sceneryType(sceneryType)

View File

@ -33,7 +33,7 @@ private:
public:
SmallSceneryRemoveAction() = default;
SmallSceneryRemoveAction(CoordsXYZ location, uint8_t quadrant, uint8_t sceneryType)
SmallSceneryRemoveAction(const CoordsXYZ& location, uint8_t quadrant, uint8_t sceneryType)
: _loc(location)
, _quadrant(quadrant)
, _sceneryType(sceneryType)

View File

@ -40,7 +40,7 @@ public:
SmallScenerySetColourAction() = default;
SmallScenerySetColourAction(
CoordsXYZ loc, uint8_t quadrant, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
const CoordsXYZ& loc, uint8_t quadrant, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
: _loc(loc)
, _quadrant(quadrant)
, _sceneryType(sceneryType)

View File

@ -44,7 +44,7 @@ private:
public:
TrackDesignAction() = default;
TrackDesignAction(CoordsXYZD location, const TrackDesign& td)
TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td)
: _loc(location)
, _td(td)
{

View File

@ -59,7 +59,7 @@ public:
}
TrackPlaceAction(
NetworkRideId_t rideIndex, int32_t trackType, CoordsXYZD origin, int32_t brakeSpeed, int32_t colour,
NetworkRideId_t rideIndex, int32_t trackType, const CoordsXYZD& origin, int32_t brakeSpeed, int32_t colour,
int32_t seatRotation, int32_t liftHillAndAlternativeState)
: _rideIndex(rideIndex)
, _trackType(trackType)

View File

@ -31,7 +31,7 @@ public:
{
}
TrackRemoveAction(int32_t trackType, int32_t sequence, CoordsXYZD origin)
TrackRemoveAction(int32_t trackType, int32_t sequence, const CoordsXYZD& origin)
: _trackType(trackType)
, _sequence(sequence)
, _origin(origin)

View File

@ -21,7 +21,7 @@ private:
public:
TrackSetBrakeSpeedAction() = default;
TrackSetBrakeSpeedAction(CoordsXYZ loc, track_type_t trackType, uint8_t brakeSpeed)
TrackSetBrakeSpeedAction(const CoordsXYZ& loc, track_type_t trackType, uint8_t brakeSpeed)
: _loc(loc)
, _trackType(trackType)
, _brakeSpeed(brakeSpeed)

View File

@ -64,7 +64,8 @@ public:
WallPlaceAction() = default;
WallPlaceAction(
int32_t wallType, CoordsXYZ loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour, int32_t tertiaryColour)
int32_t wallType, const CoordsXYZ& loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour,
int32_t tertiaryColour)
: _wallType(wallType)
, _loc(loc)
, _edge(edge)

View File

@ -35,7 +35,7 @@ public:
{
}
WallSetColourAction(CoordsXYZD loc, int32_t primaryColour, int32_t secondaryColour, int32_t tertiaryColour)
WallSetColourAction(const CoordsXYZD& loc, int32_t primaryColour, int32_t secondaryColour, int32_t tertiaryColour)
: _loc(loc)
, _primaryColour(primaryColour)
, _secondaryColour(secondaryColour)

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -3293,7 +3293,7 @@ CoordsXYZ network_get_player_last_action_coord(uint32_t index)
return gNetwork.player_list[index]->LastActionCoord;
}
void network_set_player_last_action_coord(uint32_t index, CoordsXYZ coord)
void network_set_player_last_action_coord(uint32_t index, const CoordsXYZ& coord)
{
if (index < gNetwork.player_list.size())
{
@ -3951,7 +3951,7 @@ CoordsXYZ network_get_player_last_action_coord(uint32_t index)
{
return { 0, 0, 0 };
}
void network_set_player_last_action_coord(uint32_t index, CoordsXYZ coord)
void network_set_player_last_action_coord(uint32_t index, const CoordsXYZ& coord)
{
}
uint32_t network_get_player_commands_ran(uint32_t index)

View File

@ -65,7 +65,7 @@ void network_add_player_money_spent(uint32_t index, money32 cost);
int32_t network_get_player_last_action(uint32_t index, int32_t time);
void network_set_player_last_action(uint32_t index, int32_t command);
CoordsXYZ network_get_player_last_action_coord(uint32_t index);
void network_set_player_last_action_coord(uint32_t index, CoordsXYZ coord);
void network_set_player_last_action_coord(uint32_t index, const CoordsXYZ& coord);
uint32_t network_get_player_commands_ran(uint32_t index);
int32_t network_get_player_index(uint32_t id);
uint8_t network_get_player_group(uint32_t index);

View File

@ -471,7 +471,7 @@ static uint8_t peep_pathfind_get_max_number_junctions(Peep* peep)
* since entrances and ride queues coming off a path should not result in
* the path being considered a junction.
*/
static bool path_is_thin_junction(PathElement* path, TileCoordsXYZ loc)
static bool path_is_thin_junction(PathElement* path, const TileCoordsXYZ& loc)
{
uint8_t edges = path->GetEdges();
@ -503,7 +503,7 @@ static bool path_is_thin_junction(PathElement* path, TileCoordsXYZ loc)
return thin_junction;
}
static int32_t CalculateHeuristicPathingScore(TileCoordsXYZ loc1, TileCoordsXYZ loc2)
static int32_t CalculateHeuristicPathingScore(const TileCoordsXYZ& loc1, const TileCoordsXYZ& loc2)
{
auto xDelta = abs(loc1.x - loc2.x) * 32;
auto yDelta = abs(loc1.y - loc2.y) * 32;
@ -1161,7 +1161,7 @@ static void peep_pathfind_heuristic_search(
*
* rct2: 0x0069A5F0
*/
Direction peep_pathfind_choose_direction(TileCoordsXYZ loc, Peep* peep)
Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
{
// The max number of thin junctions searched - a per-search-path limit.
_peepPathFindMaxJunctions = peep_pathfind_get_max_number_junctions(peep);

View File

@ -757,7 +757,7 @@ void Peep::PickupAbort(int32_t old_x)
}
// Returns true when a peep can be dropped at the given location. When apply is set to true the peep gets dropped.
bool Peep::Place(TileCoordsXYZ location, bool apply)
bool Peep::Place(const TileCoordsXYZ& location, bool apply)
{
auto* pathElement = map_get_path_element_at(location);
TileElement* tileElement = reinterpret_cast<TileElement*>(pathElement);
@ -1610,7 +1610,7 @@ void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgument
*
* rct2: 0x0069A05D
*/
Peep* Peep::Generate(const CoordsXYZ coords)
Peep* Peep::Generate(const CoordsXYZ& coords)
{
if (gSpriteListCount[SPRITE_LIST_FREE] < 400)
return nullptr;

View File

@ -715,8 +715,8 @@ public: // Peep
void SetNextFlags(uint8_t next_direction, bool is_sloped, bool is_surface);
void Pickup();
void PickupAbort(int32_t old_x);
bool Place(TileCoordsXYZ location, bool apply);
static Peep* Generate(const CoordsXYZ coords);
bool Place(const TileCoordsXYZ& location, bool apply);
static Peep* Generate(const CoordsXYZ& coords);
void RemoveFromQueue();
void RemoveFromRide();
void InsertNewThought(PeepThoughtType thought_type, uint8_t thought_arguments);
@ -985,7 +985,7 @@ void peep_update_names(bool realNames);
void guest_set_name(uint16_t spriteIndex, const char* name);
Direction peep_pathfind_choose_direction(TileCoordsXYZ loc, Peep* peep);
Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep);
void peep_reset_pathfind_goal(Peep* peep);
bool is_valid_path_z_and_direction(TileElement* tileElement, int32_t currentZ, int32_t currentDirection);

View File

@ -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);
}

View File

@ -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);

View File

@ -3221,7 +3221,7 @@ void ride_check_all_reachable()
* rct2: 0x006B7C59
* @return true if the coordinate is reachable or has no entrance, false otherwise
*/
static bool ride_entrance_exit_is_reachable(TileCoordsXYZD coordinates)
static bool ride_entrance_exit_is_reachable(const TileCoordsXYZD& coordinates)
{
if (coordinates.isNull())
return true;
@ -3540,7 +3540,8 @@ static int32_t ride_music_params_update_label_58(uint32_t position, uint8_t* tun
* @param tuneId (bh)
* @returns new position (ebp)
*/
int32_t ride_music_params_update(CoordsXYZ rideCoords, Ride* ride, uint16_t sampleRate, uint32_t position, uint8_t* tuneId)
int32_t ride_music_params_update(
const CoordsXYZ& rideCoords, Ride* ride, uint16_t sampleRate, uint32_t position, uint8_t* tuneId)
{
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gGameSoundsOff && g_music_tracking_viewport != nullptr)
{

View File

@ -1168,7 +1168,8 @@ int32_t sub_6C683D(
int32_t* x, int32_t* y, int32_t* z, int32_t direction, int32_t type, uint16_t extra_params, TileElement** output_element,
uint16_t flags);
void ride_set_map_tooltip(TileElement* tileElement);
int32_t ride_music_params_update(CoordsXYZ rideCoords, Ride* ride, uint16_t sampleRate, uint32_t position, uint8_t* tuneId);
int32_t ride_music_params_update(
const CoordsXYZ& rideCoords, Ride* ride, uint16_t sampleRate, uint32_t position, uint8_t* tuneId);
void ride_music_update_final();
void ride_prepare_breakdown(Ride* ride, int32_t breakdownReason);
TileElement* ride_get_station_start_track_element(Ride* ride, int32_t stationIndex);

View File

@ -422,12 +422,12 @@ void ride_clear_exit_location(Ride* ride, const int32_t stationIndex)
ride->stations[stationIndex].Exit.setNull();
}
void ride_set_entrance_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD location)
void ride_set_entrance_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD& location)
{
ride->stations[stationIndex].Entrance = location;
}
void ride_set_exit_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD location)
void ride_set_exit_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD& location)
{
ride->stations[stationIndex].Exit = location;
}

View File

@ -23,5 +23,5 @@ TileCoordsXYZD ride_get_exit_location(const Ride* ride, const int32_t stationInd
void ride_clear_entrance_location(Ride* ride, const int32_t stationIndex);
void ride_clear_exit_location(Ride* ride, const int32_t stationIndex);
void ride_set_entrance_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD location);
void ride_set_exit_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD location);
void ride_set_entrance_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD& location);
void ride_set_exit_location(Ride* ride, const int32_t stationIndex, const TileCoordsXYZD& location);

View File

@ -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();

View File

@ -43,8 +43,8 @@ std::vector<TrackDesignSceneryElement> _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)
{
@ -190,7 +190,7 @@ static void track_design_save_push_tile_element(CoordsXY loc, TileElement* tileE
* rct2: 0x006D2FA7
*/
static void track_design_save_push_tile_element_desc(
const rct_object_entry* entry, CoordsXYZ loc, uint8_t flags, uint8_t primaryColour, uint8_t secondaryColour)
const rct_object_entry* entry, const CoordsXYZ& loc, uint8_t flags, uint8_t primaryColour, uint8_t secondaryColour)
{
TrackDesignSceneryElement item{};
item.scenery_object = *entry;
@ -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);
@ -358,7 +358,7 @@ static void track_design_save_pop_tile_element(CoordsXY loc, TileElement* tileEl
*
* rct2: 0x006D2FDD
*/
static void track_design_save_pop_tile_element_desc(const rct_object_entry* entry, CoordsXYZ loc, uint8_t flags)
static void track_design_save_pop_tile_element_desc(const rct_object_entry* entry, const CoordsXYZ& loc, uint8_t flags)
{
size_t removeIndex = SIZE_MAX;
for (size_t i = 0; i < _trackSavedTileElementsDesc.size(); i++)
@ -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)
{

View File

@ -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;

View File

@ -282,8 +282,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(
@ -304,7 +304,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(

View File

@ -68,7 +68,8 @@ static Vehicle* get_first_vehicle(Ride* ride)
}
static void paint_magic_carpet_frame(
paint_session* session, uint8_t plane, uint8_t direction, CoordsXYZ offset, CoordsXYZ bbOffset, CoordsXYZ bbSize)
paint_session* session, uint8_t plane, uint8_t direction, const CoordsXYZ& offset, const CoordsXYZ& bbOffset,
const CoordsXYZ& bbSize)
{
uint32_t imageId;
if (direction & 1)
@ -95,8 +96,8 @@ static void paint_magic_carpet_frame(
}
static void paint_magic_carpet_pendulum(
paint_session* session, uint8_t plane, uint32_t swingImageId, uint8_t direction, CoordsXYZ offset, CoordsXYZ bbOffset,
CoordsXYZ bbSize)
paint_session* session, uint8_t plane, uint32_t swingImageId, uint8_t direction, const CoordsXYZ& offset,
const CoordsXYZ& bbOffset, const CoordsXYZ& bbSize)
{
uint32_t imageId = swingImageId;
if (direction & 2)
@ -118,8 +119,8 @@ static void paint_magic_carpet_pendulum(
}
static void paint_magic_carpet_vehicle(
paint_session* session, Ride* ride, uint8_t direction, uint32_t swingImageId, CoordsXYZ offset, CoordsXYZ bbOffset,
CoordsXYZ bbSize)
paint_session* session, Ride* ride, uint8_t direction, uint32_t swingImageId, CoordsXYZ offset, const CoordsXYZ& bbOffset,
const CoordsXYZ& bbSize)
{
rct_ride_entry* rideEntry = ride->GetRideEntry();
uint32_t vehicleImageId = rideEntry->vehicles[0].base_image_id + direction;

View File

@ -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)
{

View File

@ -42,7 +42,7 @@ extern CoordsXYZD gRideEntranceExitGhostPosition;
extern uint8_t gRideEntranceExitGhostStationIndex;
void park_entrance_remove_ghost();
money32 park_entrance_place_ghost(CoordsXYZD entranceLoc);
money32 park_entrance_place_ghost(const CoordsXYZD& entranceLoc);
void reset_park_entrance();
void maze_entrance_hedge_replacement(const CoordsXYE& entrance);

View File

@ -111,7 +111,7 @@ static bool entrance_has_direction(TileElement* tileElement, int32_t direction)
return entrance_get_directions(tileElement) & (1 << (direction & 3));
}
TileElement* map_get_footpath_element(CoordsXYZ coords)
TileElement* map_get_footpath_element(const CoordsXYZ& coords)
{
TileElement* tileElement = map_get_first_element_at(coords);
do
@ -125,7 +125,7 @@ TileElement* map_get_footpath_element(CoordsXYZ coords)
return nullptr;
}
money32 footpath_remove(CoordsXYZ footpathLoc, int32_t flags)
money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags)
{
auto action = FootpathRemoveAction(footpathLoc);
action.SetFlags(flags);
@ -143,7 +143,7 @@ money32 footpath_remove(CoordsXYZ footpathLoc, int32_t flags)
*
* rct2: 0x006A76FF
*/
money32 footpath_provisional_set(int32_t type, CoordsXYZ footpathLoc, int32_t slope)
money32 footpath_provisional_set(int32_t type, const CoordsXYZ& footpathLoc, int32_t slope)
{
money32 cost;
@ -1986,7 +1986,7 @@ static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, in
// Returns true when there is an element at the given coordinates that want to connect to a path with the given direction (ride
// entrances and exits, shops, paths).
bool tile_element_wants_path_connection_towards(TileCoordsXYZD coords, const TileElement* const elementToBeRemoved)
bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved)
{
TileElement* tileElement = map_get_first_element_at(coords.ToCoordsXY());
if (tileElement == nullptr)

View File

@ -175,12 +175,12 @@ extern const CoordsXY DirectionOffsets[NumOrthogonalDirections];
extern const CoordsXY BinUseOffsets[NumOrthogonalDirections];
extern const CoordsXY BenchUseOffsets[NumOrthogonalDirections * 2];
TileElement* map_get_footpath_element(CoordsXYZ coords);
TileElement* map_get_footpath_element(const CoordsXYZ& coords);
struct PathElement;
PathElement* map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope);
void footpath_interrupt_peeps(const CoordsXYZ& footpathPos);
money32 footpath_remove(CoordsXYZ footpathLoc, int32_t flags);
money32 footpath_provisional_set(int32_t type, CoordsXYZ footpathLoc, int32_t slope);
money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags);
money32 footpath_provisional_set(int32_t type, const CoordsXYZ& footpathLoc, int32_t slope);
void footpath_provisional_remove();
void footpath_provisional_update();
CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement);

View File

@ -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();
@ -130,7 +130,7 @@ void JumpingFountain::StartAnimation(const int32_t newType, const CoordsXY newLo
}
void JumpingFountain::Create(
const int32_t newType, const CoordsXYZ newLoc, const int32_t direction, const int32_t newFlags, const int32_t iteration)
const int32_t newType, const CoordsXYZ& newLoc, const int32_t direction, const int32_t newFlags, const int32_t iteration)
{
auto* jumpingFountain = reinterpret_cast<JumpingFountain*>(create_sprite(SPRITE_IDENTIFIER_MISC));
if (jumpingFountain != nullptr)
@ -244,7 +244,7 @@ void JumpingFountain::AdvanceAnimation()
Random({ newLoc, z }, availableDirections);
}
bool JumpingFountain::IsJumpingFountain(const int32_t newType, const CoordsXYZ newLoc)
bool JumpingFountain::IsJumpingFountain(const int32_t newType, const CoordsXYZ& newLoc)
{
const int32_t pathBitFlagMask = newType == JUMPING_FOUNTAIN_TYPE_SNOW ? PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW
: PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER;
@ -274,7 +274,7 @@ bool JumpingFountain::IsJumpingFountain(const int32_t newType, const CoordsXYZ n
return false;
}
void JumpingFountain::GoToEdge(const CoordsXYZ newLoc, const int32_t availableDirections) const
void JumpingFountain::GoToEdge(const CoordsXYZ& newLoc, const int32_t availableDirections) const
{
int32_t direction = (sprite_direction >> 3) << 1;
if (availableDirections & (1 << direction))
@ -311,7 +311,7 @@ void JumpingFountain::GoToEdge(const CoordsXYZ newLoc, const int32_t availableDi
CreateNext(newLoc, direction);
}
void JumpingFountain::Bounce(const CoordsXYZ newLoc, const int32_t availableDirections)
void JumpingFountain::Bounce(const CoordsXYZ& newLoc, const int32_t availableDirections)
{
Iteration++;
if (Iteration < 8)
@ -332,7 +332,7 @@ void JumpingFountain::Bounce(const CoordsXYZ newLoc, const int32_t availableDire
}
}
void JumpingFountain::Split(const CoordsXYZ newLoc, int32_t availableDirections) const
void JumpingFountain::Split(const CoordsXYZ& newLoc, int32_t availableDirections) const
{
if (Iteration < 3)
{
@ -358,7 +358,7 @@ void JumpingFountain::Split(const CoordsXYZ newLoc, int32_t availableDirections)
}
}
void JumpingFountain::Random(const CoordsXYZ newLoc, int32_t availableDirections) const
void JumpingFountain::Random(const CoordsXYZ& newLoc, int32_t availableDirections) const
{
const uint32_t randomIndex = scenario_rand();
if ((randomIndex & 0xFFFF) >= _FountainChanceOfStoppingRandomMode)
@ -372,7 +372,7 @@ void JumpingFountain::Random(const CoordsXYZ newLoc, int32_t availableDirections
}
}
void JumpingFountain::CreateNext(const CoordsXYZ newLoc, int32_t direction) const
void JumpingFountain::CreateNext(const CoordsXYZ& newLoc, int32_t direction) const
{
const int32_t newType = GetType();
int32_t newFlags = FountainFlags & ~FOUNTAIN_FLAG::DIRECTION;

View File

@ -22,18 +22,18 @@ 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;
void AdvanceAnimation();
void GoToEdge(CoordsXYZ newLoc, int32_t availableDirections) const;
void Bounce(CoordsXYZ newLoc, int32_t availableDirections);
void Split(CoordsXYZ newLoc, int32_t availableDirections) const;
void Random(CoordsXYZ newLoc, int32_t availableDirections) const;
void CreateNext(CoordsXYZ newLoc, int32_t direction) const;
static void Create(int32_t newType, CoordsXYZ newLoc, int32_t direction, int32_t newFlags, int32_t iteration);
static bool IsJumpingFountain(int32_t newType, CoordsXYZ newLoc);
void GoToEdge(const CoordsXYZ& newLoc, int32_t availableDirections) const;
void Bounce(const CoordsXYZ& newLoc, int32_t availableDirections);
void Split(const CoordsXYZ& newLoc, int32_t availableDirections) const;
void Random(const CoordsXYZ& newLoc, int32_t availableDirections) const;
void CreateNext(const CoordsXYZ& newLoc, int32_t direction) const;
static void Create(int32_t newType, const CoordsXYZ& newLoc, int32_t direction, int32_t newFlags, int32_t iteration);
static bool IsJumpingFountain(int32_t newType, const CoordsXYZ& newLoc);
};
enum

View File

@ -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)
{
@ -211,7 +211,7 @@ void tile_element_iterator_restart_for_tile(tile_element_iterator* it);
void map_update_tiles();
int32_t map_get_highest_z(const CoordsXY& loc);
bool tile_element_wants_path_connection_towards(TileCoordsXYZD coords, const TileElement* const elementToBeRemoved);
bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved);
void map_remove_out_of_range_elements();
void map_extend_boundary_surface();

View File

@ -25,7 +25,7 @@
#include "SmallScenery.h"
#include "Sprite.h"
using map_animation_invalidate_event_handler = bool (*)(CoordsXYZ loc);
using map_animation_invalidate_event_handler = bool (*)(const CoordsXYZ& loc);
static std::vector<MapAnimation> _mapAnimations;
@ -46,7 +46,7 @@ static bool DoesAnimationExist(int32_t type, const CoordsXYZ& location)
return false;
}
void map_animation_create(int32_t type, const CoordsXYZ loc)
void map_animation_create(int32_t type, const CoordsXYZ& loc)
{
if (!DoesAnimationExist(type, loc))
{
@ -87,7 +87,7 @@ void map_animation_invalidate_all()
*
* rct2: 0x00666670
*/
static bool map_animation_invalidate_ride_entrance(CoordsXYZ loc)
static bool map_animation_invalidate_ride_entrance(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
auto tileElement = map_get_first_element_at(loc);
@ -122,7 +122,7 @@ static bool map_animation_invalidate_ride_entrance(CoordsXYZ loc)
*
* rct2: 0x006A7BD4
*/
static bool map_animation_invalidate_queue_banner(CoordsXYZ loc)
static bool map_animation_invalidate_queue_banner(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -156,7 +156,7 @@ static bool map_animation_invalidate_queue_banner(CoordsXYZ loc)
*
* rct2: 0x006E32C9
*/
static bool map_animation_invalidate_small_scenery(CoordsXYZ loc)
static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -233,7 +233,7 @@ static bool map_animation_invalidate_small_scenery(CoordsXYZ loc)
*
* rct2: 0x00666C63
*/
static bool map_animation_invalidate_park_entrance(CoordsXYZ loc)
static bool map_animation_invalidate_park_entrance(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -263,7 +263,7 @@ static bool map_animation_invalidate_park_entrance(CoordsXYZ loc)
*
* rct2: 0x006CE29E
*/
static bool map_animation_invalidate_track_waterfall(CoordsXYZ loc)
static bool map_animation_invalidate_track_waterfall(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -292,7 +292,7 @@ static bool map_animation_invalidate_track_waterfall(CoordsXYZ loc)
*
* rct2: 0x006CE2F3
*/
static bool map_animation_invalidate_track_rapids(CoordsXYZ loc)
static bool map_animation_invalidate_track_rapids(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -321,7 +321,7 @@ static bool map_animation_invalidate_track_rapids(CoordsXYZ loc)
*
* rct2: 0x006CE39D
*/
static bool map_animation_invalidate_track_onridephoto(CoordsXYZ loc)
static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -362,7 +362,7 @@ static bool map_animation_invalidate_track_onridephoto(CoordsXYZ loc)
*
* rct2: 0x006CE348
*/
static bool map_animation_invalidate_track_whirlpool(CoordsXYZ loc)
static bool map_animation_invalidate_track_whirlpool(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -391,7 +391,7 @@ static bool map_animation_invalidate_track_whirlpool(CoordsXYZ loc)
*
* rct2: 0x006CE3FA
*/
static bool map_animation_invalidate_track_spinningtunnel(CoordsXYZ loc)
static bool map_animation_invalidate_track_spinningtunnel(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -420,7 +420,7 @@ static bool map_animation_invalidate_track_spinningtunnel(CoordsXYZ loc)
*
* rct2: 0x0068DF8F
*/
static bool map_animation_invalidate_remove([[maybe_unused]] CoordsXYZ loc)
static bool map_animation_invalidate_remove([[maybe_unused]] const CoordsXYZ& loc)
{
return true;
}
@ -429,7 +429,7 @@ static bool map_animation_invalidate_remove([[maybe_unused]] CoordsXYZ loc)
*
* rct2: 0x006BA2BB
*/
static bool map_animation_invalidate_banner(CoordsXYZ loc)
static bool map_animation_invalidate_banner(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -454,7 +454,7 @@ static bool map_animation_invalidate_banner(CoordsXYZ loc)
*
* rct2: 0x006B94EB
*/
static bool map_animation_invalidate_large_scenery(CoordsXYZ loc)
static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -486,7 +486,7 @@ static bool map_animation_invalidate_large_scenery(CoordsXYZ loc)
*
* rct2: 0x006E5B50
*/
static bool map_animation_invalidate_wall_door(CoordsXYZ loc)
static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
@ -551,7 +551,7 @@ static bool map_animation_invalidate_wall_door(CoordsXYZ loc)
*
* rct2: 0x006E5EE4
*/
static bool map_animation_invalidate_wall(CoordsXYZ loc)
static bool map_animation_invalidate_wall(const CoordsXYZ& loc)
{
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;

View File

@ -39,7 +39,7 @@ enum
MAP_ANIMATION_TYPE_COUNT
};
void map_animation_create(int32_t type, const CoordsXYZ loc);
void map_animation_create(int32_t type, const CoordsXYZ& loc);
void map_animation_invalidate_all();
const std::vector<MapAnimation>& GetMapAnimations();
void AutoCreateMapAnimations();

View File

@ -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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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>();
}
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<GameActionResult>();
@ -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>();
}
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);

View File

@ -28,33 +28,36 @@ enum TILE_INSPECTOR_ELEMENT_TYPE
class GameActionResult;
using GameActionResultPtr = std::unique_ptr<GameActionResult>;
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);