forked from rosebudai/OpenRCT2-Web
Receive CoordsXYZ by const ref instead of copy
This commit is contained in:
1 parent
473bb4683b
commit
181eaf768d
30 files changed
+107
-98
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -29,7 +29,7 @@ private:
|
||||
|
||||
public:
|
||||
FootpathRemoveAction() = default;
|
||||
FootpathRemoveAction(CoordsXYZ location)
|
||||
FootpathRemoveAction(const CoordsXYZ& location)
|
||||
: _loc(location)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
|
||||
public:
|
||||
FootpathSceneryRemoveAction() = default;
|
||||
FootpathSceneryRemoveAction(CoordsXYZ loc)
|
||||
FootpathSceneryRemoveAction(const CoordsXYZ& loc)
|
||||
: _loc(loc)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -71,7 +71,8 @@ static void paint_session_add_ps_to_quadrant(paint_session* session, paint_struc
|
||||
* Extracted from 0x0098196c, 0x0098197c, 0x0098198c, 0x0098199c
|
||||
*/
|
||||
static paint_struct* sub_9819_c(
|
||||
paint_session* session, uint32_t image_id, const CoordsXYZ& offset, CoordsXYZ boundBoxSize, CoordsXYZ boundBoxOffset)
|
||||
paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize,
|
||||
const CoordsXYZ& boundBoxOffset)
|
||||
{
|
||||
if (session->NextFreePaintStruct >= session->EndOfPaintStructArray)
|
||||
return nullptr;
|
||||
@@ -112,38 +113,40 @@ static paint_struct* sub_9819_c(
|
||||
if (bottom >= dpi->y + dpi->height)
|
||||
return nullptr;
|
||||
|
||||
auto rotatedBoundBoxSize = boundBoxSize;
|
||||
auto rotatedBoundBoxOffset = boundBoxOffset;
|
||||
// This probably rotates the variables so they're relative to rotation 0.
|
||||
switch (session->CurrentRotation)
|
||||
{
|
||||
case 0:
|
||||
boundBoxSize.x--;
|
||||
boundBoxSize.y--;
|
||||
boundBoxOffset = { boundBoxOffset.Rotate(0), boundBoxOffset.z };
|
||||
boundBoxSize = { boundBoxSize.Rotate(0), boundBoxSize.z };
|
||||
rotatedBoundBoxSize.x--;
|
||||
rotatedBoundBoxSize.y--;
|
||||
rotatedBoundBoxOffset = { rotatedBoundBoxOffset.Rotate(0), rotatedBoundBoxOffset.z };
|
||||
rotatedBoundBoxSize = { boundBoxSize.Rotate(0), rotatedBoundBoxSize.z };
|
||||
break;
|
||||
case 1:
|
||||
boundBoxSize.x--;
|
||||
boundBoxOffset = { boundBoxOffset.Rotate(3), boundBoxOffset.z };
|
||||
boundBoxSize = { boundBoxSize.Rotate(3), boundBoxSize.z };
|
||||
rotatedBoundBoxSize.x--;
|
||||
rotatedBoundBoxOffset = { rotatedBoundBoxOffset.Rotate(3), rotatedBoundBoxOffset.z };
|
||||
rotatedBoundBoxSize = { boundBoxSize.Rotate(3), rotatedBoundBoxSize.z };
|
||||
break;
|
||||
case 2:
|
||||
boundBoxSize = { boundBoxSize.Rotate(2), boundBoxSize.z };
|
||||
boundBoxOffset = { boundBoxOffset.Rotate(2), boundBoxOffset.z };
|
||||
rotatedBoundBoxSize = { boundBoxSize.Rotate(2), rotatedBoundBoxSize.z };
|
||||
rotatedBoundBoxOffset = { rotatedBoundBoxOffset.Rotate(2), rotatedBoundBoxOffset.z };
|
||||
break;
|
||||
case 3:
|
||||
boundBoxSize.y--;
|
||||
boundBoxSize = { boundBoxSize.Rotate(1), boundBoxSize.z };
|
||||
boundBoxOffset = { boundBoxOffset.Rotate(1), boundBoxOffset.z };
|
||||
rotatedBoundBoxSize.y--;
|
||||
rotatedBoundBoxSize = { boundBoxSize.Rotate(1), rotatedBoundBoxSize.z };
|
||||
rotatedBoundBoxOffset = { rotatedBoundBoxOffset.Rotate(1), rotatedBoundBoxOffset.z };
|
||||
break;
|
||||
}
|
||||
|
||||
ps->bounds.x_end = boundBoxSize.x + boundBoxOffset.x + session->SpritePosition.x;
|
||||
ps->bounds.z = boundBoxOffset.z;
|
||||
ps->bounds.z_end = boundBoxOffset.z + boundBoxSize.z;
|
||||
ps->bounds.y_end = boundBoxSize.y + boundBoxOffset.y + session->SpritePosition.y;
|
||||
ps->bounds.x_end = rotatedBoundBoxSize.x + rotatedBoundBoxOffset.x + session->SpritePosition.x;
|
||||
ps->bounds.z = rotatedBoundBoxOffset.z;
|
||||
ps->bounds.z_end = rotatedBoundBoxOffset.z + rotatedBoundBoxSize.z;
|
||||
ps->bounds.y_end = rotatedBoundBoxSize.y + rotatedBoundBoxOffset.y + session->SpritePosition.y;
|
||||
ps->flags = 0;
|
||||
ps->bounds.x = boundBoxOffset.x + session->SpritePosition.x;
|
||||
ps->bounds.y = boundBoxOffset.y + session->SpritePosition.y;
|
||||
ps->bounds.x = rotatedBoundBoxOffset.x + session->SpritePosition.x;
|
||||
ps->bounds.y = rotatedBoundBoxOffset.y + session->SpritePosition.y;
|
||||
ps->attached_ps = nullptr;
|
||||
ps->children = nullptr;
|
||||
ps->sprite_type = session->InteractionType;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -716,7 +716,7 @@ public: // Peep
|
||||
void Pickup();
|
||||
void PickupAbort(int32_t old_x);
|
||||
bool Place(TileCoordsXYZ location, bool apply);
|
||||
static Peep* Generate(const CoordsXYZ coords);
|
||||
static Peep* Generate(const CoordsXYZ& coords);
|
||||
void RemoveFromQueue();
|
||||
void RemoveFromRide();
|
||||
void InsertNewThought(PeepThoughtType thought_type, uint8_t thought_arguments);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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++)
|
||||
|
||||
@@ -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, const CoordsXYZ& offset,
|
||||
const CoordsXYZ& bbOffset, const CoordsXYZ& bbSize)
|
||||
{
|
||||
rct_ride_entry* rideEntry = ride->GetRideEntry();
|
||||
uint32_t vehicleImageId = rideEntry->vehicles[0].base_image_id + direction;
|
||||
@@ -132,26 +133,27 @@ static void paint_magic_carpet_vehicle(
|
||||
}
|
||||
|
||||
int8_t directionalOffset = MagicCarpetOscillationXY[swingImageId];
|
||||
auto directedOffset = offset;
|
||||
switch (direction)
|
||||
{
|
||||
case 0:
|
||||
offset.x -= directionalOffset;
|
||||
directedOffset.x -= directionalOffset;
|
||||
break;
|
||||
case 1:
|
||||
offset.y += directionalOffset;
|
||||
directedOffset.y += directionalOffset;
|
||||
break;
|
||||
case 2:
|
||||
offset.x += directionalOffset;
|
||||
directedOffset.x += directionalOffset;
|
||||
break;
|
||||
case 3:
|
||||
offset.y -= directionalOffset;
|
||||
directedOffset.y -= directionalOffset;
|
||||
break;
|
||||
}
|
||||
offset.z += MagicCarpetOscillationZ[swingImageId];
|
||||
directedOffset.z += MagicCarpetOscillationZ[swingImageId];
|
||||
|
||||
sub_98199C(
|
||||
session, vehicleImageId | imageColourFlags, (int8_t)offset.x, (int8_t)offset.y, bbSize.x, bbSize.y, 127, offset.z,
|
||||
bbOffset.x, bbOffset.y, bbOffset.z);
|
||||
session, vehicleImageId | imageColourFlags, (int8_t)directedOffset.x, (int8_t)directedOffset.y, bbSize.x, bbSize.y, 127,
|
||||
directedOffset.z, bbOffset.x, bbOffset.y, bbOffset.z);
|
||||
|
||||
// Riders
|
||||
rct_drawpixelinfo* dpi = &session->DPI;
|
||||
@@ -167,8 +169,8 @@ static void paint_magic_carpet_vehicle(
|
||||
imageId |= (vehicle->peep_tshirt_colours[peepIndex + 0] << 19);
|
||||
imageId |= (vehicle->peep_tshirt_colours[peepIndex + 1] << 24);
|
||||
sub_98199C(
|
||||
session, imageId, (int8_t)offset.x, (int8_t)offset.y, bbSize.x, bbSize.y, 127, offset.z, bbOffset.x,
|
||||
bbOffset.y, bbOffset.z);
|
||||
session, imageId, (int8_t)directedOffset.x, (int8_t)directedOffset.y, bbSize.x, bbSize.y, 127,
|
||||
directedOffset.z, bbOffset.x, bbOffset.y, bbOffset.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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(ScreenCoordsXY screenCoords, int32_t* direction, TileElement** tileElement);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -27,13 +27,13 @@ struct JumpingFountain : SpriteGeneric
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
@@ -75,8 +75,9 @@ void MoneyEffect::CreateAt(money32 value, int32_t x, int32_t y, int32_t z, bool
|
||||
*
|
||||
* rct2: 0x0069C5D0
|
||||
*/
|
||||
void MoneyEffect::Create(money32 value, CoordsXYZ loc)
|
||||
void MoneyEffect::Create(money32 value, const CoordsXYZ& loc)
|
||||
{
|
||||
auto validLoc = loc;
|
||||
if (loc.isNull())
|
||||
{
|
||||
// If game actions return no valid location of the action we can not use the screen
|
||||
@@ -97,10 +98,10 @@ void MoneyEffect::Create(money32 value, CoordsXYZ loc)
|
||||
if (!mapPositionXY)
|
||||
return;
|
||||
|
||||
loc = { *mapPositionXY, tile_element_height(*mapPositionXY) };
|
||||
validLoc = { *mapPositionXY, tile_element_height(*mapPositionXY) };
|
||||
}
|
||||
loc.z += 10;
|
||||
CreateAt(-value, loc.x, loc.y, loc.z, false);
|
||||
validLoc.z += 10;
|
||||
CreateAt(-value, validLoc.x, validLoc.y, validLoc.z, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,7 +82,7 @@ struct MoneyEffect : SpriteBase
|
||||
uint16_t wiggle;
|
||||
|
||||
static void CreateAt(money32 value, int32_t x, int32_t y, int32_t z, bool vertical);
|
||||
static void Create(money32 value, CoordsXYZ loc);
|
||||
static void Create(money32 value, const CoordsXYZ& loc);
|
||||
void Update();
|
||||
std::pair<rct_string_id, money32> GetStringId() const;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user