From 2ea1fcc69d759fc81cb4837946f94951e1bd6020 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 13 May 2019 22:16:14 +0200 Subject: [PATCH 1/5] Remove unused declarations and functions --- src/openrct2/actions/TrackRemoveAction.hpp | 4 + src/openrct2/peep/Staff.h | 4 - src/openrct2/ride/Ride.h | 8 - src/openrct2/ride/Track.cpp | 318 --------------------- src/openrct2/ride/Track.h | 3 - src/openrct2/world/Footpath.h | 2 - src/openrct2/world/Map.h | 3 - 7 files changed, 4 insertions(+), 338 deletions(-) diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index 5ad20a6b4b..696fce916e 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -19,6 +19,10 @@ #include "../world/Surface.h" #include "GameAction.h" +/** + * + * rct2: 0x006C5B69 + */ DEFINE_GAME_ACTION(TrackRemoveAction, GAME_COMMAND_REMOVE_TRACK, GameActionResult) { private: diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 696c66c7d9..2685a68334 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -71,10 +71,6 @@ extern colour_t gStaffHandymanColour; extern colour_t gStaffMechanicColour; extern colour_t gStaffSecurityColour; -void game_command_hire_new_staff_member( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); -void game_command_callback_hire_new_staff_member( - int32_t eax, int32_t ebx, int32_t ecx, int32_t edx, int32_t esi, int32_t edi, int32_t ebp); void game_command_set_staff_name( int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); void game_command_pickup_staff( diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index e447717917..b2a4fbabae 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1098,8 +1098,6 @@ int32_t ride_get_random_colour_preset_index(uint8_t ride_type); money32 ride_get_common_price(Ride* forRide); rct_ride_name get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry); void game_command_create_ride(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); -void game_command_callback_ride_construct_new( - int32_t eax, int32_t ebx, int32_t ecx, int32_t edx, int32_t esi, int32_t edi, int32_t ebp); void game_command_demolish_ride( int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); money32 ride_create_command(int32_t type, int32_t subType, int32_t flags, ride_id_t* outRideIndex, uint8_t* outRideColour); @@ -1167,12 +1165,6 @@ enum class RideSetSetting : uint8_t; money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value); money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags); -void game_command_set_ride_vehicles( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); - -void game_command_place_ride_entrance_or_exit( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); - void sub_6CB945(Ride* ride); void sub_6C94D8(); diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index f0eac99893..6a9920433a 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -944,324 +944,6 @@ bool track_remove_station_element(int32_t x, int32_t y, int32_t z, int32_t direc return true; } -static money32 track_remove( - uint8_t type, uint8_t sequence, int16_t originX, int16_t originY, int16_t originZ, uint8_t rotation, uint8_t flags) -{ - gCommandExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; - gCommandPosition.x = originX + 16; - gCommandPosition.y = originY + 16; - gCommandPosition.z = originZ; - int16_t trackpieceZ = originZ; - - switch (type) - { - case TRACK_ELEM_BEGIN_STATION: - case TRACK_ELEM_MIDDLE_STATION: - type = TRACK_ELEM_END_STATION; - break; - } - - if (!(flags & (1 << 3)) && game_is_paused() && !gCheatsBuildInPauseMode) - { - gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED; - return MONEY32_UNDEFINED; - } - - bool found = false; - bool isGhost = flags & GAME_COMMAND_FLAG_GHOST; - TileElement* tileElement = map_get_first_element_at(originX / 32, originY / 32); - if (tileElement == nullptr) - { - log_warning("Invalid coordinates for track removal. x = %d, y = %d", originX, originY); - return MONEY32_UNDEFINED; - } - do - { - if (tileElement->base_height * 8 != originZ) - continue; - - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - - if ((tileElement->GetDirection()) != rotation) - continue; - - if (tileElement->AsTrack()->GetSequenceIndex() != sequence) - continue; - - if (tileElement->IsGhost() != isGhost) - continue; - - uint8_t track_type = tileElement->AsTrack()->GetTrackType(); - switch (track_type) - { - case TRACK_ELEM_BEGIN_STATION: - case TRACK_ELEM_MIDDLE_STATION: - track_type = TRACK_ELEM_END_STATION; - break; - } - - if (track_type != type) - continue; - - found = true; - break; - } while (!(tileElement++)->IsLastForTile()); - - if (!found) - { - return MONEY32_UNDEFINED; - } - - if (tileElement->AsTrack()->IsIndestructible()) - { - gGameCommandErrorText = STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION; - return MONEY32_UNDEFINED; - } - - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); - type = tileElement->AsTrack()->GetTrackType(); - bool isLiftHill = tileElement->AsTrack()->HasChain(); - - Ride* ride = get_ride(rideIndex); - const rct_preview_track* trackBlock = get_track_def_from_ride(ride, type); - trackBlock += tileElement->AsTrack()->GetSequenceIndex(); - - uint8_t originDirection = tileElement->GetDirection(); - switch (originDirection) - { - case 0: - originX -= trackBlock->x; - originY -= trackBlock->y; - break; - case 1: - originX -= trackBlock->y; - originY += trackBlock->x; - break; - case 2: - originX += trackBlock->x; - originY += trackBlock->y; - break; - case 3: - originX += trackBlock->y; - originY -= trackBlock->x; - break; - } - - originZ -= trackBlock->z; - - money32 cost = 0; - - trackBlock = get_track_def_from_ride(ride, type); - for (; trackBlock->index != 255; trackBlock++) - { - int16_t x = originX, y = originY, z = originZ; - - switch (originDirection) - { - case 0: - x += trackBlock->x; - y += trackBlock->y; - break; - case 1: - x += trackBlock->y; - y -= trackBlock->x; - break; - case 2: - x -= trackBlock->x; - y -= trackBlock->y; - break; - case 3: - x -= trackBlock->y; - y += trackBlock->x; - break; - } - - z += trackBlock->z; - - map_invalidate_tile_full(x, y); - - trackpieceZ = z; - - found = false; - tileElement = map_get_first_element_at(x / 32, y / 32); - do - { - if (tileElement == nullptr) - break; - - if (tileElement->base_height != z / 8) - continue; - - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - - if (tileElement->GetDirection() != rotation) - continue; - - if (tileElement->AsTrack()->GetSequenceIndex() != trackBlock->index) - continue; - - if (tileElement->AsTrack()->GetTrackType() != type) - continue; - - if (tileElement->IsGhost() != isGhost) - continue; - - found = true; - break; - } while (!(tileElement++)->IsLastForTile()); - - if (!found) - { - log_error("Track map element part not found!"); - return MONEY32_UNDEFINED; - } - - int32_t entranceDirections; - if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE)) - { - entranceDirections = FlatRideTrackSequenceProperties[type][0]; - } - else - { - entranceDirections = TrackSequenceProperties[type][0]; - } - - if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) - { - if (!track_remove_station_element(x, y, z / 8, rotation, rideIndex, 0)) - { - return MONEY32_UNDEFINED; - } - } - - TileElement* surfaceElement = map_get_surface_element_at({ x, y }); - if (surfaceElement == nullptr) - { - return MONEY32_UNDEFINED; - } - - int8_t _support_height = tileElement->base_height - surfaceElement->base_height; - if (_support_height < 0) - { - _support_height = 10; - } - - cost += (_support_height / 2) * RideTrackCosts[ride->type].support_price; - - if (!(flags & GAME_COMMAND_FLAG_APPLY)) - continue; - - if (entranceDirections & (1 << 4) && (tileElement->AsTrack()->GetSequenceIndex() == 0)) - { - if (!track_remove_station_element(x, y, z / 8, rotation, rideIndex, GAME_COMMAND_FLAG_APPLY)) - { - return MONEY32_UNDEFINED; - } - } - - if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER)) - { - surfaceElement->AsSurface()->SetHasTrackThatNeedsWater(false); - } - - invalidate_test_results(ride); - footpath_queue_chain_reset(); - if (!gCheatsDisableClearanceChecks || !(tileElement->IsGhost())) - { - footpath_remove_edges_at(x, y, tileElement); - } - tile_element_remove(tileElement); - sub_6CB945(ride); - if (!(flags & GAME_COMMAND_FLAG_GHOST)) - { - ride->UpdateMaxVehicles(); - } - } - - if (flags & GAME_COMMAND_FLAG_APPLY) - { - switch (type) - { - case TRACK_ELEM_ON_RIDE_PHOTO: - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_ON_RIDE_PHOTO; - break; - case TRACK_ELEM_CABLE_LIFT_HILL: - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED; - break; - case TRACK_ELEM_BLOCK_BRAKES: - ride->num_block_brakes--; - if (ride->num_block_brakes == 0) - { - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_OPERATING; - ride->mode = RIDE_MODE_CONTINUOUS_CIRCUIT; - if (ride->type == RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER) - { - ride->mode = RIDE_MODE_POWERED_LAUNCH; - } - } - break; - } - - switch (type) - { - case TRACK_ELEM_25_DEG_UP_TO_FLAT: - case TRACK_ELEM_60_DEG_UP_TO_FLAT: - case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: - case TRACK_ELEM_DIAG_60_DEG_UP_TO_FLAT: - if (!isLiftHill) - break; - [[fallthrough]]; - case TRACK_ELEM_CABLE_LIFT_HILL: - ride->num_block_brakes--; - break; - } - } - - money32 price = RideTrackCosts[ride->type].track_price; - if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE)) - { - price *= FlatRideTrackPricing[type]; - } - else - { - price *= TrackPricing[type]; - } - price >>= 16; - price = (price + cost) / 2; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) - price *= -7; - else - price *= -10; - - if (gGameCommandNestLevel == 1) - { - LocationXYZ16 coord; - coord.x = originX + 16; - coord.y = originY + 16; - coord.z = trackpieceZ; - network_set_player_last_action_coord(network_get_player_index(game_command_playerid), coord); - } - - if (gParkFlags & PARK_FLAGS_NO_MONEY) - return 0; - else - return price; -} - -/** - * - * rct2: 0x006C5B69 - */ -void game_command_remove_track( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi, int32_t* edi, - [[maybe_unused]] int32_t* ebp) -{ - *ebx = track_remove( - *edx & 0xFF, (*edx >> 8) & 0xFF, *eax & 0xFFFF, *ecx & 0xFFFF, *edi & 0xFFFF, (*ebx >> 8) & 0xFF, *ebx & 0xFF); -} - void track_circuit_iterator_begin(track_circuit_iterator* it, CoordsXYE first) { it->last = first; diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index 1ecbaabc4e..5bed1870b5 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -547,9 +547,6 @@ int32_t track_get_actual_bank_3(rct_vehicle* vehicle, TileElement* tileElement); bool track_add_station_element(int32_t x, int32_t y, int32_t z, int32_t direction, ride_id_t rideIndex, int32_t flags); bool track_remove_station_element(int32_t x, int32_t y, int32_t z, int32_t direction, ride_id_t rideIndex, int32_t flags); -void game_command_remove_track( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); - void game_command_set_maze_track( int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); money32 maze_set_track( diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 8cd5f1967d..0feee82a0b 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -176,8 +176,6 @@ TileElement* map_get_footpath_element(int32_t x, int32_t y, int32_t z); struct PathElement; PathElement* map_get_footpath_element_slope(int32_t x, int32_t y, int32_t z, int32_t slope); void footpath_interrupt_peeps(int32_t x, int32_t y, int32_t z); -void game_command_remove_footpath( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); money32 footpath_remove(int32_t x, int32_t y, int32_t z, int32_t flags); money32 footpath_provisional_set(int32_t type, int32_t x, int32_t y, int32_t z, int32_t slope); void footpath_provisional_remove(); diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 8b00d2ba35..5ea4bbfb77 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -186,12 +186,9 @@ bool map_can_construct_with_clear_at( int32_t map_can_construct_at(int32_t x, int32_t y, int32_t zLow, int32_t zHigh, QuarterTile bl); void rotate_map_coordinates(int16_t* x, int16_t* y, int32_t rotation); LocationXY16 coordinate_3d_to_2d(const LocationXYZ16* coordinate_3d, int32_t rotation); -money32 map_clear_scenery(int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t clear, int32_t flags); void game_command_place_park_entrance( int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); -void game_command_set_banner_name( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); void game_command_modify_tile(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); struct tile_element_iterator From 170307cd0f30d07ac656fec2cf383719e9cedf20 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 13 May 2019 22:16:30 +0200 Subject: [PATCH 2/5] Remove redundant semicolons after for loops --- src/openrct2/paint/sprite/Paint.Peep.cpp | 2 +- src/openrct2/paint/tile_element/Paint.Entrance.cpp | 2 +- src/openrct2/ride/thrill/RotoDrop.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 69d33e5d4a..ffac5bf987 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -48,7 +48,7 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection break; default: return; - }; + } lightfx_add_3d_light( peep->sprite_index, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, peep_x, peep_y, peep_z, LIGHTFX_LIGHT_TYPE_SPOT_1); diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 23774ce176..9ea0ed6093 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -63,7 +63,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, 0, 16, height + 16, LIGHTFX_LIGHT_TYPE_LANTERN_2); break; - }; + } } #endif diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 8caa763862..2c07534575 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -78,7 +78,7 @@ void vehicle_visual_roto_drop( image_id = baseImage_id | SPRITE_ID_PALETTE_COLOUR_1(riding_peep_sprites[i]); sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); } - }; + } assert(vehicleEntry->effect_visual == 1); // Although called in original code, effect_visual (splash effects) are not used for many rides and does not make sense so From 8d9645a3820a3ff7182525289bd41bae31213786 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 13 May 2019 22:22:14 +0200 Subject: [PATCH 3/5] Remove comment --- src/openrct2/actions/TrackRemoveAction.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index 696fce916e..5ad20a6b4b 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -19,10 +19,6 @@ #include "../world/Surface.h" #include "GameAction.h" -/** - * - * rct2: 0x006C5B69 - */ DEFINE_GAME_ACTION(TrackRemoveAction, GAME_COMMAND_REMOVE_TRACK, GameActionResult) { private: From 4e23c42d38999408fbe62ac6c4040ea67a30ef31 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 13 May 2019 22:51:41 +0200 Subject: [PATCH 4/5] Remove stub functions from new_game_command_table[] --- src/openrct2/Game.cpp | 40 +++++------ src/openrct2/actions/GameActionCompat.cpp | 85 ----------------------- src/openrct2/peep/Peep.h | 2 - src/openrct2/peep/Staff.h | 2 - src/openrct2/ride/Ride.h | 7 -- src/openrct2/ride/Track.h | 2 - src/openrct2/world/Map.h | 2 - 7 files changed, 20 insertions(+), 120 deletions(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 4fae71dd06..7a45d61cc6 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -1161,24 +1161,6 @@ GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = { nullptr, nullptr, nullptr, - game_command_create_ride, - game_command_demolish_ride, - game_command_set_ride_status, - nullptr, - game_command_set_ride_name, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - game_command_set_guest_name, - game_command_set_staff_name, nullptr, nullptr, nullptr, @@ -1192,9 +1174,27 @@ GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = { nullptr, nullptr, nullptr, - game_command_place_park_entrance, nullptr, - game_command_set_maze_track, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, game_command_set_park_entrance_fee, nullptr, nullptr, diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 7d71693de3..4f64632808 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -35,17 +35,6 @@ money32 place_park_entrance(int16_t x, int16_t y, int16_t z, uint8_t direction) } } -/** - * - * rct2: 0x006666E7 - */ -void game_command_place_park_entrance( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_PLACE_PARK_ENTRANCE DEPRECATED"); -} - /** * * rct2: 0x00666F4E @@ -135,17 +124,6 @@ money32 ride_create_command(int32_t type, int32_t subType, int32_t flags, ride_i return res->Cost; } -/** - * - * rct2: 0x006B3F0F - */ -void game_command_create_ride( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_CREATE_RIDE DEPRECATED"); -} - #pragma endregion #pragma region RideSetStatusAction @@ -156,17 +134,6 @@ void ride_set_status(Ride* ride, int32_t status) GameActions::Execute(&gameAction); } -/** - * - * rct2: 0x006B4EA6 - */ -void game_command_set_ride_status( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_SET_RIDE_STATUS DEPRECATED"); -} - #pragma endregion #pragma region RideSetNameAction @@ -176,17 +143,6 @@ void ride_set_name(Ride* ride, const char* name, uint32_t flags) gameAction.SetFlags(flags); GameActions::Execute(&gameAction); } - -/** - * - * rct2: 0x006B578B - */ -void game_command_set_ride_name( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_SET_RIDE_NAME DEPRECATED"); -} #pragma endregion #pragma region RideModifyAction @@ -197,17 +153,6 @@ void ride_action_modify(Ride* ride, int32_t modifyType, int32_t flags) GameActions::Execute(&gameAction); } - -/** - * - * rct2: 0x006B49D9 - */ -void game_command_demolish_ride( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_DEMOLISH_RIDE DEPRECATED"); -} #pragma endregion #pragma region GuestSetName @@ -217,18 +162,6 @@ void guest_set_name(uint16_t spriteIndex, const char* name) auto gameAction = GuestSetNameAction(spriteIndex, name); GameActions::Execute(&gameAction); } - -/** - * - * rct2: 0x00698D6C - */ -void game_command_set_guest_name( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_SET_GUEST_NAME DEPRECATED"); -} - #pragma endregion #pragma region StaffSetName @@ -238,13 +171,6 @@ void staff_set_name(uint16_t spriteIndex, const char* name) auto gameAction = StaffSetNameAction(spriteIndex, name); GameActions::Execute(&gameAction); } - -void game_command_set_staff_name( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_SET_STAFF_NAME DEPRECATED"); -} #pragma endregion #pragma region PlacePeepSpawn @@ -283,15 +209,4 @@ money32 maze_set_track( return res->Cost; } - -/** - * - * rct2: 0x006CD8CE - */ -void game_command_set_maze_track( - [[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx, - [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp) -{ - Guard::Assert(false, "GAME_COMMAND_SET_MAZE_TRACK DEPRECATED"); -} #pragma endregion diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index ad23880ec5..439d2a4cff 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -976,8 +976,6 @@ void peep_update_names(bool realNames); void guest_set_name(uint16_t spriteIndex, const char* name); void peep_handle_easteregg_name(Peep* peep); -void game_command_set_guest_name( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); int32_t peep_pathfind_choose_direction(TileCoordsXYZ loc, Peep* peep); void peep_reset_pathfind_goal(Peep* peep); diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 2685a68334..05c214797d 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -71,8 +71,6 @@ extern colour_t gStaffHandymanColour; extern colour_t gStaffMechanicColour; extern colour_t gStaffSecurityColour; -void game_command_set_staff_name( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); void game_command_pickup_staff( int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index b2a4fbabae..34bbbc86c3 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1088,18 +1088,11 @@ void ride_prepare_breakdown(Ride* ride, int32_t breakdownReason); TileElement* ride_get_station_start_track_element(Ride* ride, int32_t stationIndex); TileElement* ride_get_station_exit_element(int32_t x, int32_t y, int32_t z); void ride_set_status(Ride* ride, int32_t status); -void game_command_set_ride_status( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); void ride_set_name(Ride* ride, const char* name, uint32_t flags); -void game_command_set_ride_name( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); int32_t ride_get_refund_price(const Ride* ride); int32_t ride_get_random_colour_preset_index(uint8_t ride_type); money32 ride_get_common_price(Ride* forRide); rct_ride_name get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry); -void game_command_create_ride(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); -void game_command_demolish_ride( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); money32 ride_create_command(int32_t type, int32_t subType, int32_t flags, ride_id_t* outRideIndex, uint8_t* outRideColour); void ride_set_name_to_default(Ride* ride, rct_ride_entry* rideEntry); diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index 5bed1870b5..f24e71a354 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -547,8 +547,6 @@ int32_t track_get_actual_bank_3(rct_vehicle* vehicle, TileElement* tileElement); bool track_add_station_element(int32_t x, int32_t y, int32_t z, int32_t direction, ride_id_t rideIndex, int32_t flags); bool track_remove_station_element(int32_t x, int32_t y, int32_t z, int32_t direction, ride_id_t rideIndex, int32_t flags); -void game_command_set_maze_track( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); money32 maze_set_track( uint16_t x, uint16_t y, uint16_t z, uint8_t flags, bool initialPlacement, uint8_t direction, ride_id_t rideIndex, uint8_t mode); diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 5ea4bbfb77..b50068d3cd 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -187,8 +187,6 @@ int32_t map_can_construct_at(int32_t x, int32_t y, int32_t zLow, int32_t zHigh, void rotate_map_coordinates(int16_t* x, int16_t* y, int32_t rotation); LocationXY16 coordinate_3d_to_2d(const LocationXYZ16* coordinate_3d, int32_t rotation); -void game_command_place_park_entrance( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); void game_command_modify_tile(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); struct tile_element_iterator From 5e39640837682f553f64f081d63c0c46eb5eabcd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 14 May 2019 18:39:14 +0200 Subject: [PATCH 5/5] Also remove game_command_set_park_entrance_fee from new_game_command_table --- src/openrct2/Game.cpp | 2 +- src/openrct2/actions/GameActionCompat.cpp | 9 --------- src/openrct2/world/Park.h | 4 ---- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 7a45d61cc6..cb7f865879 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -1195,7 +1195,7 @@ GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = { nullptr, nullptr, nullptr, - game_command_set_park_entrance_fee, + nullptr, nullptr, nullptr, nullptr, diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 4f64632808..9002b26a38 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -65,15 +65,6 @@ void park_set_entrance_fee(money32 fee) auto gameAction = SetParkEntranceFeeAction((money16)fee); GameActions::Execute(&gameAction); } - -void game_command_set_park_entrance_fee( - [[maybe_unused]] int* eax, [[maybe_unused]] int* ebx, [[maybe_unused]] int* ecx, [[maybe_unused]] int* edx, - [[maybe_unused]] int* esi, int* edi, [[maybe_unused]] int* ebp) -{ - money16 fee = (money16)(*edi & 0xFFFF); - auto gameAction = SetParkEntranceFeeAction(fee); - GameActions::Execute(&gameAction); -} #pragma endregion #pragma region RideCreateAction diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 7d938d36e0..64e68cc679 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -125,10 +125,6 @@ void park_set_open(bool open); int32_t park_entrance_get_index(int32_t x, int32_t y, int32_t z); void park_set_name(const char* name); void park_set_entrance_fee(money32 value); - -void game_command_set_park_entrance_fee( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); - money16 park_get_entrance_fee(); bool park_ride_prices_unlocked();