diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b98265637d..4e56102aa8 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1731,7 +1731,7 @@ static void window_ride_construction_construct(rct_window *w) y -= TileDirectionDelta[trackDirection].y; } - BigCoordsXYE next_track; + CoordsXYE next_track; if (track_block_get_next_from_zero(x, y, z, _currentRideIndex, trackDirection, &next_track, &z, &trackDirection)) { _currentTrackBeginX = next_track.x; _currentTrackBeginY = next_track.y; @@ -1764,7 +1764,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) { sint32 x, y, z, direction, type; rct_tile_element *tileElement; - BigCoordsXYE inputElement, outputElement; + CoordsXYE inputElement, outputElement; track_begin_end trackBeginEnd; //bool gotoStartPlacementMode; diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index e8b45afda9..e92428845f 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -439,7 +439,7 @@ static void cheat_own_all_land() const sint32 min = 32; const sint32 max = gMapSizeUnits - 32; - for (BigCoordsXY coords = {min, min}; coords.y <= max; coords.y += 32) { + for (CoordsXY coords = {min, min}; coords.y <= max; coords.y += 32) { for (; coords.x <= max; coords.x += 32) { rct_tile_element * surfaceElement = map_get_surface_element_at(coords); diff --git a/src/openrct2/actions/PlaceParkEntranceAction.hpp b/src/openrct2/actions/PlaceParkEntranceAction.hpp index e88f0f17fa..6e93b2f20b 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.hpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.hpp @@ -158,7 +158,7 @@ public: sint8 zLow = _z * 2; sint8 zHigh = zLow + 12; - BigCoordsXY entranceLoc = { _x, _y }; + CoordsXY entranceLoc = { _x, _y }; for (uint8 index = 0; index < 3; index++) { if (index == 1) diff --git a/src/openrct2/interface/ViewportInteraction.cpp b/src/openrct2/interface/ViewportInteraction.cpp index 010c2290e6..8a1a67d857 100644 --- a/src/openrct2/interface/ViewportInteraction.cpp +++ b/src/openrct2/interface/ViewportInteraction.cpp @@ -370,7 +370,7 @@ sint32 viewport_interaction_right_over(sint32 x, sint32 y) */ sint32 viewport_interaction_right_click(sint32 x, sint32 y) { - BigCoordsXYE tileElement; + CoordsXYE tileElement; viewport_interaction_info info; switch (viewport_interaction_get_item_right(x, y, &info)) { diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index f5c9ab2933..1f3d581a36 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -22,7 +22,7 @@ #include "tile_element/TileElement.h" #include "VirtualFloor.h" -static constexpr const BigCoordsXY offsets[4] = +static constexpr const CoordsXY offsets[4] = { { -32, 0 }, { 0, 32 }, diff --git a/src/openrct2/paint/tile_element/Surface.cpp b/src/openrct2/paint/tile_element/Surface.cpp index cf446860fc..1747fec902 100644 --- a/src/openrct2/paint/tile_element/Surface.cpp +++ b/src/openrct2/paint/tile_element/Surface.cpp @@ -957,7 +957,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, cons for (sint32 i = 0; i < 4; i++) { const LocationXY16& offset = viewport_surface_paint_data[i][rotation]; - const BigCoordsXY position = + const CoordsXY position = { (sint32)(base.x + offset.x), (sint32)(base.y + offset.y) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 48484e6c5b..3f893f85d6 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -86,7 +86,7 @@ static uint8 _peepPathFindFewestNumSteps; * be declared properly. */ static struct { - SmallCoordsXYZ location; + TileCoordsXYZ location; uint8 direction; } _peepPathFindHistory[16]; @@ -455,7 +455,7 @@ static constexpr const ride_rating NauseaMaximumThresholds[] = { // Locations of the spiral slide platform that a peep walks from the entrance of the ride to the // entrance of the slide. Up to 4 locations for each 4 sides that an ride entrance can be located // and 4 different rotations of the ride. 4 * 4 * 4 = 64 locations. -static constexpr const BigCoordsXY SpiralSlideWalkingPath[64] = { +static constexpr const CoordsXY SpiralSlideWalkingPath[64] = { { 56, 8 }, { 8, 8 }, { 8, 32 }, @@ -2962,7 +2962,7 @@ static void peep_update_ride_sub_state_1(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const BigCoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -3962,7 +3962,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) x *= 32; y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const BigCoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -3982,7 +3982,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const BigCoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -3992,7 +3992,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) } /** rct2: 0x00981F0C, 0x00981F0E */ -static constexpr const BigCoordsXY _981F0C[] = { +static constexpr const CoordsXY _981F0C[] = { { 25, 56 }, { 56, 7 }, { 7, -24 }, @@ -4000,7 +4000,7 @@ static constexpr const BigCoordsXY _981F0C[] = { }; /** rct2: 0x00981F1C, 0x00981F1E */ -static constexpr const BigCoordsXY _981F1C[] = { +static constexpr const CoordsXY _981F1C[] = { { 8, 56 }, { 56, 24 }, { 24, -24 }, @@ -4090,7 +4090,7 @@ static void peep_update_ride_sub_state_15(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const BigCoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -4134,7 +4134,7 @@ static void peep_update_ride_sub_state_16(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const BigCoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const CoordsXY slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -4877,7 +4877,7 @@ static bool peep_update_fixing_sub_state_6(bool firstRun, rct_peep * peep, Ride } /** rct2: 0x00992A3C */ -static constexpr const BigCoordsXY _992A3C[] = { +static constexpr const CoordsXY _992A3C[] = { { -12, 0 }, { 0, 12 }, { 12, 0 }, @@ -4916,7 +4916,7 @@ static bool peep_update_fixing_sub_state_7(bool firstRun, rct_peep * peep, Ride } sint32 direction = tile_element_get_direction(tileElement); - BigCoordsXY offset = _992A3C[direction]; + CoordsXY offset = _992A3C[direction]; stationX += 16 + offset.x; if (offset.x == 0) @@ -4997,7 +4997,7 @@ static bool peep_update_fixing_sub_state_9(bool firstRun, rct_peep * peep, Ride uint8 stationZ = ride->station_heights[peep->current_ride_station]; - BigCoordsXYE input; + CoordsXYE input; input.x = stationPosition.x * 32; input.y = stationPosition.y * 32; input.element = map_get_track_element_at_from_ride(input.x, input.y, stationZ, peep->current_ride); @@ -5027,7 +5027,7 @@ static bool peep_update_fixing_sub_state_9(bool firstRun, rct_peep * peep, Ride uint16 destinationX = input.x + 16; uint16 destinationY = input.y + 16; - BigCoordsXY offset = _992A3C[direction]; + CoordsXY offset = _992A3C[direction]; destinationX -= offset.x; if (offset.x == 0) @@ -9965,8 +9965,8 @@ static bool path_is_thin_junction(rct_tile_element * path, sint16 x, sint16 y, u */ static void peep_pathfind_heuristic_search(sint16 x, sint16 y, uint8 z, rct_peep * peep, rct_tile_element * currentTileElement, bool inPatrolArea, uint8 counter, uint16 * endScore, sint32 test_edge, - uint8 * endJunctions, SmallCoordsXYZ junctionList[16], uint8 directionList[16], - SmallCoordsXYZ * endXYZ, uint8 * endSteps) + uint8 * endJunctions, TileCoordsXYZ junctionList[16], uint8 directionList[16], + TileCoordsXYZ * endXYZ, uint8 * endSteps) { uint8 searchResult = PATH_SEARCH_FAILED; @@ -10558,7 +10558,7 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe // Used to allow walking through no entry banners _peepPathFindIsStaff = (peep->type == PEEP_TYPE_STAFF); - SmallCoordsXYZ goal = { (uint8)(gPeepPathFindGoalPosition.x >> 5), + TileCoordsXYZ goal = { (uint8)(gPeepPathFindGoalPosition.x >> 5), (uint8)(gPeepPathFindGoalPosition.y >> 5), (uint8)(gPeepPathFindGoalPosition.z) }; @@ -10722,9 +10722,9 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 uint8 bestJunctions = 0; - SmallCoordsXYZ bestJunctionList[16] = { 0 }; + TileCoordsXYZ bestJunctionList[16] = { 0 }; uint8 bestDirectionList[16] = { 0 }; - SmallCoordsXYZ bestXYZ = { 0, 0, 0 }; + TileCoordsXYZ bestXYZ = { 0, 0, 0 }; if (gPathFindDebug) { @@ -10769,7 +10769,7 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe uint16 score = 0xFFFF; /* Variable endXYZ contains the end location of the * search path. */ - SmallCoordsXYZ endXYZ; + TileCoordsXYZ endXYZ; endXYZ.x = 0; endXYZ.y = 0; endXYZ.z = 0; @@ -10784,7 +10784,7 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe * In the future these could be used to visualise the * pathfinding on the map. */ uint8 endJunctions = 0; - SmallCoordsXYZ endJunctionList[16] = { 0 }; + TileCoordsXYZ endJunctionList[16] = { 0 }; uint8 endDirectionList[16] = { 0 }; bool inPatrolArea = false; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 10eb64c9f3..6d9f43a4fc 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -943,7 +943,7 @@ static uint8 staff_handyman_direction_to_nearest_litter(rct_peep * peep) nextDirection = x_diff < 0 ? 0 : 2; } - BigCoordsXY nextTile = { static_cast((nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x), + CoordsXY nextTile = { static_cast((nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x), static_cast((nearestLitter->y & 0xFFE0) - TileDirectionDelta[nextDirection].y) }; sint16 nextZ = ((peep->z + 8) & 0xFFF0) / 8; @@ -1014,7 +1014,7 @@ static uint8 staff_handyman_direction_to_uncut_grass(rct_peep * peep, uint8 vali continue; } - BigCoordsXY chosenTile = { static_cast(peep->next_x + TileDirectionDelta[chosenDirection].x), + CoordsXY chosenTile = { static_cast(peep->next_x + TileDirectionDelta[chosenDirection].x), static_cast(peep->next_y + TileDirectionDelta[chosenDirection].y) }; if (chosenTile.x > 0x1FFF || chosenTile.y > 0x1FFF) diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 70e86e5952..81b977e942 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -260,8 +260,8 @@ static bool sub_6DF01A_loop(rct_vehicle * vehicle) 0 ); - BigCoordsXYE input; - BigCoordsXYE output; + CoordsXYE input; + CoordsXYE output; sint32 outputZ; sint32 outputDirection; @@ -344,7 +344,7 @@ static bool sub_6DF21B_loop(rct_vehicle * vehicle) 0 ); - BigCoordsXYE input; + CoordsXYE input; input.x = vehicle->track_x; input.y = vehicle->track_y; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index c33840076d..57aa6687c6 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -488,7 +488,7 @@ static money32 ride_calculate_income_per_hour(Ride *ride) * dl ride index * esi result map element */ -bool ride_try_get_origin_element(sint32 rideIndex, BigCoordsXYE *output) +bool ride_try_get_origin_element(sint32 rideIndex, CoordsXYE *output) { rct_tile_element *resultTileElement = nullptr; @@ -536,7 +536,7 @@ bool ride_try_get_origin_element(sint32 rideIndex, BigCoordsXYE *output) * Use track_block_get_next if you are unsure if you are * on the first element of a track block */ -bool track_block_get_next_from_zero(sint16 x, sint16 y, sint16 z_start, uint8 rideIndex, uint8 direction_start, BigCoordsXYE *output, sint32 *z, sint32 *direction) +bool track_block_get_next_from_zero(sint16 x, sint16 y, sint16 z_start, uint8 rideIndex, uint8 direction_start, CoordsXYE *output, sint32 *z, sint32 *direction) { Ride* ride = get_ride(rideIndex); @@ -596,7 +596,7 @@ bool track_block_get_next_from_zero(sint16 x, sint16 y, sint16 z_start, uint8 ri * * rct2: 0x006C60C2 */ -bool track_block_get_next(BigCoordsXYE *input, BigCoordsXYE *output, sint32 *z, sint32 *direction) +bool track_block_get_next(CoordsXYE *input, CoordsXYE *output, sint32 *z, sint32 *direction) { uint8 rideIndex = track_element_get_ride_index(input->element); Ride* ride = get_ride(rideIndex); @@ -805,7 +805,7 @@ bool track_block_get_previous(sint32 x, sint32 y, rct_tile_element *tileElement, * bx result y * esi input / output map element */ -sint32 ride_find_track_gap(BigCoordsXYE *input, BigCoordsXYE *output) +sint32 ride_find_track_gap(CoordsXYE *input, CoordsXYE *output) { rct_window *w; Ride *ride; @@ -1029,7 +1029,7 @@ static rct_window *ride_create_or_find_construction_window(sint32 rideIndex) */ void ride_construct(sint32 rideIndex) { - BigCoordsXYE trackElement; + CoordsXYE trackElement; if (ride_try_get_origin_element(rideIndex, &trackElement)) { ride_find_track_gap(&trackElement, &trackElement); @@ -1390,7 +1390,7 @@ void ride_remove_provisional_track_piece() x -= TileDirectionDelta[direction].x; y -= TileDirectionDelta[direction].y; } - BigCoordsXYE next_track; + CoordsXYE next_track; if (track_block_get_next_from_zero(x, y, z, rideIndex, direction, &next_track, &z, &direction)) { sint32 flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_GHOST; game_do_command( @@ -1502,7 +1502,7 @@ void ride_construction_set_default_next_piece() sint32 x, y, z, direction, rideIndex, trackType, curve, bank, slope; Ride *ride; track_begin_end trackBeginEnd; - BigCoordsXYE xyElement; + CoordsXYE xyElement; rct_tile_element *tileElement; _currentTrackPrice = MONEY32_UNDEFINED; @@ -1653,7 +1653,7 @@ void ride_select_next_section() window_ride_construction_update_active_elements(); return; } - BigCoordsXYE inputElement, outputElement; + CoordsXYE inputElement, outputElement; inputElement.x = x; inputElement.y = y; inputElement.element = tileElement; @@ -1836,10 +1836,10 @@ static sint32 ride_modify_maze(rct_tile_element *tileElement, sint32 x, sint32 y * * rct2: 0x006CC056 */ -sint32 ride_modify(BigCoordsXYE *input) +sint32 ride_modify(CoordsXYE *input) { sint32 rideIndex, x, y, z, direction, type; - BigCoordsXYE tileElement, endOfTrackElement; + CoordsXYE tileElement, endOfTrackElement; Ride *ride; rct_ride_entry *rideEntry; @@ -4114,7 +4114,7 @@ static void sub_6B5952(sint32 rideIndex) * * rct2: 0x006D3319 */ -static sint32 ride_check_block_brakes(BigCoordsXYE *input, BigCoordsXYE *output) +static sint32 ride_check_block_brakes(CoordsXYE *input, CoordsXYE *output) { rct_window *w; track_circuit_iterator it; @@ -4163,7 +4163,7 @@ static sint32 ride_check_block_brakes(BigCoordsXYE *input, BigCoordsXYE *output) * @returns true if an inversion track piece is found, otherwise false. * rct2: 0x006CB149 */ -static bool ride_check_track_contains_inversions(BigCoordsXYE *input, BigCoordsXYE *output) +static bool ride_check_track_contains_inversions(CoordsXYE *input, CoordsXYE *output) { sint32 rideIndex = track_element_get_ride_index(input->element); Ride *ride = get_ride(rideIndex); @@ -4208,7 +4208,7 @@ static bool ride_check_track_contains_inversions(BigCoordsXYE *input, BigCoordsX * @returns true if a banked track piece is found, otherwise false. * rct2: 0x006CB1D3 */ -static bool ride_check_track_contains_banked(BigCoordsXYE *input, BigCoordsXYE *output) +static bool ride_check_track_contains_banked(CoordsXYE *input, CoordsXYE *output) { sint32 rideIndex = track_element_get_ride_index(input->element); Ride *ride = get_ride(rideIndex); @@ -4250,7 +4250,7 @@ static bool ride_check_track_contains_banked(BigCoordsXYE *input, BigCoordsXYE * * * rct2: 0x006CB25D */ -static sint32 ride_check_station_length(BigCoordsXYE *input, BigCoordsXYE *output) +static sint32 ride_check_station_length(CoordsXYE *input, CoordsXYE *output) { rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr && @@ -4271,7 +4271,7 @@ static sint32 ride_check_station_length(BigCoordsXYE *input, BigCoordsXYE *outpu } sint32 num_station_elements = 0; - BigCoordsXYE last_good_station = *output; + CoordsXYE last_good_station = *output; do{ if (TrackSequenceProperties[track_element_get_type(output->element)][0] & TRACK_SEQUENCE_FLAG_ORIGIN){ @@ -4300,12 +4300,12 @@ static sint32 ride_check_station_length(BigCoordsXYE *input, BigCoordsXYE *outpu * * rct2: 0x006CB2DA */ -static bool ride_check_start_and_end_is_station(BigCoordsXYE * input, BigCoordsXYE * output) +static bool ride_check_start_and_end_is_station(CoordsXYE * input, CoordsXYE * output) { rct_window *w; Ride *ride; sint32 rideIndex, trackType; - BigCoordsXYE trackBack, trackFront; + CoordsXYE trackBack, trackFront; rideIndex = track_element_get_ride_index(input->element); ride = get_ride(rideIndex); @@ -4342,7 +4342,7 @@ static bool ride_check_start_and_end_is_station(BigCoordsXYE * input, BigCoordsX * station or the last track piece from the end of the direction. * rct2: 0x006B4D39 */ -static void ride_set_boat_hire_return_point(Ride * ride, BigCoordsXYE * startElement) +static void ride_set_boat_hire_return_point(Ride * ride, CoordsXYE * startElement) { sint32 trackType = -1; sint32 returnX = startElement->x; @@ -4419,9 +4419,9 @@ static void ride_set_maze_entrance_exit_points(Ride *ride) * Sets a flag on all the track elements that can be the start of a circuit block. i.e. where a train can start. * rct2: 0x006B4E6B */ -static void ride_set_block_points(BigCoordsXYE *startElement) +static void ride_set_block_points(CoordsXYE *startElement) { - BigCoordsXYE currentElement = *startElement; + CoordsXYE currentElement = *startElement; do { sint32 trackType = track_element_get_type(currentElement.element); switch (trackType) { @@ -4442,7 +4442,7 @@ static void ride_set_block_points(BigCoordsXYE *startElement) * * rct2: 0x006B4D26 */ -static void ride_set_start_finish_points(sint32 rideIndex, BigCoordsXYE *startElement) +static void ride_set_start_finish_points(sint32 rideIndex, CoordsXYE *startElement) { Ride *ride = get_ride(rideIndex); @@ -4749,7 +4749,7 @@ static void vehicle_unset_update_flag_b1(rct_vehicle *head) * * rct2: 0x006DDE9E */ -static void ride_create_vehicles_find_first_block(Ride *ride, BigCoordsXYE *outXYElement) +static void ride_create_vehicles_find_first_block(Ride *ride, CoordsXYE *outXYElement) { rct_vehicle *vehicle = GET_VEHICLE(ride->vehicles[0]); sint32 firstX = vehicle->track_x; @@ -4817,7 +4817,7 @@ static void ride_create_vehicles_find_first_block(Ride *ride, BigCoordsXYE *outX * * rct2: 0x006DD84C */ -static bool ride_create_vehicles(Ride *ride, sint32 rideIndex, BigCoordsXYE *element, sint32 isApplying) +static bool ride_create_vehicles(Ride *ride, sint32 rideIndex, CoordsXYE *element, sint32 isApplying) { ride_update_max_vehicles(rideIndex); if (ride->subtype == RIDE_ENTRY_INDEX_NULL) { @@ -4870,7 +4870,7 @@ static bool ride_create_vehicles(Ride *ride, sint32 rideIndex, BigCoordsXYE *ele // if (ride->type != RIDE_TYPE_SPACE_RINGS && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)) { if (ride_is_block_sectioned(ride)) { - BigCoordsXYE firstBlock; + CoordsXYE firstBlock; ride_create_vehicles_find_first_block(ride, &firstBlock); loc_6DDF9C(ride, firstBlock.element); } else { @@ -5153,7 +5153,7 @@ static void loc_6B51C0(sint32 rideIndex) sint32 z = ride->station_heights[i] * 8; window_scroll_to_location(w, x, y, z); - BigCoordsXYE trackElement; + CoordsXYE trackElement; ride_try_get_origin_element(rideIndex, &trackElement); ride_find_track_gap(&trackElement, &trackElement); sint32 ok = ride_modify(&trackElement); @@ -5171,7 +5171,7 @@ static void loc_6B51C0(sint32 rideIndex) * * rct2: 0x006B528A */ -static void ride_scroll_to_track_error(BigCoordsXYE *trackElement) +static void ride_scroll_to_track_error(CoordsXYE *trackElement) { if (!gGameCommandIsNetworked && gUnk141F568 == gUnk13CA740) { rct_window *w = window_get_main(); @@ -5213,7 +5213,7 @@ sint32 ride_is_valid_for_test(sint32 rideIndex, sint32 goingToBeOpen, sint32 isA { sint32 stationIndex; Ride *ride; - BigCoordsXYE trackElement, problematicTrackElement = { 0 }; + CoordsXYE trackElement, problematicTrackElement = { 0 }; ride = get_ride(rideIndex); if (ride->type == RIDE_TYPE_NULL) @@ -5342,7 +5342,7 @@ sint32 ride_is_valid_for_open(sint32 rideIndex, sint32 goingToBeOpen, sint32 isA { sint32 stationIndex; Ride *ride; - BigCoordsXYE trackElement, problematicTrackElement = { 0 }; + CoordsXYE trackElement, problematicTrackElement = { 0 }; ride = get_ride(rideIndex); @@ -5903,7 +5903,7 @@ void game_command_callback_ride_construct_placed_front(sint32 eax, sint32 ebx, s y -= TileDirectionDelta[trackDirection].y; } - BigCoordsXYE next_track; + CoordsXYE next_track; if (track_block_get_next_from_zero(x, y, z, _currentRideIndex, trackDirection, &next_track, &z, &trackDirection)) { _currentTrackBeginX = next_track.x; _currentTrackBeginY = next_track.y; @@ -6787,7 +6787,7 @@ bool ride_select_forwards_from_back() y = _currentTrackBeginY; z = _currentTrackBeginZ; direction = _currentTrackPieceDirection ^ 2; - BigCoordsXYE next_track; + CoordsXYE next_track; if (track_block_get_next_from_zero(x, y, z, _currentRideIndex, direction, &next_track, &z, &direction)) { _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 2fd98c5d96..ba51d29455 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1019,11 +1019,11 @@ money32 get_shop_item_cost(sint32 shopItem); money16 get_shop_base_value(sint32 shopItem); money16 get_shop_hot_value(sint32 shopItem); money16 get_shop_cold_value(sint32 shopItem); -bool ride_try_get_origin_element(sint32 rideIndex, BigCoordsXYE *output); -sint32 ride_find_track_gap(BigCoordsXYE *input, BigCoordsXYE *output); +bool ride_try_get_origin_element(sint32 rideIndex, CoordsXYE *output); +sint32 ride_find_track_gap(CoordsXYE *input, CoordsXYE *output); void ride_construct_new(ride_list_item listItem); void ride_construct(sint32 rideIndex); -sint32 ride_modify(BigCoordsXYE *input); +sint32 ride_modify(CoordsXYE *input); void ride_remove_peeps(sint32 rideIndex); void ride_get_status(sint32 rideIndex, rct_string_id *formatSecondary, sint32 *argument); rct_peep *ride_get_assigned_mechanic(Ride *ride); @@ -1114,8 +1114,8 @@ void ride_all_has_any_track_elements(bool *rideIndexArray); void ride_construction_set_default_next_piece(); -bool track_block_get_next(BigCoordsXYE *input, BigCoordsXYE *output, sint32 *z, sint32 *direction); -bool track_block_get_next_from_zero(sint16 x, sint16 y, sint16 z_start, uint8 rideIndex, uint8 direction_start, BigCoordsXYE *output, sint32 *z, sint32 *direction); +bool track_block_get_next(CoordsXYE *input, CoordsXYE *output, sint32 *z, sint32 *direction); +bool track_block_get_next_from_zero(sint16 x, sint16 y, sint16 z_start, uint8 rideIndex, uint8 direction_start, CoordsXYE *output, sint32 *z, sint32 *direction); bool track_block_get_previous(sint32 x, sint32 y, rct_tile_element *tileElement, track_begin_end *outTrackBeginEnd); bool track_block_get_previous_from_zero(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint8 direction, track_begin_end *outTrackBeginEnd); diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 2d29cf44f2..09fc7ecc68 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -218,12 +218,12 @@ static void ride_ratings_update_state_2() ride_ratings_score_close_proximity(tileElement); - BigCoordsXYE trackElement = { + CoordsXYE trackElement = { /* .x = */ gRideRatingsCalcData.proximity_x, /* .y = */ gRideRatingsCalcData.proximity_y, /* .element = */ tileElement }; - BigCoordsXYE nextTrackElement; + CoordsXYE nextTrackElement; if (!track_block_get_next(&trackElement, &nextTrackElement, NULL, NULL)) { gRideRatingsCalcData.state = RIDE_RATINGS_STATE_4; return; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 0f91b3c708..d9ed6b7ea2 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -2325,7 +2325,7 @@ void game_command_set_brakes_speed(sint32 * eax, *ebx = 0; } -void track_circuit_iterator_begin(track_circuit_iterator * it, BigCoordsXYE first) +void track_circuit_iterator_begin(track_circuit_iterator * it, CoordsXYE first) { it->last = first; it->first = nullptr; @@ -2410,9 +2410,9 @@ bool track_circuit_iterators_match(const track_circuit_iterator * firstIt, const firstIt->current.y == secondIt->current.y); } -void track_get_back(BigCoordsXYE * input, BigCoordsXYE * output) +void track_get_back(CoordsXYE * input, CoordsXYE * output) { - BigCoordsXYE lastTrack; + CoordsXYE lastTrack; track_begin_end currentTrack; bool result; @@ -2431,9 +2431,9 @@ void track_get_back(BigCoordsXYE * input, BigCoordsXYE * output) *output = lastTrack; } -void track_get_front(BigCoordsXYE * input, BigCoordsXYE * output) +void track_get_front(CoordsXYE * input, CoordsXYE * output) { - BigCoordsXYE lastTrack, currentTrack; + CoordsXYE lastTrack, currentTrack; sint32 z, direction; bool result; diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index e57385790f..91de8c2854 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -510,8 +510,8 @@ enum struct track_circuit_iterator { - BigCoordsXYE last; - BigCoordsXYE current; + CoordsXYE last; + CoordsXYE current; sint32 currentZ; sint32 currentDirection; rct_tile_element * first; @@ -530,13 +530,13 @@ const rct_preview_track * get_track_def_from_ride(Ride * ride, sint32 trackType) const rct_preview_track * get_track_def_from_ride_index(sint32 rideIndex, sint32 trackType); const rct_track_coordinates * get_track_coord_from_ride(Ride * ride, sint32 trackType); -void track_circuit_iterator_begin(track_circuit_iterator * it, BigCoordsXYE first); +void track_circuit_iterator_begin(track_circuit_iterator * it, CoordsXYE first); bool track_circuit_iterator_previous(track_circuit_iterator * it); bool track_circuit_iterator_next(track_circuit_iterator * it); bool track_circuit_iterators_match(const track_circuit_iterator * firstIt, const track_circuit_iterator * secondIt); -void track_get_back(BigCoordsXYE * input, BigCoordsXYE * output); -void track_get_front(BigCoordsXYE * input, BigCoordsXYE * output); +void track_get_back(CoordsXYE * input, CoordsXYE * output); +void track_get_front(CoordsXYE * input, CoordsXYE * output); bool track_element_is_block_start(rct_tile_element * trackElement); bool track_element_is_covered(sint32 trackElementType); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 178f057edc..36632bced3 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1194,7 +1194,7 @@ static sint32 track_design_place_maze(rct_track_td6 * td6, sint16 x, sint16 y, s for (; maze_element->all != 0; maze_element++) { uint8 rotation = _currentTrackPieceDirection & 3; - BigCoordsXY mapCoord = {maze_element->x * 32, maze_element->y * 32}; + CoordsXY mapCoord = {maze_element->x * 32, maze_element->y * 32}; sint16 tmpX = mapCoord.x; sint16 tmpY = mapCoord.y; rotate_map_coordinates(&tmpX, &tmpY, rotation); @@ -1494,7 +1494,7 @@ static bool track_design_place_ride(rct_track_td6 * td6, sint16 x, sint16 y, sin sint32 tempZ = z - TrackCoordinates[trackType].z_begin; for (const rct_preview_track * trackBlock = TrackBlocks[trackType]; trackBlock->index != 0xFF; trackBlock++) { - BigCoordsXY tile = {x, y}; + CoordsXY tile = {x, y}; sint16 tmpX = tile.x; sint16 tmpY = tile.y; map_offset_with_rotation(&tmpX, &tmpY, trackBlock->x, trackBlock->y, rotation); diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 25e6c104ea..c8ac1b25e8 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -944,7 +944,7 @@ static bool track_design_save_to_td6_for_maze(uint8 rideIndex, rct_track_td6 *td static bool track_design_save_to_td6_for_tracked_ride(uint8 rideIndex, rct_track_td6 *td6) { Ride *ride = get_ride(rideIndex); - BigCoordsXYE trackElement; + CoordsXYE trackElement; track_begin_end trackBeginEnd; if (!ride_try_get_origin_element(rideIndex, &trackElement)) { @@ -958,7 +958,7 @@ static bool track_design_save_to_td6_for_tracked_ride(uint8 rideIndex, rct_track if (track_block_get_previous(trackElement.x, trackElement.y, trackElement.element, &trackBeginEnd)) { rct_tile_element* initial_map = trackElement.element; do { - BigCoordsXYE lastGood = { + CoordsXYE lastGood = { /* .x = */ trackBeginEnd.begin_x, /* .y = */ trackBeginEnd.begin_y, /* .element = */ trackBeginEnd.begin_element diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 18cd38de8f..01b4027b27 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -2566,7 +2566,7 @@ static void vehicle_update_waiting_to_depart(rct_vehicle * vehicle) if (ride->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT) { - BigCoordsXYE track; + CoordsXYE track; sint32 z; sint32 direction; @@ -7919,7 +7919,7 @@ static void sub_6DBF3E(rct_vehicle * vehicle) { if (vehicle->track_progress > 3 && !(vehicle->update_flags & VEHICLE_UPDATE_FLAG_REVERSING_SHUTTLE)) { - BigCoordsXYE input, output; + CoordsXYE input, output; sint32 outputZ, outputDirection; input.x = vehicle->track_x; @@ -8049,7 +8049,7 @@ loc_6DB32A: loc_6DB358: { - BigCoordsXYE xyElement; + CoordsXYE xyElement; sint32 z, direction; xyElement.x = vehicle->track_x; xyElement.y = vehicle->track_y; @@ -8490,8 +8490,8 @@ static bool vehicle_update_track_motion_backwards_get_new_track(rct_vehicle * ve else { // loc_6DBB4F:; - BigCoordsXYE input; - BigCoordsXYE output; + CoordsXYE input; + CoordsXYE output; sint32 outputZ; input.x = x; @@ -8881,7 +8881,7 @@ loc_6DC476: sint16 x, y, z; sint32 direction; { - BigCoordsXYE input, output; + CoordsXYE input, output; sint32 outZ, outDirection; input.x = vehicle->track_x; input.y = vehicle->track_y; diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 84db2f9885..0287b24b04 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -158,8 +158,8 @@ static void spiral_slide_paint_tile_front( { sint32 offset = SPIRAL_SLIDE_PEEP + 46 * direction; - BigCoordsXYZ boundingBox = { 0, 0, 108 }; - BigCoordsXYZ boundingBoxOffset = { 0, 0, static_cast(height + 3) }; + CoordsXYZ boundingBox = { 0, 0, 108 }; + CoordsXYZ boundingBoxOffset = { 0, 0, static_cast(height + 3) }; if (direction == 0) { diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index ce67c3ee8f..ac7ccfed0b 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -146,8 +146,8 @@ static bool chairlift_paint_util_is_first_track(uint8 rideIndex, const rct_tile_ return false; } - BigCoordsXY delta = TileDirectionDelta[tile_element_get_direction(tileElement)]; - BigCoordsXY newPos = { + CoordsXY delta = TileDirectionDelta[tile_element_get_direction(tileElement)]; + CoordsXY newPos = { static_cast(pos.x - delta.x), static_cast(pos.y - delta.y), }; @@ -166,8 +166,8 @@ static bool chairlift_paint_util_is_last_track(uint8 rideIndex, const rct_tile_e return false; } - BigCoordsXY delta = TileDirectionDelta[tile_element_get_direction(tileElement)]; - BigCoordsXY newPos = { + CoordsXY delta = TileDirectionDelta[tile_element_get_direction(tileElement)]; + CoordsXY newPos = { static_cast(pos.x + delta.x), static_cast(pos.y + delta.y), }; diff --git a/src/openrct2/world/Location.h b/src/openrct2/world/Location.h index 462e6234e6..e55fd05dc0 100644 --- a/src/openrct2/world/Location.h +++ b/src/openrct2/world/Location.h @@ -60,36 +60,36 @@ struct LocationXYZ32 { #pragma pack(pop) /* - * Small coordinates use 1 x/y increment per tile. - * Big coordinates use 32 x/y increments per tile. + * Tile coordinates use 1 x/y increment per tile. + * Regular ('big', 'sprite') coordinates use 32 x/y increments per tile. * */ -struct SmallCoordsXY +struct TileCoordsXY { sint32 x, y; }; -struct BigCoordsXY +struct CoordsXY { sint32 x, y; }; -struct SmallCoordsXYZ +struct TileCoordsXYZ { sint32 x, y, z; }; -struct BigCoordsXYZ +struct CoordsXYZ { sint32 x, y, z; }; -struct SmallCoordsXYZD +struct TileCoordsXYZD { sint32 x, y, z; uint8 direction; }; -struct BigCoordsXYZD +struct CoordsXYZD { sint32 x, y, z; uint8 direction; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 84f1eaa8df..529ec48543 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -52,7 +52,7 @@ /** * Replaces 0x00993CCC, 0x00993CCE */ -const BigCoordsXY TileDirectionDelta[] = { +const CoordsXY TileDirectionDelta[] = { { -32, 0 }, { 0, +32 }, { +32, 0 }, @@ -352,7 +352,7 @@ rct_tile_element * map_get_surface_element_at(sint32 x, sint32 y) return tileElement; } -rct_tile_element * map_get_surface_element_at(BigCoordsXY coords) +rct_tile_element * map_get_surface_element_at(CoordsXY coords) { return map_get_surface_element_at(coords.x / 32, coords.y / 32); } @@ -4904,15 +4904,15 @@ bool map_tile_is_part_of_virtual_floor(sint16 x, sint16 y) return false; } -void FixLandOwnershipTiles(std::initializer_list tiles) +void FixLandOwnershipTiles(std::initializer_list tiles) { FixLandOwnershipTilesWithOwnership(tiles, OWNERSHIP_AVAILABLE); } -void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8 ownership) +void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8 ownership) { rct_tile_element * currentElement; - for (const SmallCoordsXY * tile = tiles.begin(); tile != tiles.end(); ++tile) + for (const TileCoordsXY * tile = tiles.begin(); tile != tiles.end(); ++tile) { currentElement = map_get_surface_element_at((*tile).x, (*tile).y); currentElement->properties.surface.ownership |= ownership; diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index d639b74cfa..ba071fd437 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -333,7 +333,7 @@ struct rct2_peep_spawn { assert_struct_size(rct2_peep_spawn, 6); #pragma pack(pop) -struct BigCoordsXYE +struct CoordsXYE { sint32 x, y; rct_tile_element * element; @@ -373,7 +373,7 @@ enum CREATE_CROSSING_MODE_PATH_OVER_TRACK, }; -extern const BigCoordsXY TileDirectionDelta[]; +extern const CoordsXY TileDirectionDelta[]; extern const money32 TerrainPricing[]; extern uint16 gWidePathTileLoopX; @@ -444,7 +444,7 @@ void tile_element_set_terrain_edge(rct_tile_element *element, sint32 terrain); sint32 map_height_from_slope(sint32 x, sint32 y, sint32 slope); rct_tile_element* map_get_banner_element_at(sint32 x, sint32 y, sint32 z, uint8 direction); rct_tile_element *map_get_surface_element_at(sint32 x, sint32 y); -rct_tile_element * map_get_surface_element_at(BigCoordsXY coords); +rct_tile_element * map_get_surface_element_at(CoordsXY coords); rct_tile_element* map_get_path_element_at(sint32 x, sint32 y, sint32 z); rct_tile_element *map_get_wall_element_at(sint32 x, sint32 y, sint32 z, sint32 direction); rct_tile_element *map_get_small_scenery_element_at(sint32 x, sint32 y, sint32 z, sint32 type, uint8 quadrant); @@ -585,7 +585,7 @@ uint32 map_get_available_peep_spawn_index_list(uint32* peepSpawnIndexList); uint16 check_max_allowable_land_rights_for_tile(uint8 x, uint8 y, uint8 base_z); uint8 tile_element_get_ride_index(const rct_tile_element * tileElement); -void FixLandOwnershipTiles(std::initializer_list tiles); -void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8 ownership); +void FixLandOwnershipTiles(std::initializer_list tiles); +void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8 ownership); #endif diff --git a/test/testpaint/Compat.cpp b/test/testpaint/Compat.cpp index eb40df3274..a75c3afb3e 100644 --- a/test/testpaint/Compat.cpp +++ b/test/testpaint/Compat.cpp @@ -39,7 +39,7 @@ uint32 gCurrentViewportFlags; uint32 gScenarioTicks; uint8 gCurrentRotation; -const BigCoordsXY TileDirectionDelta[] = { +const CoordsXY TileDirectionDelta[] = { {-32, 0}, {0, +32}, {+32, 0},