forked from rosebudai/OpenRCT2-Web
Merge pull request #10695 from ZehMatt/coords-constref
Cleanup some code around CoordsXY
This commit is contained in:
55 files changed
+158
-243
No files matched your search
@@ -134,7 +134,7 @@ private:
|
||||
return result;
|
||||
}
|
||||
|
||||
money32 ClearSceneryFromTile(CoordsXY tilePos, bool executing) const
|
||||
money32 ClearSceneryFromTile(const CoordsXY& tilePos, bool executing) const
|
||||
{
|
||||
// Pass down all flags.
|
||||
TileElement* tileElement = nullptr;
|
||||
|
||||
@@ -43,13 +43,13 @@ private:
|
||||
public:
|
||||
LandBuyRightsAction() = default;
|
||||
|
||||
LandBuyRightsAction(MapRange range, LandBuyRightSetting setting)
|
||||
LandBuyRightsAction(const MapRange& range, LandBuyRightSetting setting)
|
||||
: _range(range)
|
||||
, _setting(static_cast<uint8_t>(setting))
|
||||
{
|
||||
}
|
||||
|
||||
LandBuyRightsAction(CoordsXY coord, LandBuyRightSetting setting)
|
||||
LandBuyRightsAction(const CoordsXY& coord, LandBuyRightSetting setting)
|
||||
: _range(coord.x, coord.y, coord.x, coord.y)
|
||||
, _setting(static_cast<uint8_t>(setting))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
LandLowerAction()
|
||||
{
|
||||
}
|
||||
LandLowerAction(CoordsXY coords, MapRange range, uint8_t selectionType)
|
||||
LandLowerAction(const CoordsXY& coords, MapRange range, uint8_t selectionType)
|
||||
: _coords(coords)
|
||||
, _range(range)
|
||||
, _selectionType(selectionType)
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
LandRaiseAction()
|
||||
{
|
||||
}
|
||||
LandRaiseAction(CoordsXY coords, MapRange range, uint8_t selectionType)
|
||||
LandRaiseAction(const CoordsXY& coords, MapRange range, uint8_t selectionType)
|
||||
: _coords(coords)
|
||||
, _range(range)
|
||||
, _selectionType(selectionType)
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
LandSetHeightAction()
|
||||
{
|
||||
}
|
||||
LandSetHeightAction(CoordsXY coords, uint8_t height, uint8_t style)
|
||||
LandSetHeightAction(const CoordsXY& coords, uint8_t height, uint8_t style)
|
||||
: _coords(coords)
|
||||
, _height(height)
|
||||
, _style(style)
|
||||
|
||||
@@ -45,14 +45,14 @@ private:
|
||||
public:
|
||||
LandSetRightsAction() = default;
|
||||
|
||||
LandSetRightsAction(MapRange range, LandSetRightSetting setting, uint8_t ownership = 0)
|
||||
LandSetRightsAction(const MapRange& range, LandSetRightSetting setting, uint8_t ownership = 0)
|
||||
: _range(range)
|
||||
, _setting(static_cast<uint8_t>(setting))
|
||||
, _ownership(ownership)
|
||||
{
|
||||
}
|
||||
|
||||
LandSetRightsAction(CoordsXY coord, LandSetRightSetting setting, uint8_t ownership = 0)
|
||||
LandSetRightsAction(const CoordsXY& coord, LandSetRightSetting setting, uint8_t ownership = 0)
|
||||
: _range(coord.x, coord.y, coord.x, coord.y)
|
||||
, _setting(static_cast<uint8_t>(setting))
|
||||
, _ownership(ownership)
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
LandSmoothAction()
|
||||
{
|
||||
}
|
||||
LandSmoothAction(CoordsXY coords, MapRange range, uint8_t selectionType, bool isLowering)
|
||||
LandSmoothAction(const CoordsXY& coords, MapRange range, uint8_t selectionType, bool isLowering)
|
||||
: _coords(coords)
|
||||
, _range(range)
|
||||
, _selectionType(selectionType)
|
||||
@@ -105,8 +105,8 @@ private:
|
||||
}
|
||||
|
||||
money32 SmoothLandRowByEdge(
|
||||
bool isExecuting, CoordsXY loc, int32_t expectedLandHeight1, int32_t expectedLandHeight2, int32_t stepX, int32_t stepY,
|
||||
int32_t direction1, int32_t direction2, int32_t checkDirection1, int32_t checkDirection2) const
|
||||
bool isExecuting, const CoordsXY& loc, int32_t expectedLandHeight1, int32_t expectedLandHeight2, int32_t stepX,
|
||||
int32_t stepY, int32_t direction1, int32_t direction2, int32_t checkDirection1, int32_t checkDirection2) const
|
||||
{
|
||||
uint8_t shouldContinue = 0xF;
|
||||
int32_t landChangePerTile = _isLowering ? 2 : -2;
|
||||
@@ -249,7 +249,7 @@ private:
|
||||
}
|
||||
|
||||
money32 SmoothLandRowByCorner(
|
||||
bool isExecuting, CoordsXY loc, int32_t expectedLandHeight, int32_t stepX, int32_t stepY, int32_t direction,
|
||||
bool isExecuting, const CoordsXY& loc, int32_t expectedLandHeight, int32_t stepX, int32_t stepY, int32_t direction,
|
||||
int32_t checkDirection) const
|
||||
{
|
||||
bool shouldContinue = true;
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
public:
|
||||
RideEntranceExitPlaceAction() = default;
|
||||
|
||||
RideEntranceExitPlaceAction(CoordsXY loc, Direction direction, ride_id_t rideIndex, uint8_t stationNum, bool isExit)
|
||||
RideEntranceExitPlaceAction(const CoordsXY& loc, Direction direction, ride_id_t rideIndex, uint8_t stationNum, bool isExit)
|
||||
: _loc(loc)
|
||||
, _direction(direction)
|
||||
, _rideIndex(rideIndex)
|
||||
|
||||
@@ -25,7 +25,7 @@ private:
|
||||
public:
|
||||
RideEntranceExitRemoveAction() = default;
|
||||
|
||||
RideEntranceExitRemoveAction(CoordsXY loc, ride_id_t rideIndex, uint8_t stationNum, bool isExit)
|
||||
RideEntranceExitRemoveAction(const CoordsXY& loc, ride_id_t rideIndex, uint8_t stationNum, bool isExit)
|
||||
: _loc(loc)
|
||||
, _rideIndex(rideIndex)
|
||||
, _stationNum(stationNum)
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
StaffSetPatrolAreaAction()
|
||||
{
|
||||
}
|
||||
StaffSetPatrolAreaAction(uint16_t spriteId, CoordsXY loc)
|
||||
StaffSetPatrolAreaAction(uint16_t spriteId, const CoordsXY& loc)
|
||||
: _spriteId(spriteId)
|
||||
, _loc(loc)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
WaterSetHeightAction()
|
||||
{
|
||||
}
|
||||
WaterSetHeightAction(CoordsXY coords, uint8_t height)
|
||||
WaterSetHeightAction(const CoordsXY& coords, uint8_t height)
|
||||
: _coords(coords)
|
||||
, _height(height)
|
||||
{
|
||||
|
||||
@@ -103,10 +103,8 @@ void viewport_init_all()
|
||||
* out_x : ax
|
||||
* out_y : bx
|
||||
*/
|
||||
std::optional<ScreenCoordsXY> centre_2d_coordinates(CoordsXYZ loc, rct_viewport* viewport)
|
||||
std::optional<ScreenCoordsXY> centre_2d_coordinates(const CoordsXYZ& loc, rct_viewport* viewport)
|
||||
{
|
||||
auto screenCoord = translate_3d_to_2d_with_z(get_current_rotation(), loc);
|
||||
|
||||
// If the start location was invalid
|
||||
// propagate the invalid location to the output.
|
||||
// This fixes a bug that caused the game to enter an infinite loop.
|
||||
@@ -115,6 +113,7 @@ std::optional<ScreenCoordsXY> centre_2d_coordinates(CoordsXYZ loc, rct_viewport*
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto screenCoord = translate_3d_to_2d_with_z(get_current_rotation(), loc);
|
||||
screenCoord.x -= viewport->view_width / 2;
|
||||
screenCoord.y -= viewport->view_height / 2;
|
||||
return { screenCoord };
|
||||
|
||||
@@ -130,7 +130,7 @@ extern paint_entry* gNextFreePaintStruct;
|
||||
extern uint8_t gCurrentRotation;
|
||||
|
||||
void viewport_init_all();
|
||||
std::optional<ScreenCoordsXY> centre_2d_coordinates(CoordsXYZ loc, rct_viewport* viewport);
|
||||
std::optional<ScreenCoordsXY> centre_2d_coordinates(const CoordsXYZ& loc, rct_viewport* viewport);
|
||||
void viewport_create(
|
||||
rct_window* w, int32_t x, int32_t y, int32_t width, int32_t height, int32_t zoom, int32_t centre_x, int32_t centre_y,
|
||||
int32_t centre_z, char flags, uint16_t sprite);
|
||||
@@ -177,7 +177,7 @@ int32_t viewport_interaction_right_over(ScreenCoordsXY screenCoords);
|
||||
int32_t viewport_interaction_right_click(ScreenCoordsXY screenCoords);
|
||||
|
||||
CoordsXY sub_68A15E(ScreenCoordsXY screenCoords);
|
||||
void sub_68B2B7(paint_session* session, CoordsXY mapCoords);
|
||||
void sub_68B2B7(paint_session* session, const CoordsXY& mapCoords);
|
||||
|
||||
void viewport_invalidate(rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
|
||||
|
||||
@@ -856,9 +856,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
|
||||
imageFlags |= CONSTRUCTION_MARKER;
|
||||
}
|
||||
|
||||
int16_t x = session->MapPosition.x, y = session->MapPosition.y;
|
||||
|
||||
auto surface = map_get_surface_element_at(CoordsXY{ session->MapPosition.x, session->MapPosition.y });
|
||||
auto surface = map_get_surface_element_at(session->MapPosition);
|
||||
|
||||
if (surface == nullptr)
|
||||
{
|
||||
@@ -893,15 +891,12 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
|
||||
int32_t staffIndex = gStaffDrawPatrolAreas;
|
||||
uint8_t staffType = staffIndex & 0x7FFF;
|
||||
bool is_staff_list = staffIndex & 0x8000;
|
||||
x = session->MapPosition.x;
|
||||
y = session->MapPosition.y;
|
||||
|
||||
uint8_t patrolColour = COLOUR_LIGHT_BLUE;
|
||||
|
||||
if (!is_staff_list)
|
||||
{
|
||||
Staff* staff = (GET_PEEP(staffIndex))->AsStaff();
|
||||
if (!staff->IsPatrolAreaSet({ x, y }))
|
||||
if (!staff->IsPatrolAreaSet(session->MapPosition))
|
||||
{
|
||||
patrolColour = COLOUR_GREY;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void tile_element_paint_setup(paint_session* session, int32_t x, int32_t y)
|
||||
*
|
||||
* rct2: 0x0068B2B7
|
||||
*/
|
||||
void sub_68B2B7(paint_session* session, CoordsXY mapCoords)
|
||||
void sub_68B2B7(paint_session* session, const CoordsXY& mapCoords)
|
||||
{
|
||||
if (mapCoords.x < gMapSizeUnits && mapCoords.y < gMapSizeUnits && mapCoords.x >= 32 && mapCoords.y >= 32)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y)
|
||||
session->MapPosition.x = x;
|
||||
session->MapPosition.y = y;
|
||||
|
||||
TileElement* tile_element = map_get_first_element_at({ x, y });
|
||||
TileElement* tile_element = map_get_first_element_at(session->MapPosition);
|
||||
if (tile_element == nullptr)
|
||||
return;
|
||||
uint8_t rotation = session->CurrentRotation;
|
||||
|
||||
@@ -4636,9 +4636,7 @@ void Guest::UpdateRideApproachSpiralSlide()
|
||||
targetLoc.y = ride->stations[current_ride_station].Start.y * 32;
|
||||
|
||||
assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE);
|
||||
const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[var_37];
|
||||
|
||||
targetLoc += slidePlatformDestination;
|
||||
targetLoc += SpiralSlideWalkingPath[var_37];
|
||||
|
||||
destination_x = targetLoc.x;
|
||||
destination_y = targetLoc.y;
|
||||
@@ -4655,9 +4653,7 @@ void Guest::UpdateRideApproachSpiralSlide()
|
||||
targetLoc.y = ride->stations[current_ride_station].Start.y * 32;
|
||||
|
||||
assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE);
|
||||
const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[var_37];
|
||||
|
||||
targetLoc += slidePlatformDestination;
|
||||
targetLoc += SpiralSlideWalkingPath[var_37];
|
||||
|
||||
destination_x = targetLoc.x;
|
||||
destination_y = targetLoc.y;
|
||||
@@ -4750,9 +4746,7 @@ void Guest::UpdateRideOnSpiralSlide()
|
||||
targetLoc.y = ride->stations[current_ride_station].Start.y * 32;
|
||||
|
||||
assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE);
|
||||
const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[var_37];
|
||||
|
||||
targetLoc += slidePlatformDestination;
|
||||
targetLoc += SpiralSlideWalkingPath[var_37];
|
||||
|
||||
destination_x = targetLoc.x;
|
||||
destination_y = targetLoc.y;
|
||||
@@ -4795,9 +4789,7 @@ void Guest::UpdateRideLeaveSpiralSlide()
|
||||
targetLoc.y = ride->stations[current_ride_station].Start.y * 32;
|
||||
|
||||
assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE);
|
||||
const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[var_37];
|
||||
|
||||
targetLoc += slidePlatformDestination;
|
||||
targetLoc += SpiralSlideWalkingPath[var_37];
|
||||
|
||||
destination_x = targetLoc.x;
|
||||
destination_y = targetLoc.y;
|
||||
|
||||
@@ -832,7 +832,7 @@ public:
|
||||
void UpdateStaff(uint32_t stepsToTake);
|
||||
void Tick128UpdateStaff();
|
||||
bool IsMechanic() const;
|
||||
bool IsPatrolAreaSet(CoordsXY coords) const;
|
||||
bool IsPatrolAreaSet(const CoordsXY& coords) const;
|
||||
|
||||
private:
|
||||
void UpdatePatrolling();
|
||||
|
||||
@@ -395,7 +395,7 @@ static bool staff_is_patrol_area_set(int32_t staffIndex, int32_t x, int32_t y)
|
||||
return gStaffPatrolAreas[peepOffset + offset] & (((uint32_t)1) << bitIndex);
|
||||
}
|
||||
|
||||
bool Staff::IsPatrolAreaSet(CoordsXY coords) const
|
||||
bool Staff::IsPatrolAreaSet(const CoordsXY& coords) const
|
||||
{
|
||||
return staff_is_patrol_area_set(staff_id, coords.x, coords.y);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ enum
|
||||
// clang-format on
|
||||
|
||||
bool track_paint_util_has_fence(
|
||||
enum edge_t edge, CoordsXY position, const TileElement* tileElement, Ride* ride, uint8_t rotation)
|
||||
enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation)
|
||||
{
|
||||
TileCoordsXY offset;
|
||||
switch (edge)
|
||||
@@ -285,7 +285,7 @@ void track_paint_util_paint_fences(
|
||||
}
|
||||
|
||||
/* Supports are only placed every 2 tiles for flat pieces*/
|
||||
bool track_paint_util_should_paint_supports(CoordsXY position)
|
||||
bool track_paint_util_should_paint_supports(const CoordsXY& position)
|
||||
{
|
||||
if ((position.x & (1 << 5)) == (position.y & (1 << 5)))
|
||||
return true;
|
||||
|
||||
@@ -279,7 +279,7 @@ extern const uint8_t mapLeftEighthTurnToOrthogonal[5];
|
||||
extern const size_t mini_golf_peep_animation_lengths[];
|
||||
|
||||
bool track_paint_util_has_fence(
|
||||
enum edge_t edge, CoordsXY position, const TileElement* tileElement, Ride* ride, uint8_t rotation);
|
||||
enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation);
|
||||
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(
|
||||
@@ -303,7 +303,7 @@ void track_paint_util_draw_station_3(
|
||||
void track_paint_util_draw_station_inverted(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t direction, int32_t height, const TileElement* tileElement,
|
||||
uint8_t stationVariant);
|
||||
bool track_paint_util_should_paint_supports(CoordsXY position);
|
||||
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,
|
||||
int32_t height, const TileElement* tileElement, uint8_t rotation);
|
||||
|
||||
@@ -1921,8 +1921,7 @@ static void junior_rc_flat_to_left_bank_paint_setup(
|
||||
}
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -1970,8 +1969,7 @@ static void junior_rc_flat_to_right_bank_paint_setup(
|
||||
}
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -2195,8 +2193,7 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup(
|
||||
}
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -2256,8 +2253,7 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup(
|
||||
}
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -2334,8 +2330,7 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup(
|
||||
}
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -2396,8 +2391,7 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup(
|
||||
}
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -2486,8 +2480,7 @@ static void junior_rc_left_bank_paint_setup(
|
||||
paint_util_push_tunnel_left(session, height, 0);
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -3672,8 +3665,7 @@ static void junior_rc_brake_paint_setup(
|
||||
paint_util_push_tunnel_left(session, height, TUNNEL_0);
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -3709,8 +3701,7 @@ static void junior_rc_block_brake_paint_setup(
|
||||
paint_util_push_tunnel_left(session, height, TUNNEL_0);
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
int32_t edi = (direction & 1) ? 2 : 1;
|
||||
metal_a_supports_paint_setup(session, edi, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
@@ -4981,10 +4972,8 @@ void junior_rc_paint_track_60_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
|
||||
int8_t support[4] = { 35, 29, 25, 32 };
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, support[direction], height,
|
||||
@@ -5077,10 +5066,8 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
|
||||
int8_t support[4] = { 12, 12, 12, 14 };
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, support[direction], height,
|
||||
@@ -5157,9 +5144,7 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 20, height,
|
||||
@@ -5471,10 +5456,8 @@ static void junior_rc_flat_to_60_deg_up_paint_setup(
|
||||
break;
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
|
||||
int8_t support[4] = { 12, 12, 12, 14 };
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, support[direction], height - 7,
|
||||
@@ -5542,9 +5525,7 @@ static void junior_rc_60_deg_up_to_flat_paint_setup(
|
||||
break;
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 20, height - 5,
|
||||
@@ -5656,8 +5637,7 @@ static void junior_rc_booster_paint_setup(
|
||||
paint_util_push_tunnel_left(session, height, TUNNEL_0);
|
||||
}
|
||||
|
||||
const CoordsXY pos = session->MapPosition;
|
||||
if (track_paint_util_should_paint_supports(pos))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
uint8_t supportType = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK;
|
||||
metal_a_supports_paint_setup(session, supportType, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
|
||||
@@ -115,8 +115,6 @@ static void multi_dimension_rc_track_station(
|
||||
{ 15811, 15813, SPR_STATION_INVERTED_BAR_A_NW_SE },
|
||||
};
|
||||
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
if (tileElement->AsTrack()->GetTrackType() == TRACK_ELEM_END_STATION)
|
||||
{
|
||||
sub_98197C_rotated(
|
||||
@@ -138,23 +136,23 @@ static void multi_dimension_rc_track_station(
|
||||
bool hasFence;
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_NE, hasFence, stationObj, height);
|
||||
}
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_SE, hasFence, stationObj, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,8 +490,6 @@ static void paint_car_ride_track_60_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = car_ride_track_pieces_60_deg_up[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
switch (direction)
|
||||
@@ -526,7 +524,7 @@ static void paint_car_ride_track_60_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 32, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -541,8 +539,6 @@ static void paint_car_ride_track_25_deg_up_to_60_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = car_ride_track_pieces_25_deg_up_to_60_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -584,7 +580,7 @@ static void paint_car_ride_track_25_deg_up_to_60_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 12, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -599,8 +595,6 @@ static void paint_car_ride_track_60_deg_up_to_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = car_ride_track_pieces_60_deg_up_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -642,7 +636,7 @@ static void paint_car_ride_track_60_deg_up_to_25_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 20, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ static void paint_circus_show(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -69,8 +68,8 @@ static void paint_circus_show(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -69,7 +69,6 @@ static void paint_crooked_house(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -79,8 +78,8 @@ static void paint_crooked_house(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -43,7 +43,6 @@ static void paint_dodgems(
|
||||
uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_4x4[relativeTrackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -54,8 +53,8 @@ static void paint_dodgems(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, dodgems_fence_sprites,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height,
|
||||
dodgems_fence_sprites, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (direction)
|
||||
|
||||
@@ -155,8 +155,6 @@ static void paint_ferris_wheel(
|
||||
edges = edges_1x4_ne_sw[relativeTrackSequence];
|
||||
}
|
||||
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
@@ -167,23 +165,23 @@ static void paint_ferris_wheel(
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, rotation))
|
||||
if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, rotation))
|
||||
{
|
||||
imageId = SPR_FENCE_ROPE_NW | colourFlags;
|
||||
sub_98199C(session, imageId, 0, 0, 32, 1, 7, height, 0, 2, height + 2);
|
||||
}
|
||||
if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, rotation))
|
||||
if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, rotation))
|
||||
{
|
||||
imageId = SPR_FENCE_ROPE_NE | colourFlags;
|
||||
sub_98199C(session, imageId, 0, 0, 1, 32, 7, height, 2, 0, height + 2);
|
||||
}
|
||||
if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, rotation))
|
||||
if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, rotation))
|
||||
{
|
||||
// Bound box is slightly different from track_paint_util_paint_fences
|
||||
imageId = SPR_FENCE_ROPE_SE | colourFlags;
|
||||
sub_98197C(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3);
|
||||
}
|
||||
if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, rotation))
|
||||
if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, rotation))
|
||||
{
|
||||
imageId = SPR_FENCE_ROPE_SW | colourFlags;
|
||||
sub_98197C(session, imageId, 0, 0, 1, 32, 7, height, 30, 0, height + 2);
|
||||
|
||||
@@ -39,7 +39,6 @@ static void paint_flying_saucers(
|
||||
uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_4x4[relativeTrackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -50,7 +49,7 @@ static void paint_flying_saucers(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
flying_saucers_fence_sprites, session->CurrentRotation);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,8 +132,6 @@ static void paint_ghost_train_track_flat(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = ghost_train_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -154,7 +152,7 @@ static void paint_ghost_train_track_flat(
|
||||
paint_util_push_tunnel_right(session, height, TUNNEL_0);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -169,8 +167,6 @@ static void paint_ghost_train_track_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = ghost_train_track_pieces_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK];
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
@@ -191,7 +187,7 @@ static void paint_ghost_train_track_25_deg_up(
|
||||
sub_98197C(session, imageId, 0, 0, 1, 32, 23, height, 27, 0, height);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -222,8 +218,6 @@ static void paint_ghost_train_track_flat_to_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = ghost_train_track_pieces_flat_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK];
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
@@ -244,7 +238,7 @@ static void paint_ghost_train_track_flat_to_25_deg_up(
|
||||
sub_98197C(session, imageId, 0, 0, 1, 32, 15, height, 27, 0, height);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -274,8 +268,6 @@ static void paint_ghost_train_track_25_deg_up_to_flat_shared(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][0] | session->TrackColours[SCHEME_TRACK];
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
@@ -296,7 +288,7 @@ static void paint_ghost_train_track_25_deg_up_to_flat_shared(
|
||||
sub_98197C(session, imageId, 0, 0, 1, 32, 15, height, 27, 0, height);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -533,8 +525,6 @@ static void paint_ghost_train_track_brakes(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = ghost_train_track_pieces_brakes[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -555,7 +545,7 @@ static void paint_ghost_train_track_brakes(
|
||||
paint_util_push_tunnel_right(session, height, TUNNEL_0);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@ static void paint_haunted_house(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -110,8 +109,8 @@ static void paint_haunted_house(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -110,7 +110,6 @@ static void paint_merry_go_round(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -120,8 +119,8 @@ static void paint_merry_go_round(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -677,7 +677,6 @@ static void paint_mini_golf_station(
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
CoordsXY position = session->MapPosition;
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
uint32_t imageId;
|
||||
bool hasFence;
|
||||
@@ -687,14 +686,15 @@ static void paint_mini_golf_station(
|
||||
|
||||
if (direction & 1)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (hasFence)
|
||||
{
|
||||
imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE | session->TrackColours[SCHEME_MISC];
|
||||
sub_98197C(session, imageId, -10, 0, 1, 32, 7, height, 0, 0, height + 2);
|
||||
}
|
||||
|
||||
bool hasSWFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation);
|
||||
bool hasSWFence = track_paint_util_has_fence(
|
||||
EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (hasFence)
|
||||
{
|
||||
imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_NW_SE | session->TrackColours[SCHEME_MISC];
|
||||
@@ -709,14 +709,15 @@ static void paint_mini_golf_station(
|
||||
}
|
||||
else
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (hasFence)
|
||||
{
|
||||
imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE | session->TrackColours[SCHEME_MISC];
|
||||
sub_98197C(session, imageId, 0, -10, 32, 1, 7, height, 0, 0, height + 2);
|
||||
}
|
||||
|
||||
bool hasSEFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation);
|
||||
bool hasSEFence = track_paint_util_has_fence(
|
||||
EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (hasFence)
|
||||
{
|
||||
imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_SW_NE | session->TrackColours[SCHEME_MISC];
|
||||
|
||||
@@ -59,7 +59,6 @@ static void paint_mini_helicopters_track_flat(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
uint32_t imageId;
|
||||
|
||||
if (direction & 1)
|
||||
@@ -75,7 +74,7 @@ static void paint_mini_helicopters_track_flat(
|
||||
paint_util_push_tunnel_left(session, height, TUNNEL_0);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, height,
|
||||
@@ -92,7 +91,6 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
uint32_t imageId;
|
||||
|
||||
switch (direction)
|
||||
@@ -119,7 +117,7 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -4, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -134,7 +132,6 @@ static void paint_mini_helicopters_track_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
uint32_t imageId;
|
||||
|
||||
switch (direction)
|
||||
@@ -161,7 +158,7 @@ static void paint_mini_helicopters_track_25_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -9, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -176,7 +173,6 @@ static void paint_mini_helicopters_track_25_deg_up_to_flat(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
uint32_t imageId;
|
||||
|
||||
switch (direction)
|
||||
@@ -203,7 +199,7 @@ static void paint_mini_helicopters_track_25_deg_up_to_flat(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -7, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
|
||||
@@ -198,7 +198,6 @@ static void paint_spiral_slide(
|
||||
trackSequence = track_map_2x2[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_2x2[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -210,7 +209,7 @@ static void paint_spiral_slide(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
spiral_slide_fence_sprites, session->CurrentRotation);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ static void paint_3d_cinema(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -69,8 +68,8 @@ static void paint_3d_cinema(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -88,14 +88,13 @@ static void paint_enterprise(
|
||||
trackSequence = track_map_4x4[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_4x4[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesRope,
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -351,7 +351,6 @@ static void paint_go_karts_station(
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
CoordsXY position = session->MapPosition;
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
|
||||
bool hasFence;
|
||||
@@ -375,12 +374,12 @@ static void paint_go_karts_station(
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_NE, hasFence, stationObj, height);
|
||||
}
|
||||
|
||||
@@ -400,12 +399,12 @@ static void paint_go_karts_station(
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_SE, hasFence, stationObj, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, height);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,6 @@ static void paint_launched_freefall_base(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -104,7 +103,7 @@ static void paint_launched_freefall_base(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
launched_freefall_fence_sprites, session->CurrentRotation);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ static void paint_motionsimulator(
|
||||
trackSequence = track_map_2x2[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_2x2[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork);
|
||||
@@ -146,8 +145,8 @@ static void paint_motionsimulator(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -175,7 +175,6 @@ static void paint_pirate_ship(
|
||||
return;
|
||||
|
||||
uint8_t relativeTrackSequence = track_map_1x5[direction][trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId;
|
||||
bool hasFence;
|
||||
@@ -207,7 +206,7 @@ static void paint_pirate_ship(
|
||||
{
|
||||
if (relativeTrackSequence != 1 && relativeTrackSequence != 4)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (relativeTrackSequence == 2)
|
||||
{
|
||||
imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE)
|
||||
@@ -224,7 +223,7 @@ static void paint_pirate_ship(
|
||||
| session->TrackColours[SCHEME_TRACK];
|
||||
sub_98196C(session, imageId, 24, 0, 8, 32, 1, height + 9);
|
||||
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (relativeTrackSequence == 3)
|
||||
{
|
||||
if (hasFence)
|
||||
@@ -252,7 +251,7 @@ static void paint_pirate_ship(
|
||||
{
|
||||
if (relativeTrackSequence != 1 && relativeTrackSequence != 4)
|
||||
{
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (relativeTrackSequence == 2)
|
||||
{
|
||||
imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE)
|
||||
@@ -269,7 +268,7 @@ static void paint_pirate_ship(
|
||||
| session->TrackColours[SCHEME_TRACK];
|
||||
sub_98196C(session, imageId, 0, 24, 32, 8, 1, height + 9);
|
||||
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation);
|
||||
if (relativeTrackSequence == 3)
|
||||
{
|
||||
if (hasFence)
|
||||
|
||||
@@ -102,7 +102,6 @@ static void paint_roto_drop_base(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -113,8 +112,8 @@ static void paint_roto_drop_base(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
fenceSpritesMetalB, session->CurrentRotation);
|
||||
}
|
||||
|
||||
if (trackSequence == 0)
|
||||
|
||||
@@ -252,7 +252,6 @@ static void paint_top_spin(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr);
|
||||
|
||||
@@ -262,8 +261,8 @@ static void paint_top_spin(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
}
|
||||
|
||||
switch (trackSequence)
|
||||
|
||||
@@ -88,7 +88,6 @@ static void paint_twist(
|
||||
trackSequence = track_map_3x3[direction][trackSequence];
|
||||
|
||||
const uint8_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId;
|
||||
|
||||
@@ -99,12 +98,12 @@ static void paint_twist(
|
||||
switch (trackSequence)
|
||||
{
|
||||
case 7:
|
||||
if (track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation))
|
||||
if (track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation))
|
||||
{
|
||||
imageId = SPR_FENCE_ROPE_SW | session->TrackColours[SCHEME_MISC];
|
||||
sub_98197C(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 3);
|
||||
}
|
||||
if (track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation))
|
||||
if (track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation))
|
||||
{
|
||||
imageId = SPR_FENCE_ROPE_SE | session->TrackColours[SCHEME_MISC];
|
||||
sub_98197C(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3);
|
||||
@@ -112,8 +111,8 @@ static void paint_twist(
|
||||
break;
|
||||
default:
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height,
|
||||
fenceSpritesRope, session->CurrentRotation);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ static void paint_lift_base(
|
||||
}
|
||||
|
||||
int32_t edges = edges_3x3[trackSequence];
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS];
|
||||
sub_98197C(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height);
|
||||
@@ -82,8 +81,8 @@ static void paint_lift_base(
|
||||
if (ride != nullptr)
|
||||
{
|
||||
track_paint_util_paint_fences(
|
||||
session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB,
|
||||
session->CurrentRotation);
|
||||
session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height,
|
||||
fenceSpritesMetalB, session->CurrentRotation);
|
||||
}
|
||||
|
||||
int32_t blockedSegments = 0;
|
||||
|
||||
@@ -422,8 +422,6 @@ static void paint_monorail_track_flat(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -444,7 +442,7 @@ static void paint_monorail_track_flat(
|
||||
paint_util_push_tunnel_right(session, height, TUNNEL_6);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -513,8 +511,6 @@ static void paint_monorail_track_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = monorail_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -542,7 +538,7 @@ static void paint_monorail_track_25_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -557,8 +553,6 @@ static void paint_monorail_track_flat_to_25_deg_up(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = monorail_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -586,7 +580,7 @@ static void paint_monorail_track_flat_to_25_deg_up(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
@@ -601,8 +595,6 @@ static void paint_monorail_track_25_deg_up_to_flat(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
|
||||
uint32_t imageId = monorail_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK];
|
||||
|
||||
if (direction == 0 || direction == 2)
|
||||
@@ -630,7 +622,7 @@ static void paint_monorail_track_25_deg_up_to_flat(
|
||||
break;
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
|
||||
@@ -67,20 +67,19 @@ static void paint_boat_hire_station(
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
CoordsXY position = session->MapPosition;
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
|
||||
if (direction & 1)
|
||||
{
|
||||
paint_util_push_tunnel_right(session, height, TUNNEL_6);
|
||||
track_paint_util_draw_pier(
|
||||
session, ride, stationObj, position, direction, height, tileElement, session->CurrentRotation);
|
||||
session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
paint_util_push_tunnel_left(session, height, TUNNEL_6);
|
||||
track_paint_util_draw_pier(
|
||||
session, ride, stationObj, position, direction, height, tileElement, session->CurrentRotation);
|
||||
session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation);
|
||||
}
|
||||
|
||||
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
||||
|
||||
@@ -86,7 +86,6 @@ static void submarine_ride_paint_track_station(
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
CoordsXY position = session->MapPosition;
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
int32_t heightLower = height - 16;
|
||||
uint32_t imageId;
|
||||
@@ -98,7 +97,7 @@ static void submarine_ride_paint_track_station(
|
||||
|
||||
paint_util_push_tunnel_right(session, height, TUNNEL_6);
|
||||
track_paint_util_draw_pier(
|
||||
session, ride, stationObj, position, direction, height, tileElement, session->CurrentRotation);
|
||||
session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,7 +106,7 @@ static void submarine_ride_paint_track_station(
|
||||
|
||||
paint_util_push_tunnel_left(session, height, TUNNEL_6);
|
||||
track_paint_util_draw_pier(
|
||||
session, ride, stationObj, position, direction, height, tileElement, session->CurrentRotation);
|
||||
session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation);
|
||||
}
|
||||
|
||||
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
||||
@@ -118,7 +117,6 @@ static void submarine_ride_paint_track_flat(
|
||||
paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TileElement* tileElement)
|
||||
{
|
||||
CoordsXY position = session->MapPosition;
|
||||
int32_t heightLower = height - 16;
|
||||
uint32_t imageId;
|
||||
|
||||
@@ -135,7 +133,7 @@ static void submarine_ride_paint_track_flat(
|
||||
paint_util_push_tunnel_left(session, heightLower, TUNNEL_0);
|
||||
}
|
||||
|
||||
if (track_paint_util_should_paint_supports(position))
|
||||
if (track_paint_util_should_paint_supports(session->MapPosition))
|
||||
{
|
||||
metal_a_supports_paint_setup(
|
||||
session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, heightLower,
|
||||
|
||||
@@ -2244,7 +2244,7 @@ void PathElement::SetEdgesAndCorners(uint8_t newEdgesAndCorners)
|
||||
edges = newEdgesAndCorners;
|
||||
}
|
||||
|
||||
bool PathElement::IsLevelCrossing(CoordsXY coords) const
|
||||
bool PathElement::IsLevelCrossing(const CoordsXY& coords) const
|
||||
{
|
||||
auto trackElement = map_get_track_element_at({ coords, GetBaseZ() });
|
||||
if (trackElement == nullptr)
|
||||
|
||||
@@ -94,14 +94,14 @@ struct CoordsXY
|
||||
{
|
||||
}
|
||||
|
||||
CoordsXY& operator+=(const CoordsXY rhs)
|
||||
CoordsXY& operator+=(const CoordsXY& rhs)
|
||||
{
|
||||
x += rhs.x;
|
||||
y += rhs.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CoordsXY& operator-=(const CoordsXY rhs)
|
||||
CoordsXY& operator-=(const CoordsXY& rhs)
|
||||
{
|
||||
x -= rhs.x;
|
||||
y -= rhs.y;
|
||||
@@ -189,7 +189,7 @@ struct CoordsXYRangedZ : public CoordsXY
|
||||
{
|
||||
}
|
||||
|
||||
constexpr CoordsXYRangedZ(CoordsXY _c, int32_t _baseZ, int32_t _clearanceZ)
|
||||
constexpr CoordsXYRangedZ(const CoordsXY& _c, int32_t _baseZ, int32_t _clearanceZ)
|
||||
: CoordsXY(_c)
|
||||
, baseZ(_baseZ)
|
||||
, clearanceZ(_clearanceZ)
|
||||
@@ -209,7 +209,7 @@ struct TileCoordsXY
|
||||
{
|
||||
}
|
||||
|
||||
explicit TileCoordsXY(CoordsXY c)
|
||||
explicit TileCoordsXY(const CoordsXY& c)
|
||||
: x(c.x / 32)
|
||||
, y(c.y / 32)
|
||||
{
|
||||
@@ -220,14 +220,14 @@ struct TileCoordsXY
|
||||
return { x + rhs.x, y + rhs.y };
|
||||
}
|
||||
|
||||
TileCoordsXY& operator+=(const TileCoordsXY rhs)
|
||||
TileCoordsXY& operator+=(const TileCoordsXY& rhs)
|
||||
{
|
||||
x += rhs.x;
|
||||
y += rhs.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TileCoordsXY& operator-=(const TileCoordsXY rhs)
|
||||
TileCoordsXY& operator-=(const TileCoordsXY& rhs)
|
||||
{
|
||||
x -= rhs.x;
|
||||
y -= rhs.y;
|
||||
@@ -298,7 +298,7 @@ struct CoordsXYZ : public CoordsXY
|
||||
{
|
||||
}
|
||||
|
||||
constexpr CoordsXYZ(CoordsXY c, int32_t _z)
|
||||
constexpr CoordsXYZ(const CoordsXY& c, int32_t _z)
|
||||
: CoordsXY(c)
|
||||
, z(_z)
|
||||
{
|
||||
@@ -341,32 +341,32 @@ struct TileCoordsXYZ : public TileCoordsXY
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZ(TileCoordsXY c, int32_t z_)
|
||||
TileCoordsXYZ(const TileCoordsXY& c, int32_t z_)
|
||||
: TileCoordsXY(c.x, c.y)
|
||||
, z(z_)
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZ(CoordsXY c, int32_t z_)
|
||||
TileCoordsXYZ(const CoordsXY& c, int32_t z_)
|
||||
: TileCoordsXY(c)
|
||||
, z(z_)
|
||||
{
|
||||
}
|
||||
|
||||
explicit TileCoordsXYZ(CoordsXYZ c)
|
||||
explicit TileCoordsXYZ(const CoordsXYZ& c)
|
||||
: TileCoordsXY(c)
|
||||
, z(c.z / 8)
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZ& operator+=(const TileCoordsXY rhs)
|
||||
TileCoordsXYZ& operator+=(const TileCoordsXY& rhs)
|
||||
{
|
||||
x += rhs.x;
|
||||
y += rhs.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TileCoordsXYZ& operator-=(const TileCoordsXY rhs)
|
||||
TileCoordsXYZ& operator-=(const TileCoordsXY& rhs)
|
||||
{
|
||||
x -= rhs.x;
|
||||
y -= rhs.y;
|
||||
@@ -451,13 +451,13 @@ struct CoordsXYZD : public CoordsXYZ
|
||||
{
|
||||
}
|
||||
|
||||
constexpr CoordsXYZD(CoordsXY _c, int32_t _z, Direction _d)
|
||||
constexpr CoordsXYZD(const CoordsXY& _c, int32_t _z, Direction _d)
|
||||
: CoordsXYZ(_c, _z)
|
||||
, direction(_d)
|
||||
{
|
||||
}
|
||||
|
||||
constexpr CoordsXYZD(CoordsXYZ _c, Direction _d)
|
||||
constexpr CoordsXYZD(const CoordsXYZ& _c, Direction _d)
|
||||
: CoordsXYZ(_c)
|
||||
, direction(_d)
|
||||
{
|
||||
@@ -485,25 +485,25 @@ struct TileCoordsXYZD : public TileCoordsXYZ
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZD(TileCoordsXY t_, int32_t z_, Direction d_)
|
||||
TileCoordsXYZD(const TileCoordsXY& t_, int32_t z_, Direction d_)
|
||||
: TileCoordsXYZ(t_, z_)
|
||||
, direction(d_)
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZD(CoordsXY c_, int32_t z_, Direction d_)
|
||||
TileCoordsXYZD(const CoordsXY& c_, int32_t z_, Direction d_)
|
||||
: TileCoordsXYZ(c_, z_)
|
||||
, direction(d_)
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZD(CoordsXYZ c_, Direction d_)
|
||||
TileCoordsXYZD(const CoordsXYZ& c_, Direction d_)
|
||||
: TileCoordsXYZ(c_)
|
||||
, direction(d_)
|
||||
{
|
||||
}
|
||||
|
||||
TileCoordsXYZD(CoordsXYZD c_)
|
||||
TileCoordsXYZD(const CoordsXYZD& c_)
|
||||
: TileCoordsXYZ(c_)
|
||||
, direction(c_.direction)
|
||||
{
|
||||
|
||||
@@ -1881,7 +1881,7 @@ EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SmallSceneryElement* map_get_small_scenery_element_at(CoordsXYZ sceneryCoords, int32_t type, uint8_t quadrant)
|
||||
SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant)
|
||||
{
|
||||
auto sceneryTileCoords = TileCoordsXYZ{ sceneryCoords };
|
||||
TileElement* tileElement = map_get_first_element_at(sceneryCoords);
|
||||
@@ -2092,7 +2092,7 @@ int32_t map_get_tile_quadrant(const CoordsXY& mapPos)
|
||||
*
|
||||
* rct2: 0x00693BFF
|
||||
*/
|
||||
bool map_surface_is_blocked(CoordsXY mapCoords)
|
||||
bool map_surface_is_blocked(const CoordsXY& mapCoords)
|
||||
{
|
||||
if (!map_is_location_valid(mapCoords))
|
||||
return true;
|
||||
@@ -2230,7 +2230,7 @@ TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, int
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TrackElement* map_get_track_element_at_of_type(CoordsXYZD location, int32_t trackType)
|
||||
TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, int32_t trackType)
|
||||
{
|
||||
auto tileElement = map_get_first_element_at(location);
|
||||
if (tileElement != nullptr)
|
||||
@@ -2253,7 +2253,7 @@ TrackElement* map_get_track_element_at_of_type(CoordsXYZD location, int32_t trac
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TrackElement* map_get_track_element_at_of_type_seq(CoordsXYZD location, int32_t trackType, int32_t sequence)
|
||||
TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, int32_t trackType, int32_t sequence)
|
||||
{
|
||||
auto tileElement = map_get_first_element_at(location);
|
||||
if (tileElement != nullptr)
|
||||
@@ -2364,7 +2364,7 @@ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD&
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
WallElement* map_get_wall_element_at(CoordsXYZD wallCoords)
|
||||
WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords)
|
||||
{
|
||||
auto tileWallCoords = TileCoordsXYZ(wallCoords);
|
||||
TileElement* tileElement = map_get_first_element_at(wallCoords);
|
||||
|
||||
@@ -157,8 +157,8 @@ int32_t map_height_from_slope(const CoordsXY& coords, int32_t slope, bool isSlop
|
||||
BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t direction);
|
||||
SurfaceElement* map_get_surface_element_at(const CoordsXY& coords);
|
||||
PathElement* map_get_path_element_at(const TileCoordsXYZ& loc);
|
||||
WallElement* map_get_wall_element_at(CoordsXYZD wallCoords);
|
||||
SmallSceneryElement* map_get_small_scenery_element_at(CoordsXYZ sceneryCoords, int32_t type, uint8_t quadrant);
|
||||
WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords);
|
||||
SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant);
|
||||
EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost);
|
||||
EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost);
|
||||
EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool ghost);
|
||||
@@ -176,7 +176,7 @@ bool map_can_build_at(const CoordsXYZ& loc);
|
||||
bool map_is_location_owned(const CoordsXYZ& loc);
|
||||
bool map_is_location_in_park(const CoordsXY& coords);
|
||||
bool map_is_location_owned_or_has_rights(const CoordsXY& loc);
|
||||
bool map_surface_is_blocked(CoordsXY mapCoords);
|
||||
bool map_surface_is_blocked(const CoordsXY& mapCoords);
|
||||
void tile_element_remove(TileElement* tileElement);
|
||||
void map_remove_all_rides();
|
||||
void map_invalidate_map_selection_tiles();
|
||||
@@ -244,8 +244,8 @@ ScreenCoordsXY translate_3d_to_2d_with_z(int32_t rotation, const CoordsXYZ& pos)
|
||||
TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos);
|
||||
TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, int32_t trackType);
|
||||
TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, int32_t trackType, int32_t sequence);
|
||||
TrackElement* map_get_track_element_at_of_type(CoordsXYZD location, int32_t trackType);
|
||||
TrackElement* map_get_track_element_at_of_type_seq(CoordsXYZD location, int32_t trackType, int32_t sequence);
|
||||
TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, int32_t trackType);
|
||||
TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, int32_t trackType, int32_t sequence);
|
||||
TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, int32_t trackType, ride_id_t rideIndex);
|
||||
TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_id_t rideIndex);
|
||||
TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, ride_id_t rideIndex);
|
||||
|
||||
@@ -102,7 +102,7 @@ void park_set_open(bool open)
|
||||
*
|
||||
* rct2: 0x00664D05
|
||||
*/
|
||||
void update_park_fences(const CoordsXY coords)
|
||||
void update_park_fences(const CoordsXY& coords)
|
||||
{
|
||||
if (map_is_edge(coords))
|
||||
return;
|
||||
@@ -173,7 +173,7 @@ void update_park_fences(const CoordsXY coords)
|
||||
}
|
||||
}
|
||||
|
||||
void update_park_fences_around_tile(const CoordsXY coords)
|
||||
void update_park_fences_around_tile(const CoordsXY& coords)
|
||||
{
|
||||
update_park_fences(coords);
|
||||
update_park_fences({ coords.x + 32, coords.y });
|
||||
|
||||
@@ -114,8 +114,8 @@ int32_t get_forced_park_rating();
|
||||
int32_t park_is_open();
|
||||
int32_t park_calculate_size();
|
||||
|
||||
void update_park_fences(CoordsXY coords);
|
||||
void update_park_fences_around_tile(CoordsXY coords);
|
||||
void update_park_fences(const CoordsXY& coords);
|
||||
void update_park_fences_around_tile(const CoordsXY& coords);
|
||||
|
||||
uint8_t calculate_guest_initial_happiness(uint8_t percentage);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void SurfaceElement::SetGrassLength(uint8_t newLength)
|
||||
GrassLength = newLength;
|
||||
}
|
||||
|
||||
void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, CoordsXY coords)
|
||||
void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, const CoordsXY& coords)
|
||||
{
|
||||
uint8_t oldLength = GrassLength & 0x7;
|
||||
uint8_t newLength = length & 0x7;
|
||||
@@ -100,7 +100,7 @@ void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, CoordsXY coords
|
||||
*
|
||||
* rct2: 0x006647A1
|
||||
*/
|
||||
void SurfaceElement::UpdateGrassLength(CoordsXY coords)
|
||||
void SurfaceElement::UpdateGrassLength(const CoordsXY& coords)
|
||||
{
|
||||
// Check if tile is grass
|
||||
if (!CanGrassGrow())
|
||||
|
||||
@@ -162,8 +162,8 @@ public:
|
||||
bool CanGrassGrow() const;
|
||||
uint8_t GetGrassLength() const;
|
||||
void SetGrassLength(uint8_t newLength);
|
||||
void SetGrassLengthAndInvalidate(uint8_t newLength, CoordsXY coords);
|
||||
void UpdateGrassLength(CoordsXY coords);
|
||||
void SetGrassLengthAndInvalidate(uint8_t newLength, const CoordsXY& coords);
|
||||
void UpdateGrassLength(const CoordsXY& coords);
|
||||
|
||||
uint8_t GetOwnership() const;
|
||||
void SetOwnership(uint8_t newOwnership);
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
bool ShouldDrawPathOverSupports();
|
||||
void SetShouldDrawPathOverSupports(bool on);
|
||||
|
||||
bool IsLevelCrossing(CoordsXY coords) const;
|
||||
bool IsLevelCrossing(const CoordsXY& coords) const;
|
||||
};
|
||||
assert_struct_size(PathElement, 16);
|
||||
|
||||
|
||||
Reference in new issue
Block a user