From a2470c057354a0efe8cc46ee1ade07f7b69ffa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:17:11 +0200 Subject: [PATCH] Rename ride_id_t to RideId --- src/openrct2-ui/WindowManager.cpp | 10 +++--- .../windows/EditorObjectiveOptions.cpp | 4 +-- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 6 ++-- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/NewCampaign.cpp | 6 ++-- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 22 ++++++------ src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 4 +-- src/openrct2-ui/windows/TrackDesignPlace.cpp | 6 ++-- src/openrct2/actions/GameActionCompat.cpp | 4 +-- src/openrct2/actions/LandSetHeightAction.cpp | 2 +- .../actions/LargeSceneryPlaceAction.cpp | 2 +- src/openrct2/actions/ParkMarketingAction.cpp | 2 +- src/openrct2/actions/RideCreateAction.cpp | 4 +-- src/openrct2/actions/RideDemolishAction.cpp | 2 +- src/openrct2/actions/RideDemolishAction.h | 2 +- .../actions/RideEntranceExitPlaceAction.cpp | 2 +- .../actions/RideEntranceExitPlaceAction.h | 2 +- .../actions/RideEntranceExitRemoveAction.cpp | 4 +-- .../actions/RideEntranceExitRemoveAction.h | 2 +- .../actions/RideSetAppearanceAction.cpp | 2 +- .../actions/RideSetAppearanceAction.h | 2 +- src/openrct2/actions/RideSetNameAction.cpp | 2 +- src/openrct2/actions/RideSetNameAction.h | 2 +- src/openrct2/actions/RideSetPriceAction.cpp | 2 +- src/openrct2/actions/RideSetPriceAction.h | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetSettingAction.h | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.h | 2 +- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/actions/RideSetVehicleAction.h | 2 +- src/openrct2/actions/SignSetNameAction.cpp | 2 +- src/openrct2/actions/TrackDesignAction.cpp | 8 ++--- src/openrct2/actions/TrackRemoveAction.cpp | 4 +-- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/entity/Guest.cpp | 18 +++++----- src/openrct2/entity/Guest.h | 22 ++++++------ src/openrct2/entity/Peep.cpp | 2 +- src/openrct2/entity/Peep.h | 4 +-- src/openrct2/entity/Staff.cpp | 2 +- src/openrct2/entity/Staff.h | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 14 ++++---- src/openrct2/interface/Window.h | 6 ++-- src/openrct2/interface/Window_internal.h | 2 +- src/openrct2/localisation/Formatter.h | 4 +-- src/openrct2/management/Marketing.cpp | 2 +- src/openrct2/management/Marketing.h | 4 +-- src/openrct2/management/NewsItem.cpp | 2 +- src/openrct2/network/NetworkTypes.h | 2 +- src/openrct2/park/ParkFile.cpp | 36 +++++++++---------- src/openrct2/peep/GuestPathfinding.cpp | 14 ++++---- src/openrct2/peep/GuestPathfinding.h | 2 +- src/openrct2/peep/RideUseSystem.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 12 +++---- src/openrct2/rct12/RCT12.cpp | 4 +-- src/openrct2/rct12/RCT12.h | 8 ++--- src/openrct2/rct2/S6Importer.cpp | 10 +++--- src/openrct2/ride/Ride.cpp | 34 +++++++++--------- src/openrct2/ride/Ride.h | 26 +++++++------- src/openrct2/ride/RideAudio.cpp | 4 +-- src/openrct2/ride/RideConstruction.cpp | 12 +++---- src/openrct2/ride/RideConstruction.h | 6 ++-- src/openrct2/ride/RideRatings.cpp | 8 ++--- src/openrct2/ride/RideRatings.h | 2 +- src/openrct2/ride/RideTypes.h | 4 +-- src/openrct2/ride/Track.cpp | 10 +++--- src/openrct2/ride/Track.h | 6 ++-- src/openrct2/ride/TrackDesign.cpp | 6 ++-- src/openrct2/ride/TrackDesign.h | 6 ++-- src/openrct2/ride/TrackDesignSave.cpp | 12 +++---- src/openrct2/ride/TrackPaint.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 8 ++--- src/openrct2/ride/Vehicle.h | 2 +- src/openrct2/scripting/ScriptEngine.cpp | 2 +- .../scripting/bindings/entity/ScVehicle.cpp | 2 +- .../scripting/bindings/ride/ScRide.cpp | 2 +- .../scripting/bindings/ride/ScRide.hpp | 4 +-- .../scripting/bindings/ride/ScRideStation.cpp | 2 +- .../scripting/bindings/ride/ScRideStation.hpp | 4 +-- .../scripting/bindings/world/ScMap.cpp | 2 +- .../bindings/world/ScTileElement.cpp | 6 ++-- src/openrct2/windows/_legacy.cpp | 6 ++-- src/openrct2/world/Banner.cpp | 12 +++---- src/openrct2/world/Banner.h | 6 ++-- src/openrct2/world/Entrance.cpp | 10 +++--- src/openrct2/world/Footpath.cpp | 20 +++++------ src/openrct2/world/Footpath.h | 4 +-- src/openrct2/world/Map.cpp | 6 ++-- src/openrct2/world/Map.h | 6 ++-- src/openrct2/world/TileElement.cpp | 2 +- src/openrct2/world/TileElement.h | 20 +++++------ test/tests/Pathfinding.cpp | 2 +- 95 files changed, 287 insertions(+), 287 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 809f02ae25..254767854d 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -183,9 +183,9 @@ public: case WD_BANNER: return WindowBannerOpen(id); case WD_DEMOLISH_RIDE: - return WindowRideDemolishPromptOpen(get_ride(static_cast(id))); + return WindowRideDemolishPromptOpen(get_ride(static_cast(id))); case WD_REFURBISH_RIDE: - return WindowRideRefurbishPromptOpen(get_ride(static_cast(id))); + return WindowRideRefurbishPromptOpen(get_ride(static_cast(id))); case WD_NEW_CAMPAIGN: return WindowNewCampaignOpen(id); case WD_SIGN: @@ -263,7 +263,7 @@ public: } case WC_RIDE: { - const auto rideId = static_cast(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); + const auto rideId = static_cast(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); auto ride = get_ride(rideId); return ride == nullptr ? nullptr : WindowRideMainOpen(ride); } @@ -365,13 +365,13 @@ public: if (w == nullptr || w->number != rideIndex) { window_close_construction_windows(); - _currentRideIndex = static_cast(rideIndex); + _currentRideIndex = static_cast(rideIndex); OpenWindow(WC_RIDE_CONSTRUCTION); } else { ride_construction_invalidate_current_track(); - _currentRideIndex = static_cast(rideIndex); + _currentRideIndex = static_cast(rideIndex); } break; } diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index aae0c1a661..2f32668579 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -1006,7 +1006,7 @@ static void WindowEditorObjectiveOptionsRidesScrollmousedown( if (i < 0 || i >= w->no_list_items) return; - const auto rideId = static_cast(w->list_item_positions[i]); + const auto rideId = static_cast(w->list_item_positions[i]); auto ride = get_ride(rideId); if (ride != nullptr) { @@ -1100,7 +1100,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_draw } // Checkbox mark - const auto rideId = static_cast(w->list_item_positions[i]); + const auto rideId = static_cast(w->list_item_positions[i]); auto ride = get_ride(rideId); if (ride != nullptr) { diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 5764c09940..7baa68b471 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1638,7 +1638,7 @@ void WindowGuestRidesScrollPaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t stringId = STR_WINDOW_COLOUR_2_STRINGID; } - const auto rideId = static_cast(w->list_item_positions[list_index]); + const auto rideId = static_cast(w->list_item_positions[list_index]); auto ride = get_ride(rideId); if (ride != nullptr) { diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index e97dcbb35e..0b458267f3 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -185,7 +185,7 @@ public: { case GuestListFilterType::GuestsOnRide: { - auto guestRide = get_ride(static_cast(index)); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add( @@ -201,7 +201,7 @@ public: } case GuestListFilterType::GuestsInQueue: { - auto guestRide = get_ride(static_cast(index)); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add(STR_QUEUING_FOR); @@ -216,7 +216,7 @@ public: } case GuestListFilterType::GuestsThinkingAboutRide: { - auto guestRide = get_ride(static_cast(index)); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add(STR_NONE); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 91456031e3..51b1de3697 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -346,7 +346,7 @@ private: if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) return; - ride_id_t rideIndex = gRideEntranceExitPlaceRideIndex; + RideId rideIndex = gRideEntranceExitPlaceRideIndex; auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( entranceOrExitCoords, direction_reverse(entranceOrExitCoords.direction), rideIndex, diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index da035f6443..83942d2676 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -60,10 +60,10 @@ static rct_widget window_new_campaign_widgets[] = { class NewCampaignWindow final : public Window { private: - std::vector RideList; + std::vector RideList; std::vector ShopItems; - static bool RideValueCompare(const ride_id_t& a, const ride_id_t& b) + static bool RideValueCompare(const RideId& a, const RideId& b) { auto valueA = 0; auto rideA = get_ride(a); @@ -78,7 +78,7 @@ private: return (valueB - valueA) < 0; } - static int32_t RideNameCompare(const ride_id_t& a, const ride_id_t& b) + static int32_t RideNameCompare(const RideId& a, const RideId& b) { std::string rideAName = ""; auto rideA = get_ride(a); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 73410ab600..be2efacdac 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1559,7 +1559,7 @@ static void WindowRideAnchorBorderWidgets(rct_window* w) static std::optional GetStationIndexFromViewSelection(const rct_window& w) { - const auto* ride = get_ride(static_cast(w.number)); + const auto* ride = get_ride(static_cast(w.number)); if (ride == nullptr) return std::nullopt; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 0f83b00200..f9a063299a 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -190,10 +190,10 @@ static void WindowRideConstructionEntranceClick(rct_window* w); static void WindowRideConstructionExitClick(rct_window* w); static void WindowRideConstructionDrawTrackPiece( - rct_window* w, rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown, + rct_window* w, rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown, int32_t width, int32_t height); static void Sub6CbcE2( - rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, + rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, const CoordsXY& originCoords, int32_t originZ); static void WindowRideConstructionUpdateMapSelection(); static void WindowRideConstructionUpdatePossibleRideConfigurations(); @@ -226,7 +226,7 @@ static int32_t RideGetAlternativeType(Ride* ride) } /* move to ride.c */ -static void CloseRideWindowForConstruction(ride_id_t rideId) +static void CloseRideWindowForConstruction(RideId rideId) { rct_window* w = window_find_by_number(WC_RIDE, EnumValue(rideId)); if (w != nullptr && w->page == 1) @@ -239,7 +239,7 @@ static void CloseRideWindowForConstruction(ride_id_t rideId) */ rct_window* WindowRideConstructionOpen() { - ride_id_t rideIndex = _currentRideIndex; + RideId rideIndex = _currentRideIndex; CloseRideWindowForConstruction(rideIndex); auto ride = get_ride(rideIndex); @@ -1507,7 +1507,7 @@ static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, */ static void WindowRideConstructionConstruct(rct_window* w) { - ride_id_t rideIndex; + RideId rideIndex; int32_t trackType, trackDirection, liftHillAndAlternativeState, properties; CoordsXYZ trackPos{}; @@ -2054,7 +2054,7 @@ static void WindowRideConstructionPaint(rct_window* w, rct_drawpixelinfo* dpi) if (widget->type == WindowWidgetType::Empty) return; - ride_id_t rideIndex; + RideId rideIndex; int32_t trackType, trackDirection, liftHillAndInvertedState; if (window_ride_construction_update_state( &trackType, &trackDirection, &rideIndex, &liftHillAndInvertedState, nullptr, nullptr)) @@ -2085,7 +2085,7 @@ static void WindowRideConstructionPaint(rct_window* w, rct_drawpixelinfo* dpi) } static void WindowRideConstructionDrawTrackPiece( - rct_window* w, rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, + rct_window* w, rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, int32_t width, int32_t height) { auto ride = get_ride(rideIndex); @@ -2133,7 +2133,7 @@ static TileElement* _backupTileElementArrays[5]; * dh: trackType */ static void Sub6CbcE2( - rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, + rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, const CoordsXY& originCoords, int32_t originZ) { paint_session* session = PaintSessionAlloc(dpi, 0); @@ -2273,7 +2273,7 @@ void WindowRideConstructionUpdateEnabledTrackPieces() */ void UpdateGhostTrackAndArrow() { - ride_id_t rideIndex; + RideId rideIndex; int32_t direction, type, liftHillAndAlternativeState; CoordsXYZ trackPos{}; @@ -3192,7 +3192,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) gMapSelectionTiles.clear(); gMapSelectionTiles.push_back(*mapCoords); - ride_id_t rideIndex; + RideId rideIndex; int32_t trackType, trackDirection, liftHillAndAlternativeState; if (window_ride_construction_update_state( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) @@ -3412,7 +3412,7 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) { const CursorState* state = context_get_cursor_state(); - ride_id_t rideIndex; + RideId rideIndex; int32_t trackType, trackDirection, liftHillAndAlternativeState, z, properties, highestZ; rct_window* w; diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 0e949c4671..948684517e 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -149,7 +149,7 @@ class RideListWindow final : public Window private: bool _quickDemolishMode = false; int32_t _windowRideListInformationType = INFORMATION_TYPE_STATUS; - std::vector _rideList; + std::vector _rideList; public: void OnOpen() override diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index f00a6038ef..79a86784c6 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1916,7 +1916,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) case TileElementType::Track: { auto trackElement = tileElement->AsTrack(); - ride_id_t rideId = trackElement->GetRideIndex(); + RideId rideId = trackElement->GetRideIndex(); auto ride = get_ride(rideId); // Ride ID @@ -2091,7 +2091,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) { // Ride ID ft = Formatter(); - ft.Add(tileElement->AsEntrance()->GetRideIndex()); + ft.Add(tileElement->AsEntrance()->GetRideIndex()); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, { w->colours[1] }); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index f2e7e0fbc1..a7c73439f9 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -97,7 +97,7 @@ static rct_window_event_list window_track_place_events([](auto& events) static std::vector _window_track_place_mini_preview; static CoordsXY _windowTrackPlaceLast; -static ride_id_t _window_track_place_ride_index; +static RideId _window_track_place_ride_index; static bool _window_track_place_last_was_valid; static CoordsXYZ _windowTrackPlaceLastValid; static money32 _window_track_place_last_cost; @@ -292,7 +292,7 @@ static void WindowTrackPlaceToolupdate(rct_window* w, rct_widgetindex widgetInde tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - _window_track_place_ride_index = result->GetData(); + _window_track_place_ride_index = result->GetData(); _windowTrackPlaceLastValid = trackLoc; _window_track_place_last_was_valid = true; } @@ -339,7 +339,7 @@ static void WindowTrackPlaceTooldown(rct_window* w, rct_widgetindex widgetIndex, tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - const auto rideId = result->GetData(); + const auto rideId = result->GetData(); auto ride = get_ride(rideId); if (ride != nullptr) { diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 6fa88b3f59..2ccb75cad0 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -69,7 +69,7 @@ void ride_construct_new(RideSelection listItem) gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - const auto rideIndex = result->GetData(); + const auto rideIndex = result->GetData(); auto ride = get_ride(rideIndex); ride_construct(ride); }); @@ -118,7 +118,7 @@ void guest_set_name(uint16_t spriteIndex, const char* name) #pragma endregion #pragma region MazeSetTrack -money32 maze_set_track(const CoordsXYZD& loc, uint8_t flags, bool initialPlacement, ride_id_t rideIndex, uint8_t mode) +money32 maze_set_track(const CoordsXYZD& loc, uint8_t flags, bool initialPlacement, RideId rideIndex, uint8_t mode) { auto gameAction = MazeSetTrackAction(loc, initialPlacement, rideIndex, mode); gameAction.SetFlags(flags); diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index dd473f3764..ddaabf6243 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -272,7 +272,7 @@ rct_string_id LandSetHeightAction::CheckRideSupports() const { for (auto* trackElement : TileElementsView(_coords)) { - ride_id_t rideIndex = trackElement->GetRideIndex(); + RideId rideIndex = trackElement->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr) diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 828bafac5a..abddc9176a 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -230,7 +230,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const banner->type = 0; banner->position = TileCoordsXY(_loc); - ride_id_t rideIndex = banner_get_closest_ride_index({ _loc, maxHeight }); + RideId rideIndex = banner_get_closest_ride_index({ _loc, maxHeight }); if (rideIndex != RIDE_ID_NULL) { banner->ride_index = rideIndex; diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index 69e58b259d..57e81c936b 100644 --- a/src/openrct2/actions/ParkMarketingAction.cpp +++ b/src/openrct2/actions/ParkMarketingAction.cpp @@ -70,7 +70,7 @@ GameActions::Result ParkMarketingAction::Execute() const campaign.Flags = MarketingCampaignFlags::FIRST_WEEK; if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) { - campaign.RideId = static_cast(_item); + campaign.RideId = static_cast(_item); } else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) { diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 5c27e7502f..368bfa79a5 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -110,7 +110,7 @@ GameActions::Result RideCreateAction::Query() const } auto res = GameActions::Result(); - res.SetData(ride_id_t{ rideIndex }); + res.SetData(RideId{ rideIndex }); return res; } @@ -310,7 +310,7 @@ GameActions::Result RideCreateAction::Execute() const window_invalidate_by_class(WC_RIDE_LIST); res.Expenditure = ExpenditureType::RideConstruction; - res.SetData(ride_id_t{ rideIndex }); + res.SetData(RideId{ rideIndex }); return res; } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index b123814d14..f12cceae80 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -31,7 +31,7 @@ using namespace OpenRCT2; -RideDemolishAction::RideDemolishAction(ride_id_t rideIndex, uint8_t modifyType) +RideDemolishAction::RideDemolishAction(RideId rideIndex, uint8_t modifyType) : _rideIndex(rideIndex) , _modifyType(modifyType) { diff --git a/src/openrct2/actions/RideDemolishAction.h b/src/openrct2/actions/RideDemolishAction.h index d3a09b44ee..9deb0c3f39 100644 --- a/src/openrct2/actions/RideDemolishAction.h +++ b/src/openrct2/actions/RideDemolishAction.h @@ -19,7 +19,7 @@ private: public: RideDemolishAction() = default; - RideDemolishAction(ride_id_t rideIndex, uint8_t modifyType); + RideDemolishAction(RideId rideIndex, uint8_t modifyType); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index ecb6390f8e..7ac999eac9 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -17,7 +17,7 @@ #include "../world/MapAnimation.h" RideEntranceExitPlaceAction::RideEntranceExitPlaceAction( - const CoordsXY& loc, Direction direction, ride_id_t rideIndex, StationIndex stationNum, bool isExit) + const CoordsXY& loc, Direction direction, RideId rideIndex, StationIndex stationNum, bool isExit) : _loc(loc) , _direction(direction) , _rideIndex(rideIndex) diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.h b/src/openrct2/actions/RideEntranceExitPlaceAction.h index 58234cc2f9..2cca8c762f 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.h +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.h @@ -24,7 +24,7 @@ private: public: RideEntranceExitPlaceAction() = default; RideEntranceExitPlaceAction( - const CoordsXY& loc, Direction direction, ride_id_t rideIndex, StationIndex stationNum, bool isExit); + const CoordsXY& loc, Direction direction, RideId rideIndex, StationIndex stationNum, bool isExit); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index 186cd9d90d..9ee4c52611 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -17,7 +17,7 @@ using namespace OpenRCT2; RideEntranceExitRemoveAction::RideEntranceExitRemoveAction( - const CoordsXY& loc, ride_id_t rideIndex, StationIndex stationNum, bool isExit) + const CoordsXY& loc, RideId rideIndex, StationIndex stationNum, bool isExit) : _loc(loc) , _rideIndex(rideIndex) , _stationNum(stationNum) @@ -46,7 +46,7 @@ void RideEntranceExitRemoveAction::Serialise(DataSerialiser& stream) } static TileElement* FindEntranceElement( - const CoordsXY& loc, ride_id_t rideIndex, int32_t stationNum, int32_t entranceType, uint32_t flags) + const CoordsXY& loc, RideId rideIndex, int32_t stationNum, int32_t entranceType, uint32_t flags) { const bool isGhost = flags & GAME_COMMAND_FLAG_GHOST; for (auto* entranceElement : TileElementsView(loc)) diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.h b/src/openrct2/actions/RideEntranceExitRemoveAction.h index ce06d0d1c6..455aca88c8 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.h +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.h @@ -21,7 +21,7 @@ private: public: RideEntranceExitRemoveAction() = default; - RideEntranceExitRemoveAction(const CoordsXY& loc, ride_id_t rideIndex, StationIndex stationNum, bool isExit); + RideEntranceExitRemoveAction(const CoordsXY& loc, RideId rideIndex, StationIndex stationNum, bool isExit); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 06cb0da04a..862c6a0350 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -22,7 +22,7 @@ #include "../world/Park.h" RideSetAppearanceAction::RideSetAppearanceAction( - ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index) + RideId rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index) : _rideIndex(rideIndex) , _type(type) , _value(value) diff --git a/src/openrct2/actions/RideSetAppearanceAction.h b/src/openrct2/actions/RideSetAppearanceAction.h index 10560405dc..42dd9a695a 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.h +++ b/src/openrct2/actions/RideSetAppearanceAction.h @@ -34,7 +34,7 @@ private: public: RideSetAppearanceAction() = default; - RideSetAppearanceAction(ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index); + RideSetAppearanceAction(RideId rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 8a3c916ef6..7f4cb158f0 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -21,7 +21,7 @@ #include "../ui/WindowManager.h" #include "../world/Park.h" -RideSetNameAction::RideSetNameAction(ride_id_t rideIndex, const std::string& name) +RideSetNameAction::RideSetNameAction(RideId rideIndex, const std::string& name) : _rideIndex(rideIndex) , _name(name) { diff --git a/src/openrct2/actions/RideSetNameAction.h b/src/openrct2/actions/RideSetNameAction.h index 869a04ad26..d32a4dfa4f 100644 --- a/src/openrct2/actions/RideSetNameAction.h +++ b/src/openrct2/actions/RideSetNameAction.h @@ -19,7 +19,7 @@ private: public: RideSetNameAction() = default; - RideSetNameAction(ride_id_t rideIndex, const std::string& name); + RideSetNameAction(RideId rideIndex, const std::string& name); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index ad73c2a3ff..4bcf851c64 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -21,7 +21,7 @@ #include "../ride/ShopItem.h" #include "../world/Park.h" -RideSetPriceAction::RideSetPriceAction(ride_id_t rideIndex, money16 price, bool primaryPrice) +RideSetPriceAction::RideSetPriceAction(RideId rideIndex, money16 price, bool primaryPrice) : _rideIndex(rideIndex) , _price(price) , _primaryPrice(primaryPrice) diff --git a/src/openrct2/actions/RideSetPriceAction.h b/src/openrct2/actions/RideSetPriceAction.h index 6e24bd54e4..176f53527b 100644 --- a/src/openrct2/actions/RideSetPriceAction.h +++ b/src/openrct2/actions/RideSetPriceAction.h @@ -20,7 +20,7 @@ private: public: RideSetPriceAction() = default; - RideSetPriceAction(ride_id_t rideIndex, money16 price, bool primaryPrice); + RideSetPriceAction(RideId rideIndex, money16 price, bool primaryPrice); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 07561aad5d..fba3a41115 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -14,7 +14,7 @@ #include "../ride/Ride.h" #include "../ride/RideData.h" -RideSetSettingAction::RideSetSettingAction(ride_id_t rideIndex, RideSetSetting setting, uint8_t value) +RideSetSettingAction::RideSetSettingAction(RideId rideIndex, RideSetSetting setting, uint8_t value) : _rideIndex(rideIndex) , _setting(setting) , _value(value) diff --git a/src/openrct2/actions/RideSetSettingAction.h b/src/openrct2/actions/RideSetSettingAction.h index b4d0ce48a1..30c736e1af 100644 --- a/src/openrct2/actions/RideSetSettingAction.h +++ b/src/openrct2/actions/RideSetSettingAction.h @@ -35,7 +35,7 @@ private: public: RideSetSettingAction() = default; - RideSetSettingAction(ride_id_t rideIndex, RideSetSetting setting, uint8_t value); + RideSetSettingAction(RideId rideIndex, RideSetSetting setting, uint8_t value); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index f06e2eb590..a2bf6ab907 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -29,7 +29,7 @@ static rct_string_id _StatusErrorTitles[] = { STR_CANT_SIMULATE, }; -RideSetStatusAction::RideSetStatusAction(ride_id_t rideIndex, RideStatus status) +RideSetStatusAction::RideSetStatusAction(RideId rideIndex, RideStatus status) : _rideIndex(rideIndex) , _status(status) { diff --git a/src/openrct2/actions/RideSetStatusAction.h b/src/openrct2/actions/RideSetStatusAction.h index 393391992b..9090310115 100644 --- a/src/openrct2/actions/RideSetStatusAction.h +++ b/src/openrct2/actions/RideSetStatusAction.h @@ -19,7 +19,7 @@ private: public: RideSetStatusAction() = default; - RideSetStatusAction(ride_id_t rideIndex, RideStatus status); + RideSetStatusAction(RideId rideIndex, RideStatus status); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 209f4eb3ee..54a6f3c7cd 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -31,7 +31,7 @@ constexpr static rct_string_id SetVehicleTypeErrorTitle[] = { STR_RIDE_SET_VEHICLE_TYPE_FAIL, }; -RideSetVehicleAction::RideSetVehicleAction(ride_id_t rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour) +RideSetVehicleAction::RideSetVehicleAction(RideId rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour) : _rideIndex(rideIndex) , _type(type) , _value(value) diff --git a/src/openrct2/actions/RideSetVehicleAction.h b/src/openrct2/actions/RideSetVehicleAction.h index f96a32c886..4b88c7bea7 100644 --- a/src/openrct2/actions/RideSetVehicleAction.h +++ b/src/openrct2/actions/RideSetVehicleAction.h @@ -29,7 +29,7 @@ private: public: RideSetVehicleAction() = default; - RideSetVehicleAction(ride_id_t rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour = 0); + RideSetVehicleAction(RideId rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour = 0); void AcceptParameters(GameActionParameterVisitor& visitor) override; diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index 6534391923..0763dc5d1e 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -72,7 +72,7 @@ GameActions::Result SignSetNameAction::Execute() const else { // If empty name take closest ride name. - ride_id_t rideIndex = banner_get_closest_ride_index({ banner->position.ToCoordsXY(), 16 }); + RideId rideIndex = banner_get_closest_ride_index({ banner->position.ToCoordsXY(), 16 }); if (rideIndex == RIDE_ID_NULL) { banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index a6cd6017eb..33e5b234b9 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -84,7 +84,7 @@ GameActions::Result TrackDesignAction::Query() const return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } - const auto rideIndex = r.GetData(); + const auto rideIndex = r.GetData(); auto ride = get_ride(rideIndex); if (ride == nullptr) { @@ -122,7 +122,7 @@ GameActions::Result TrackDesignAction::Query() const } res.Cost = queryRes.Cost; - res.SetData(ride_id_t{ RIDE_ID_NULL }); + res.SetData(RideId{ RIDE_ID_NULL }); return res; } @@ -156,7 +156,7 @@ GameActions::Result TrackDesignAction::Execute() const return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } - const auto rideIndex = r.GetData(); + const auto rideIndex = r.GetData(); auto ride = get_ride(rideIndex); if (ride == nullptr) { @@ -273,7 +273,7 @@ GameActions::Result TrackDesignAction::Execute() const r = GameActions::ExecuteNested(&gameAction); } res.Cost = execRes.Cost; - res.SetData(ride_id_t{ ride->id }); + res.SetData(RideId{ ride->id }); return res; } diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 44c2430eb2..916b4ee131 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -121,7 +121,7 @@ GameActions::Result TrackRemoveAction::Query() const STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION); } - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); const auto trackType = tileElement->AsTrack()->GetTrackType(); auto ride = get_ride(rideIndex); @@ -308,7 +308,7 @@ GameActions::Result TrackRemoveAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); const auto trackType = tileElement->AsTrack()->GetTrackType(); bool isLiftHill = tileElement->AsTrack()->HasChain(); diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index e5af0332c4..d5d27bb3d5 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -347,7 +347,7 @@ GameActions::Result WallPlaceAction::Execute() const banner->type = 0; // Banner must be deleted after this point in an early return banner->position = TileCoordsXY(_loc); - ride_id_t rideIndex = banner_get_closest_ride_index(targetLoc); + RideId rideIndex = banner_get_closest_ride_index(targetLoc); if (rideIndex != RIDE_ID_NULL) { banner->ride_index = rideIndex; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 6c265a488d..91d09e90d3 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -439,7 +439,7 @@ static void peep_decide_whether_to_leave_park(Guest* peep); static void peep_leave_park(Guest* peep); static void peep_head_for_nearest_ride_type(Guest* peep, int32_t rideType); static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeFlags); -bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement); +bool loc_690FD0(Peep* peep, RideId* rideToView, uint8_t* rideSeatToView, TileElement* tileElement); template<> bool EntityBase::Is() const { @@ -3155,7 +3155,7 @@ template static void peep_head_for_nearest_ride(Guest* peep, bool co } // Filter the considered rides - ride_id_t potentialRides[OpenRCT2::Limits::MaxRidesInPark]; + RideId potentialRides[OpenRCT2::Limits::MaxRidesInPark]; size_t numPotentialRides = 0; for (auto& ride : GetRideManager()) { @@ -3271,7 +3271,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type) * * rct2: 0x0069AEB7 */ -static bool peep_should_use_cash_machine(Guest* peep, ride_id_t rideIndex) +static bool peep_should_use_cash_machine(Guest* peep, RideId rideIndex) { if (gParkFlags & PARK_FLAGS_NO_MONEY) return false; @@ -5178,7 +5178,7 @@ void Guest::UpdateRide() } static void peep_update_walking_break_scenery(Guest* peep); -static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideToView, uint8_t* rideSeatToView); +static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToView, uint8_t* rideSeatToView); /** * @@ -5394,7 +5394,7 @@ void Guest::UpdateWalking() for (; !(edges & (1 << chosen_edge));) chosen_edge = (chosen_edge + 1) & 3; - ride_id_t ride_to_view; + RideId ride_to_view; uint8_t ride_seat_to_view; if (!peep_find_ride_to_look_at(this, chosen_edge, &ride_to_view, &ride_seat_to_view)) return; @@ -6197,7 +6197,7 @@ static bool peep_should_watch_ride(TileElement* tileElement) return true; } -bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement) +bool loc_690FD0(Peep* peep, RideId* rideToView, uint8_t* rideSeatToView, TileElement* tileElement) { auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); if (ride == nullptr) @@ -6244,7 +6244,7 @@ bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, Tile * @param[out] rideSeatToView (ch) * @return !CF */ -static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideToView, uint8_t* rideSeatToView) +static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToView, uint8_t* rideSeatToView) { TileElement* tileElement; @@ -6822,7 +6822,7 @@ void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) InsertNewThought(thought_type, static_cast(shopItem)); } -void Guest::InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId) +void Guest::InsertNewThought(PeepThoughtType thought_type, RideId rideId) { InsertNewThought(thought_type, static_cast(rideId)); } @@ -7399,7 +7399,7 @@ static bool IsThoughtShopItemRelated(const PeepThoughtType type) return false; } -void Guest::RemoveRideFromMemory(ride_id_t rideId) +void Guest::RemoveRideFromMemory(RideId rideId) { if (State == PeepState::Watching) { diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index c5cba093fd..dcd7ea513e 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -191,7 +191,7 @@ struct PeepThought PeepThoughtType type; union { - ride_id_t rideId; + RideId rideId; ShopItem shopItem; uint16_t item; }; @@ -263,7 +263,7 @@ public: uint8_t GuestNumRides; uint16_t GuestNextInQueue; int32_t ParkEntryTime; - ride_id_t GuestHeadingToRideId; + RideId GuestHeadingToRideId; uint8_t GuestIsLostCountdown; uint8_t GuestTimeOnRide; money16 PaidToEnter; @@ -285,13 +285,13 @@ public: uint16_t TimeInQueue; money32 CashInPocket; money32 CashSpent; - ride_id_t Photo1RideRef; - ride_id_t Photo2RideRef; - ride_id_t Photo3RideRef; - ride_id_t Photo4RideRef; + RideId Photo1RideRef; + RideId Photo2RideRef; + RideId Photo3RideRef; + RideId Photo4RideRef; int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance - ride_id_t PreviousRide; + RideId PreviousRide; uint16_t PreviousRideTimeOut; std::array Thoughts; // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc @@ -305,7 +305,7 @@ public: uint8_t VoucherType; union { - ride_id_t VoucherRideId; + RideId VoucherRideId; ShopItemIndex VoucherShopItem; }; uint8_t SurroundingsThoughtTimeout; @@ -315,7 +315,7 @@ public: uint8_t BalloonColour; uint8_t UmbrellaColour; uint8_t HatColour; - ride_id_t FavouriteRide; + RideId FavouriteRide; uint8_t FavouriteRideRating; uint64_t ItemFlags; @@ -358,7 +358,7 @@ public: void UpdateEasterEggInteractions(); void InsertNewThought(PeepThoughtType thought_type); void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); - void InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId); + void InsertNewThought(PeepThoughtType thought_type, RideId rideId); void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); static Guest* Generate(const CoordsXYZ& coords); bool UpdateQueuePosition(PeepActionType previous_action); @@ -374,7 +374,7 @@ public: // Removes the ride from the guests memory, this includes // the history, thoughts, etc. - void RemoveRideFromMemory(ride_id_t rideId); + void RemoveRideFromMemory(RideId rideId); private: void UpdateRide(); diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index b1f052babe..eb1d23fe93 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -2188,7 +2188,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords) */ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords) { - ride_id_t rideIndex = coords.element->AsTrack()->GetRideIndex(); + RideId rideIndex = coords.element->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) return false; diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index 953555936a..97087a0182 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -332,7 +332,7 @@ struct Peep : EntityBase uint8_t EnergyTarget; uint8_t Mass; uint8_t WindowInvalidateFlags; - ride_id_t CurrentRide; + RideId CurrentRide; StationIndex CurrentRideStation; uint8_t CurrentTrain; union @@ -364,7 +364,7 @@ struct Peep : EntityBase uint8_t MazeLastEdge; Direction PeepDirection; // Direction ? }; - ride_id_t InteractionRideIndex; + RideId InteractionRideIndex; uint32_t Id; uint8_t PathCheckOptimisation; // see peep.checkForPath TileCoordsXYZD PathfindGoal; diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 1b195b0a55..b3e5a93e82 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -2599,7 +2599,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride) /** * rct2: 0x6B7588 */ -void Staff::UpdateRideInspected(ride_id_t rideIndex) +void Staff::UpdateRideInspected(RideId rideIndex) { auto ride = get_ride(rideIndex); if (ride != nullptr) diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index ee9a72b088..dff443a1aa 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -94,7 +94,7 @@ private: bool UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride); bool UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* ride); bool UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride); - void UpdateRideInspected(ride_id_t rideIndex); + void UpdateRideInspected(RideId rideIndex); void UpdateHeadingToInspect(); bool DoHandymanPathFinding(); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index bb18e60915..0db4bde6d5 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -196,7 +196,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - int32_t res = set_operating_setting(static_cast(ride_index), RideSetSetting::RideType, type); + int32_t res = set_operating_setting(static_cast(ride_index), RideSetSetting::RideType, type); if (res == MONEY32_UNDEFINED) { if (!gCheatsAllowArbitraryRideTypeChanges) @@ -226,7 +226,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(static_cast(ride_index)); + auto ride = get_ride(static_cast(ride_index)); if (mode >= static_cast(RideMode::Count)) { console.WriteFormatLine("Invalid ride mode."); @@ -258,7 +258,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(static_cast(ride_index)); + auto ride = get_ride(static_cast(ride_index)); if (mass <= 0) { console.WriteFormatLine("Friction value must be strictly positive"); @@ -296,7 +296,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(static_cast(ride_index)); + auto ride = get_ride(static_cast(ride_index)); if (excitement <= 0) { console.WriteFormatLine("Excitement value must be strictly positive"); @@ -327,7 +327,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(static_cast(ride_index)); + auto ride = get_ride(static_cast(ride_index)); if (intensity <= 0) { console.WriteFormatLine("Intensity value must be strictly positive"); @@ -358,7 +358,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(static_cast(ride_index)); + auto ride = get_ride(static_cast(ride_index)); if (nausea <= 0) { console.WriteFormatLine("Nausea value must be strictly positive"); @@ -428,7 +428,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto rideSetPrice = RideSetPriceAction(static_cast(rideId), price, true); + auto rideSetPrice = RideSetPriceAction(static_cast(rideId), price, true); GameActions::Execute(&rideSetPrice); } } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 3596864749..cb01175199 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -269,7 +269,7 @@ struct campaign_variables int16_t no_weeks; // 0x482 union { - ride_id_t RideId; // 0x484 + RideId RideId; // 0x484 ObjectEntryIndex ShopItemId; // 0x484 }; uint32_t pad_486; @@ -858,10 +858,10 @@ void window_follow_sprite(rct_window* w, size_t spriteIndex); void window_unfollow_sprite(rct_window* w); bool window_ride_construction_update_state( - int32_t* trackType, int32_t* trackDirection, ride_id_t* rideIndex, int32_t* _liftHillAndAlternativeState, + int32_t* trackType, int32_t* trackDirection, RideId* rideIndex, int32_t* _liftHillAndAlternativeState, CoordsXYZ* trackPos, int32_t* properties); money32 place_provisional_track_piece( - ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, + RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, const CoordsXYZ& trackPos); extern RideConstructionState _rideConstructionState2; diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 7ed0b20d60..1e41e1b786 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -48,7 +48,7 @@ struct rct_window union { rct_windownumber number{}; - ride_id_t rideId; + RideId rideId; }; uint16_t flags{}; rct_scroll scrolls[3]; diff --git a/src/openrct2/localisation/Formatter.h b/src/openrct2/localisation/Formatter.h index a7203f2f00..1a9e35bcb5 100644 --- a/src/openrct2/localisation/Formatter.h +++ b/src/openrct2/localisation/Formatter.h @@ -17,7 +17,7 @@ #include extern thread_local uint8_t gCommonFormatArgs[80]; -enum class ride_id_t : uint16_t; +enum class RideId : uint16_t; class Formatter { @@ -91,7 +91,7 @@ public: std::is_same_v::type, int32_t> || std::is_same_v::type, money32> || std::is_same_v::type, money64> || - std::is_same_v::type, ride_id_t> || + std::is_same_v::type, RideId> || std::is_same_v::type, rct_string_id> || std::is_same_v::type, uint16_t> || std::is_same_v::type, uint32_t> || diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index adb8a0dd11..ded60a90ef 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -243,7 +243,7 @@ void marketing_new_campaign(const MarketingCampaign& campaign) } } -void MarketingCancelCampaignsForRide(const ride_id_t rideId) +void MarketingCancelCampaignsForRide(const RideId rideId) { auto isCampaignForRideFn = [&rideId](MarketingCampaign& campaign) { if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) diff --git a/src/openrct2/management/Marketing.h b/src/openrct2/management/Marketing.h index aa110c1d0e..0ea501010f 100644 --- a/src/openrct2/management/Marketing.h +++ b/src/openrct2/management/Marketing.h @@ -50,7 +50,7 @@ struct MarketingCampaign uint8_t Flags{}; union { - ride_id_t RideId{}; + RideId RideId{}; ShopItemIndex ShopItemType; }; }; @@ -69,4 +69,4 @@ void marketing_set_guest_campaign(Guest* peep, int32_t campaign); bool marketing_is_campaign_type_applicable(int32_t campaignType); MarketingCampaign* marketing_get_campaign(int32_t campaignType); void marketing_new_campaign(const MarketingCampaign& campaign); -void MarketingCancelCampaignsForRide(const ride_id_t rideId); +void MarketingCancelCampaignsForRide(const RideId rideId); diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 10d9544e0f..a2864fd157 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -213,7 +213,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s { case News::ItemType::Ride: { - Ride* ride = get_ride(static_cast(subject)); + Ride* ride = get_ride(static_cast(subject)); if (ride == nullptr || ride->overall_view.IsNull()) { break; diff --git a/src/openrct2/network/NetworkTypes.h b/src/openrct2/network/NetworkTypes.h index c173fbfb16..71c81beeb6 100644 --- a/src/openrct2/network/NetworkTypes.h +++ b/src/openrct2/network/NetworkTypes.h @@ -126,7 +126,7 @@ template struct NetworkObjectId_t }; #pragma pack(pop) -using NetworkRideId_t = ride_id_t; +using NetworkRideId_t = RideId; // NOTE: When adding new types make sure to have no duplicate _TypeID's otherwise // there is no way to specialize templates if they have the exact symbol. diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index ca1840f6d3..be6fbf246f 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1051,7 +1051,7 @@ namespace OpenRCT2 { const auto version = os.GetHeader().TargetVersion; os.ReadWriteChunk(ParkFileChunkType::RIDES, [this, &version](OrcaStream::ChunkStream& cs) { - std::vector rideIds; + std::vector rideIds; if (cs.GetMode() == OrcaStream::Mode::READING) { ride_init_all(); @@ -1078,7 +1078,7 @@ namespace OpenRCT2 } } } - cs.ReadWriteVector(rideIds, [&cs, &version](ride_id_t& rideId) { + cs.ReadWriteVector(rideIds, [&cs, &version](RideId& rideId) { // Ride ID cs.ReadWrite(rideId); @@ -1356,14 +1356,14 @@ namespace OpenRCT2 } return ridesTypesBeenOn; } - static std::vector LegacyGetRidesBeenOn(const std::array& srcArray) + static std::vector LegacyGetRidesBeenOn(const std::array& srcArray) { - std::vector ridesBeenOn; + std::vector ridesBeenOn; for (uint16_t i = 0; i < RCT2::Limits::MaxRidesInPark; i++) { if (srcArray[i / 8] & (1 << (i % 8))) { - ridesBeenOn.push_back(static_cast(i)); + ridesBeenOn.push_back(static_cast(i)); } } return ridesBeenOn; @@ -1516,9 +1516,9 @@ namespace OpenRCT2 return true; }); cs.Ignore(); - cs.Ignore(); - cs.Ignore(); - cs.Ignore(); + cs.Ignore(); + cs.Ignore(); + cs.Ignore(); } } @@ -1610,7 +1610,7 @@ namespace OpenRCT2 cs.Ignore(); cs.ReadWrite(staff->HireDate); cs.Ignore(); - cs.Ignore(); + cs.Ignore(); cs.Ignore(); std::vector temp; @@ -1636,9 +1636,9 @@ namespace OpenRCT2 } else { - cs.Ignore(); + cs.Ignore(); cs.ReadWrite(staff->StaffOrders); - cs.Ignore(); + cs.Ignore(); } } @@ -1697,7 +1697,7 @@ namespace OpenRCT2 cs.Ignore(); cs.Ignore(); cs.Ignore(); - cs.Ignore(); + cs.Ignore(); cs.Ignore(); cs.Ignore(); cs.Ignore(); @@ -1705,7 +1705,7 @@ namespace OpenRCT2 cs.Ignore(); cs.Ignore(); cs.Ignore(); - cs.Ignore(); + cs.Ignore(); cs.Ignore(); } } @@ -1895,8 +1895,8 @@ namespace OpenRCT2 { if (cs.GetMode() == OrcaStream::Mode::READING) { - std::vector rideUse; - cs.ReadWriteVector(rideUse, [&cs](ride_id_t& rideId) { cs.ReadWrite(rideId); }); + std::vector rideUse; + cs.ReadWriteVector(rideUse, [&cs](RideId& rideId) { cs.ReadWrite(rideId); }); OpenRCT2::RideUse::GetHistory().Set(guest.sprite_index, std::move(rideUse)); std::vector rideTypeUse; cs.ReadWriteVector(rideTypeUse, [&cs](ObjectEntryIndex& rideType) { cs.ReadWrite(rideType); }); @@ -1907,12 +1907,12 @@ namespace OpenRCT2 auto* rideUse = OpenRCT2::RideUse::GetHistory().GetAll(guest.sprite_index); if (rideUse == nullptr) { - std::vector empty; - cs.ReadWriteVector(empty, [&cs](ride_id_t& rideId) { cs.ReadWrite(rideId); }); + std::vector empty; + cs.ReadWriteVector(empty, [&cs](RideId& rideId) { cs.ReadWrite(rideId); }); } else { - cs.ReadWriteVector(*rideUse, [&cs](ride_id_t& rideId) { cs.ReadWrite(rideId); }); + cs.ReadWriteVector(*rideUse, [&cs](RideId& rideId) { cs.ReadWrite(rideId); }); } auto* rideTypeUse = OpenRCT2::RideUse::GetTypeHistory().GetAll(guest.sprite_index); if (rideTypeUse == nullptr) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 782988c029..784e0cf8fa 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -34,7 +34,7 @@ static uint8_t _peepPathFindFewestNumSteps; TileCoordsXYZ gPeepPathFindGoalPosition; bool gPeepPathFindIgnoreForeignQueues; -ride_id_t gPeepPathFindQueueRideIndex; +RideId gPeepPathFindQueueRideIndex; #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 // Use to guard calls to log messages @@ -322,7 +322,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement * This is the recursive portion of footpath_element_destination_in_direction(). */ static uint8_t footpath_element_dest_in_dir( - TileCoordsXYZ loc, Direction chosenDirection, ride_id_t* outRideIndex, int32_t level) + TileCoordsXYZ loc, Direction chosenDirection, RideId* outRideIndex, int32_t level) { TileElement* tileElement; Direction direction; @@ -347,7 +347,7 @@ static uint8_t footpath_element_dest_in_dir( { if (loc.z != tileElement->base_height) continue; - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) { @@ -444,7 +444,7 @@ static uint8_t footpath_element_dest_in_dir( * width path, for example that leads from a ride exit back to the main path. */ static uint8_t footpath_element_destination_in_direction( - TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection, ride_id_t* outRideIndex) + TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection, RideId* outRideIndex) { if (pathElement->IsSloped()) { @@ -756,7 +756,7 @@ static void peep_pathfind_heuristic_search( if (tileElement->IsGhost()) continue; - ride_id_t rideIndex = RIDE_ID_NULL; + RideId rideIndex = RIDE_ID_NULL; switch (tileElement->GetType()) { case TileElementType::Track: @@ -2096,7 +2096,7 @@ int32_t guest_path_finding(Guest* peep) if (!(adjustedEdges & (1 << chosenDirection))) continue; - ride_id_t rideIndex = RIDE_ID_NULL; + RideId rideIndex = RIDE_ID_NULL; auto pathSearchResult = footpath_element_destination_in_direction(loc, pathElement, chosenDirection, &rideIndex); switch (pathSearchResult) { @@ -2156,7 +2156,7 @@ int32_t guest_path_finding(Guest* peep) } // Peep is heading for a ride. - ride_id_t rideIndex = peep->GuestHeadingToRideId; + RideId rideIndex = peep->GuestHeadingToRideId; auto ride = get_ride(rideIndex); if (ride == nullptr || ride->status != RideStatus::Open) { diff --git a/src/openrct2/peep/GuestPathfinding.h b/src/openrct2/peep/GuestPathfinding.h index 7804e2de60..5c7fde32b4 100644 --- a/src/openrct2/peep/GuestPathfinding.h +++ b/src/openrct2/peep/GuestPathfinding.h @@ -27,7 +27,7 @@ extern TileCoordsXYZ gPeepPathFindGoalPosition; // When the heuristic pathfinder is examining neighboring tiles, one possibility is that it finds a // queue tile; furthermore, this queue tile may or may not be for the ride that the peep is trying // to get to, if any. This first var is used to store the ride that the peep is currently headed to. -extern ride_id_t gPeepPathFindQueueRideIndex; +extern RideId gPeepPathFindQueueRideIndex; // Furthermore, staff members don't care about this stuff; even if they are e.g. a mechanic headed // to a particular ride, they have no issues with walking over queues for other rides to get there. diff --git a/src/openrct2/peep/RideUseSystem.h b/src/openrct2/peep/RideUseSystem.h index bc1971ef00..822f2d136c 100644 --- a/src/openrct2/peep/RideUseSystem.h +++ b/src/openrct2/peep/RideUseSystem.h @@ -13,7 +13,7 @@ namespace OpenRCT2::RideUse { - using RideHistory = GroupVector; + using RideHistory = GroupVector; using RideTypeHistory = GroupVector; RideHistory& GetHistory(); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 77eee6211f..66139b6c6a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -775,13 +775,13 @@ namespace RCT1 { if (_s4.rides[i].type != RideType::Null) { - const auto rideId = static_cast(i); + const auto rideId = static_cast(i); ImportRide(GetOrAllocateRide(rideId), &_s4.rides[i], rideId); } } } - void ImportRide(::Ride* dst, RCT1::Ride* src, ride_id_t rideIndex) + void ImportRide(::Ride* dst, RCT1::Ride* src, RideId rideIndex) { *dst = {}; dst->id = rideIndex; @@ -2518,7 +2518,7 @@ namespace RCT1 { if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario) { - const auto merryGoRoundId = static_cast(0); + const auto merryGoRoundId = static_cast(0); // First, make the queuing peep exit for (auto peep : EntityList()) @@ -2588,7 +2588,7 @@ namespace RCT1 continue; } - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride != nullptr) { @@ -2704,13 +2704,13 @@ namespace RCT1 { auto* dst = CreateEntityAt<::Vehicle>(srcBase.sprite_index); auto* src = static_cast(&srcBase); - const auto* ride = get_ride(static_cast(src->ride)); + const auto* ride = get_ride(static_cast(src->ride)); if (ride == nullptr) return; uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); - dst->ride = static_cast(src->ride); + dst->ride = static_cast(src->ride); dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); dst->vehicle_type = vehicleEntryIndex; diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index d3d4bc2aaf..73e83ce140 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -487,12 +487,12 @@ ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(const RCT12ObjectEntryIndex i return index; } -ride_id_t RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId) +RideId RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId) { if (rideId == RCT12_RIDE_ID_NULL) return RIDE_ID_NULL; - return static_cast(rideId); + return static_cast(rideId); } static bool RCT12IsFormatChar(codepoint_t c) diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index e9e0320d6e..ce7e833e10 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -847,7 +847,7 @@ assert_struct_size(RCT12ResearchItem, 5); #pragma pack(pop) ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(const RCT12ObjectEntryIndex index); -ride_id_t RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId); +RideId RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId); bool IsLikelyUTF8(std::string_view s); std::string RCT12RemoveFormattingUTF8(std::string_view s); std::string ConvertFormattedStringToOpenRCT2(std::string_view buffer); @@ -874,14 +874,14 @@ template std::vector RCT12GetRideTypesBeenOn(T* srcPeep) } return ridesTypesBeenOn; } -template std::vector RCT12GetRidesBeenOn(T* srcPeep) +template std::vector RCT12GetRidesBeenOn(T* srcPeep) { - std::vector ridesBeenOn; + std::vector ridesBeenOn; for (uint16_t i = 0; i < RCT12::Limits::MaxRidesInPark; i++) { if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8))) { - ridesBeenOn.push_back(static_cast(i)); + ridesBeenOn.push_back(static_cast(i)); } } return ridesBeenOn; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5e8d597f58..71d1505b10 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -566,7 +566,7 @@ namespace RCT2 auto src = &_s6.rides[index]; if (src->type != RIDE_TYPE_NULL) { - const auto rideId = static_cast(index); + const auto rideId = static_cast(index); auto dst = GetOrAllocateRide(rideId); ImportRide(dst, src, rideId); } @@ -621,7 +621,7 @@ namespace RCT2 return _isFlatRide[rct12RideIndex]; } - void ImportRide(::Ride* dst, const RCT2::Ride* src, const ride_id_t rideIndex) + void ImportRide(::Ride* dst, const RCT2::Ride* src, const RideId rideIndex) { *dst = {}; dst->id = rideIndex; @@ -960,7 +960,7 @@ namespace RCT2 { if (src.ride_index != RCT12_RIDE_ID_NULL) { - const auto rideId = static_cast(src.ride_index); + const auto rideId = static_cast(src.ride_index); auto ride = get_ride(rideId); if (ride != nullptr) { @@ -1090,7 +1090,7 @@ namespace RCT2 } } - void ImportNumRiders(::Ride* dst, const ride_id_t rideIndex) + void ImportNumRiders(::Ride* dst, const RideId rideIndex) { // The number of riders might have overflown or underflown. Re-calculate the value. uint16_t numRiders = 0; @@ -1795,7 +1795,7 @@ namespace RCT2 dst->remaining_distance = src->remaining_distance; dst->velocity = src->velocity; dst->acceleration = src->acceleration; - dst->ride = static_cast(src->ride); + dst->ride = static_cast(src->ride); dst->vehicle_type = src->vehicle_type; dst->colours = src->colours; dst->track_progress = src->track_progress; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index d090dfa80b..40552d5205 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -135,7 +135,7 @@ RideManager::Iterator RideManager::end() return RideManager::Iterator(*this, _rides.size(), _rides.size()); } -ride_id_t GetNextFreeRideId() +RideId GetNextFreeRideId() { size_t result = _rides.size(); for (size_t i = 0; i < _rides.size(); i++) @@ -150,10 +150,10 @@ ride_id_t GetNextFreeRideId() { return RIDE_ID_NULL; } - return static_cast(result); + return static_cast(result); } -Ride* GetOrAllocateRide(ride_id_t index) +Ride* GetOrAllocateRide(RideId index) { const auto idx = static_cast(index); if (_rides.size() <= idx) @@ -166,7 +166,7 @@ Ride* GetOrAllocateRide(ride_id_t index) return result; } -Ride* get_ride(ride_id_t index) +Ride* get_ride(RideId index) { const auto idx = static_cast(index); if (idx < _rides.size()) @@ -2553,7 +2553,7 @@ static StationIndex ride_mode_check_station_present(Ride* ride) * * rct2: 0x006B5872 */ -static int32_t ride_check_for_entrance_exit(ride_id_t rideIndex) +static int32_t ride_check_for_entrance_exit(RideId rideIndex) { auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -2642,7 +2642,7 @@ void Ride::ChainQueues() const */ static int32_t ride_check_block_brakes(CoordsXYE* input, CoordsXYE* output) { - ride_id_t rideIndex = input->element->AsTrack()->GetRideIndex(); + RideId rideIndex = input->element->AsTrack()->GetRideIndex(); rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) ride_construction_invalidate_current_track(); @@ -2702,7 +2702,7 @@ static bool ride_check_track_contains_inversions(CoordsXYE* input, CoordsXYE* ou if (trackElement == nullptr) return false; - ride_id_t rideIndex = trackElement->GetRideIndex(); + RideId rideIndex = trackElement->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride != nullptr && ride->type == RIDE_TYPE_MAZE) return true; @@ -2864,7 +2864,7 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) { CoordsXYE trackBack, trackFront; - ride_id_t rideIndex = input->element->AsTrack()->GetRideIndex(); + RideId rideIndex = input->element->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr) return false; @@ -3014,7 +3014,7 @@ static void RideOpenBlockBrakes(CoordsXYE* startElement) * * rct2: 0x006B4D26 */ -static void ride_set_start_finish_points(ride_id_t rideIndex, CoordsXYE* startElement) +static void ride_set_start_finish_points(RideId rideIndex, CoordsXYE* startElement) { auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -3073,7 +3073,7 @@ static constexpr const CoordsXY word_9A2A60[] = { * rct2: 0x006DD90D */ static Vehicle* vehicle_create_car( - ride_id_t rideIndex, int32_t vehicleEntryIndex, int32_t carIndex, int32_t vehicleIndex, const CoordsXYZ& carPosition, + RideId rideIndex, int32_t vehicleEntryIndex, int32_t carIndex, int32_t vehicleIndex, const CoordsXYZ& carPosition, int32_t* remainingDistance, TrackElement* trackElement) { if (trackElement == nullptr) @@ -3277,7 +3277,7 @@ static Vehicle* vehicle_create_car( * rct2: 0x006DD84C */ static train_ref vehicle_create_train( - ride_id_t rideIndex, const CoordsXYZ& trainPos, int32_t vehicleIndex, int32_t* remainingDistance, + RideId rideIndex, const CoordsXYZ& trainPos, int32_t vehicleIndex, int32_t* remainingDistance, TrackElement* trackElement) { train_ref train = { nullptr, nullptr }; @@ -3309,7 +3309,7 @@ static train_ref vehicle_create_train( return train; } -static bool vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPos, TrackElement* trackElement) +static bool vehicle_create_trains(RideId rideIndex, const CoordsXYZ& trainsPos, TrackElement* trackElement) { auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -3684,7 +3684,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) * * rct2: 0x006DF4D4 */ -static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying) +static bool ride_create_cable_lift(RideId rideIndex, bool isApplying) { auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -4200,7 +4200,7 @@ static bool ride_with_colour_config_exists(uint8_t ride_type, const TrackColour* return false; } -bool Ride::NameExists(std::string_view name, ride_id_t excludeRideId) +bool Ride::NameExists(std::string_view name, RideId excludeRideId) { char buffer[256]{}; for (auto& ride : GetRideManager()) @@ -4947,7 +4947,7 @@ static int32_t ride_get_track_length(Ride* ride) if (!foundTrack) return 0; - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) @@ -5790,7 +5790,7 @@ void Ride::UpdateRideTypeForAllPieces() } } -std::vector GetTracklessRides() +std::vector GetTracklessRides() { // Iterate map and build list of seen ride IDs std::vector seen; @@ -5813,7 +5813,7 @@ std::vector GetTracklessRides() // Get all rides that did not get seen during map iteration const auto& rideManager = GetRideManager(); - std::vector result; + std::vector result; for (const auto& ride : rideManager) { if (seen.size() <= static_cast(ride.id) || !seen[static_cast(ride.id)]) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 9a82bdcbac..a6aa349fb0 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -105,7 +105,7 @@ enum class RideStatus : uint8_t; */ struct Ride { - ride_id_t id = RIDE_ID_NULL; + RideId id = RIDE_ID_NULL; uint8_t type = RIDE_TYPE_NULL; // pointer to static info. for example, wild mouse type is 0x36, subtype is // 0x4c. @@ -343,7 +343,7 @@ public: void FormatStatusTo(Formatter&) const; static void UpdateAll(); - static bool NameExists(std::string_view name, ride_id_t excludeRideId = RIDE_ID_NULL); + static bool NameExists(std::string_view name, RideId excludeRideId = RIDE_ID_NULL); [[nodiscard]] std::unique_ptr SaveToTrackDesign(TrackDesignState& tds) const; @@ -868,16 +868,16 @@ enum constexpr uint32_t CONSTRUCTION_LIFT_HILL_SELECTED = 1 << 0; constexpr uint32_t CONSTRUCTION_INVERTED_TRACK_SELECTED = 1 << 1; -Ride* get_ride(ride_id_t index); +Ride* get_ride(RideId index); struct RideManager { - const Ride* operator[](ride_id_t id) const + const Ride* operator[](RideId id) const { return get_ride(id); } - Ride* operator[](ride_id_t id) + Ride* operator[](RideId id) { return get_ride(id); } @@ -904,7 +904,7 @@ struct RideManager , _index(beginIndex) , _endIndex(endIndex) { - if (_index < _endIndex && (*_rideManager)[static_cast(_index)] == nullptr) + if (_index < _endIndex && (*_rideManager)[static_cast(_index)] == nullptr) { ++(*this); } @@ -916,7 +916,7 @@ struct RideManager do { _index++; - } while (_index < _endIndex && (*_rideManager)[static_cast(_index)] == nullptr); + } while (_index < _endIndex && (*_rideManager)[static_cast(_index)] == nullptr); return *this; } Iterator operator++(int) @@ -935,7 +935,7 @@ struct RideManager } Ride& operator*() { - return *(*_rideManager)[static_cast(_index)]; + return *(*_rideManager)[static_cast(_index)]; } }; @@ -953,8 +953,8 @@ struct RideManager }; RideManager GetRideManager(); -ride_id_t GetNextFreeRideId(); -Ride* GetOrAllocateRide(ride_id_t index); +RideId GetNextFreeRideId(); +Ride* GetOrAllocateRide(RideId index); rct_ride_entry* get_ride_entry(ObjectEntryIndex index); std::string_view get_ride_entry_name(ObjectEntryIndex index); @@ -1034,8 +1034,8 @@ void ride_update_vehicle_colours(Ride* ride); uint64_t ride_entry_get_supported_track_pieces(const rct_ride_entry* rideEntry); 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); +money32 set_operating_setting(RideId rideId, RideSetSetting setting, uint8_t value); +money32 set_operating_setting_nested(RideId rideId, RideSetSetting setting, uint8_t value, uint8_t flags); void UpdateGhostTrackAndArrow(); @@ -1070,6 +1070,6 @@ void ride_action_modify(Ride* ride, int32_t modifyType, int32_t flags); void determine_ride_entrance_and_exit_locations(); void ride_clear_leftover_entrances(Ride* ride); -std::vector GetTracklessRides(); +std::vector GetTracklessRides(); void ride_remove_vehicles(Ride* ride); diff --git a/src/openrct2/ride/RideAudio.cpp b/src/openrct2/ride/RideAudio.cpp index e98d04249c..fa2af9bb85 100644 --- a/src/openrct2/ride/RideAudio.cpp +++ b/src/openrct2/ride/RideAudio.cpp @@ -35,7 +35,7 @@ namespace OpenRCT2::RideAudio */ struct ViewportRideMusicInstance { - ride_id_t RideId; + RideId RideId; uint8_t TrackIndex{}; size_t Offset{}; @@ -49,7 +49,7 @@ namespace OpenRCT2::RideAudio */ struct RideMusicChannel { - ride_id_t RideId{}; + RideId RideId{}; uint8_t TrackIndex{}; size_t Offset{}; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index bd7534ca90..59517e9e32 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -59,7 +59,7 @@ uint16_t _numCurrentPossibleSpecialTrackPieces; uint32_t _currentTrackCurve; RideConstructionState _rideConstructionState; -ride_id_t _currentRideIndex; +RideId _currentRideIndex; CoordsXYZ _currentTrackBegin; @@ -86,7 +86,7 @@ CoordsXYZD _unkF440C5; ObjectEntryIndex gLastEntranceStyle; uint8_t gRideEntranceExitPlaceType; -ride_id_t gRideEntranceExitPlaceRideIndex; +RideId gRideEntranceExitPlaceRideIndex; StationIndex gRideEntranceExitPlaceStationIndex; RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; Direction gRideEntranceExitPlaceDirection; @@ -122,7 +122,7 @@ static int32_t ride_check_if_construction_allowed(Ride* ride) return 1; } -static rct_window* ride_create_or_find_construction_window(ride_id_t rideIndex) +static rct_window* ride_create_or_find_construction_window(RideId rideIndex) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); @@ -463,7 +463,7 @@ void ride_restore_provisional_track_piece() { if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) { - ride_id_t rideIndex; + RideId rideIndex; int32_t direction, type, liftHillAndAlternativeState; CoordsXYZ trackPos; if (window_ride_construction_update_state( @@ -1187,14 +1187,14 @@ int32_t ride_get_refund_price(const Ride* ride) return cost; } -money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value) +money32 set_operating_setting(RideId rideId, RideSetSetting setting, uint8_t value) { auto rideSetSetting = RideSetSettingAction(rideId, setting, value); auto res = GameActions::Execute(&rideSetSetting); return res.Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; } -money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags) +money32 set_operating_setting_nested(RideId rideId, RideSetSetting setting, uint8_t value, uint8_t flags) { auto rideSetSetting = RideSetSettingAction(rideId, setting, value); rideSetSetting.SetFlags(flags); diff --git a/src/openrct2/ride/RideConstruction.h b/src/openrct2/ride/RideConstruction.h index bba56f4d8a..b1baa5616c 100644 --- a/src/openrct2/ride/RideConstruction.h +++ b/src/openrct2/ride/RideConstruction.h @@ -17,7 +17,7 @@ #include using track_type_t = uint16_t; -enum class ride_id_t : uint16_t; +enum class RideId : uint16_t; struct TileElement; struct CoordsXYE; @@ -44,7 +44,7 @@ extern uint16_t _numCurrentPossibleSpecialTrackPieces; extern uint32_t _currentTrackCurve; extern RideConstructionState _rideConstructionState; -extern ride_id_t _currentRideIndex; +extern RideId _currentRideIndex; extern CoordsXYZ _currentTrackBegin; @@ -69,7 +69,7 @@ extern uint8_t _currentSeatRotationAngle; extern CoordsXYZD _unkF440C5; extern uint8_t gRideEntranceExitPlaceType; -extern ride_id_t gRideEntranceExitPlaceRideIndex; +extern RideId gRideEntranceExitPlaceRideIndex; extern StationIndex gRideEntranceExitPlaceStationIndex; extern RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; extern uint8_t gRideEntranceExitPlaceDirection; diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 4d0925064c..a131c39397 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -160,10 +160,10 @@ static void ride_ratings_update_state(RideRatingUpdateState& state) */ static void ride_ratings_update_state_0(RideRatingUpdateState& state) { - ride_id_t currentRide = state.CurrentRide; + RideId currentRide = state.CurrentRide; - currentRide = static_cast(EnumValue(currentRide) + 1); - if (currentRide >= static_cast(OpenRCT2::Limits::MaxRidesInPark)) + currentRide = static_cast(EnumValue(currentRide) + 1); + if (currentRide >= static_cast(OpenRCT2::Limits::MaxRidesInPark)) { currentRide = {}; } @@ -200,7 +200,7 @@ static void ride_ratings_update_state_1(RideRatingUpdateState& state) */ static void ride_ratings_update_state_2(RideRatingUpdateState& state) { - const ride_id_t rideIndex = state.CurrentRide; + const RideId rideIndex = state.CurrentRide; auto ride = get_ride(rideIndex); if (ride == nullptr || ride->status == RideStatus::Closed || ride->type >= RIDE_TYPE_COUNT) { diff --git a/src/openrct2/ride/RideRatings.h b/src/openrct2/ride/RideRatings.h index 449c42daa8..a40a335138 100644 --- a/src/openrct2/ride/RideRatings.h +++ b/src/openrct2/ride/RideRatings.h @@ -43,7 +43,7 @@ struct RideRatingUpdateState { CoordsXYZ Proximity; CoordsXYZ ProximityStart; - ride_id_t CurrentRide; + RideId CurrentRide; uint8_t State; track_type_t ProximityTrackType; uint8_t ProximityBaseHeight; diff --git a/src/openrct2/ride/RideTypes.h b/src/openrct2/ride/RideTypes.h index b9747b58c8..433b380cfc 100644 --- a/src/openrct2/ride/RideTypes.h +++ b/src/openrct2/ride/RideTypes.h @@ -15,10 +15,10 @@ #include #include -enum class ride_id_t : uint16_t; +enum class RideId : uint16_t; struct Ride; -constexpr const ride_id_t RIDE_ID_NULL = static_cast(std::numeric_limits>::max()); +constexpr const RideId RIDE_ID_NULL = static_cast(std::numeric_limits>::max()); using ride_type_t = uint16_t; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 6f97faa432..a764f41934 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -70,7 +70,7 @@ int32_t track_is_connected_by_shape(TileElement* a, TileElement* b) return aBank == bBank && aAngle == bAngle; } -static TileElement* find_station_element(const CoordsXYZD& loc, ride_id_t rideIndex) +static TileElement* find_station_element(const CoordsXYZD& loc, RideId rideIndex) { TileElement* tileElement = map_get_first_element_at(loc); if (tileElement == nullptr) @@ -111,7 +111,7 @@ static void ride_remove_station(Ride* ride, const CoordsXYZ& location) * * rct2: 0x006C4D89 */ -bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flags, bool fromTrackDesign) +bool track_add_station_element(CoordsXYZD loc, RideId rideIndex, int32_t flags, bool fromTrackDesign) { auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -262,7 +262,7 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag * * rct2: 0x006C494B */ -bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, int32_t flags) +bool track_remove_station_element(const CoordsXYZD& loc, RideId rideIndex, int32_t flags) { auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -783,12 +783,12 @@ void TrackElement::SetDoorBState(uint8_t newState) ColourScheme |= ((newState << 5) & TRACK_ELEMENT_COLOUR_DOOR_B_MASK); } -ride_id_t TrackElement::GetRideIndex() const +RideId TrackElement::GetRideIndex() const { return RideIndex; } -void TrackElement::SetRideIndex(ride_id_t newRideIndex) +void TrackElement::SetRideIndex(RideId newRideIndex) { RideIndex = newRideIndex; } diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index 7b9e78a007..3ded1796ca 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -574,9 +574,9 @@ roll_type_t track_get_actual_bank(TileElement* tileElement, roll_type_t bank); roll_type_t track_get_actual_bank_2(int32_t rideType, bool isInverted, roll_type_t bank); roll_type_t track_get_actual_bank_3(bool useInvertedSprites, TileElement* tileElement); -bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flags, bool fromTrackDesign); -bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, int32_t flags); +bool track_add_station_element(CoordsXYZD loc, RideId rideIndex, int32_t flags, bool fromTrackDesign); +bool track_remove_station_element(const CoordsXYZD& loc, RideId rideIndex, int32_t flags); -money32 maze_set_track(const CoordsXYZD& coords, uint8_t flags, bool initialPlacement, ride_id_t rideIndex, uint8_t mode); +money32 maze_set_track(const CoordsXYZD& coords, uint8_t flags, bool initialPlacement, RideId rideIndex, uint8_t mode); bool TrackTypeHasSpeedSetting(track_type_t trackType); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 26fc5d6505..1ba3450037 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1917,7 +1917,7 @@ int32_t TrackDesignGetZPlacement(TrackDesign* td6, Ride* ride, const CoordsXYZ& return TrackDesignGetZPlacement(tds, td6, ride, coords); } -static money32 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, ride_id_t* outRideIndex) +static money32 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, RideId* outRideIndex) { // Don't set colours as will be set correctly later. auto gameAction = RideCreateAction(type, subType, 0, 0, gLastEntranceStyle); @@ -1931,7 +1931,7 @@ static money32 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flag return MONEY32_UNDEFINED; } - *outRideIndex = res.GetData(); + *outRideIndex = res.GetData(); return res.Cost; } @@ -1950,7 +1950,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon auto& objManager = GetContext()->GetObjectManager(); auto entry_index = objManager.GetLoadedObjectEntryIndex(td6->vehicle_object); - ride_id_t rideIndex; + RideId rideIndex; uint8_t rideCreateFlags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND; if (TrackDesignCreateRide(td6->type, entry_index, rideCreateFlags, &rideIndex) == MONEY32_UNDEFINED) { diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 8a40b6ec66..9dee4ce1bd 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -208,7 +208,7 @@ enum MAZE_ELEMENT_TYPE_EXIT = (1 << 7) }; -static constexpr ride_id_t PreviewRideId = static_cast(0); +static constexpr RideId PreviewRideId = static_cast(0); extern bool gTrackDesignSceneryToggle; @@ -216,7 +216,7 @@ extern bool _trackDesignDrawingPreview; extern bool _trackDesignPlaceStateSceneryUnavailable; extern bool gTrackDesignSaveMode; -extern ride_id_t gTrackDesignSaveRideIndex; +extern RideId gTrackDesignSaveRideIndex; [[nodiscard]] std::unique_ptr TrackDesignImport(const utf8* path); @@ -238,7 +238,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels); void track_design_save_init(); void track_design_save_reset_scenery(); bool track_design_save_contains_tile_element(const TileElement* tileElement); -void track_design_save_select_nearby_scenery(ride_id_t rideIndex); +void track_design_save_select_nearby_scenery(RideId rideIndex); void track_design_save_select_tile_element( ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement, bool collect); diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 0b549c0179..7db6483723 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -41,7 +41,7 @@ constexpr size_t TRACK_MAX_SAVED_TILE_ELEMENTS = 1500; constexpr int32_t TRACK_NEARBY_SCENERY_DISTANCE = 1; bool gTrackDesignSaveMode = false; -ride_id_t gTrackDesignSaveRideIndex = RIDE_ID_NULL; +RideId gTrackDesignSaveRideIndex = RIDE_ID_NULL; std::vector _trackSavedTileElements; std::vector _trackSavedTileElementsDesc; @@ -62,8 +62,8 @@ struct TrackDesignAddStatus } }; -static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement); -static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex, int32_t cx, int32_t cy); +static bool track_design_save_should_select_scenery_around(RideId rideIndex, TileElement* tileElement); +static void track_design_save_select_nearby_scenery_for_tile(RideId rideIndex, int32_t cx, int32_t cy); static TrackDesignAddStatus track_design_save_add_tile_element( ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement); static void track_design_save_remove_tile_element( @@ -106,7 +106,7 @@ void track_design_save_select_tile_element( * * rct2: 0x006D303D */ -void track_design_save_select_nearby_scenery(ride_id_t rideIndex) +void track_design_save_select_nearby_scenery(RideId rideIndex) { tile_element_iterator it; tile_element_iterator_begin(&it); @@ -583,7 +583,7 @@ static void track_design_save_remove_tile_element( } } -static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement) +static bool track_design_save_should_select_scenery_around(RideId rideIndex, TileElement* tileElement) { switch (tileElement->GetType()) { @@ -610,7 +610,7 @@ static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, return false; } -static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex, int32_t cx, int32_t cy) +static void track_design_save_select_nearby_scenery_for_tile(RideId rideIndex, int32_t cx, int32_t cy) { TileElement* tileElement; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index de0b89511f..6ae7b8fa35 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -2189,7 +2189,7 @@ void track_paint_util_left_corkscrew_up_supports(paint_session& session, Directi */ void PaintTrack(paint_session& session, Direction direction, int32_t height, const TrackElement& trackElement) { - ride_id_t rideIndex = trackElement.GetRideIndex(); + RideId rideIndex = trackElement.GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr) { diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 292329e67f..f4497570de 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -2577,7 +2577,7 @@ void Vehicle::UpdateWaitingToDepart() struct rct_synchronised_vehicle { - ride_id_t ride_id; + RideId ride_id; StationIndex stationIndex; uint16_t vehicle_id; }; @@ -2765,7 +2765,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex if (!(sv_ride->stations[sv->stationIndex].Depart & STATION_DEPART_FLAG)) { sv = _synchronisedVehicles; - ride_id_t rideId = RIDE_ID_NULL; + RideId rideId = RIDE_ID_NULL; for (; sv < _lastSynchronisedVehicle; sv++) { if (rideId == RIDE_ID_NULL) @@ -2811,7 +2811,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex // Sync condition: there are at least 3 stations to sync return false; } - ride_id_t someRideIndex = _synchronisedVehicles[0].ride_id; + RideId someRideIndex = _synchronisedVehicles[0].ride_id; if (someRideIndex != ride.id) { // Sync condition: the first station to sync is a different ride @@ -6397,7 +6397,7 @@ bool Vehicle::DodgemsCarWouldCollideAt(const CoordsXY& coords, uint16_t* collide auto location = coords; - ride_id_t rideIndex = ride; + RideId rideIndex = ride; for (auto xy_offset : SurroundingTiles) { location += xy_offset; diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 3c436afcad..7977c65153 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -106,7 +106,7 @@ struct Vehicle : EntityBase int32_t remaining_distance; int32_t velocity; int32_t acceleration; - ride_id_t ride; + RideId ride; uint8_t vehicle_type; rct_vehicle_colour colours; union diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index ba39a9138e..b5f79f831f 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -891,7 +891,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const Gam { if (result.Error == GameActions::Status::Ok) { - const auto rideIndex = result.GetData(); + const auto rideIndex = result.GetData(); obj.Set("ride", EnumValue(rideIndex)); } } diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp index 2f4be2efcb..82cc5ea551 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -146,7 +146,7 @@ namespace OpenRCT2::Scripting auto vehicle = GetVehicle(); if (vehicle != nullptr) { - vehicle->ride = static_cast(value); + vehicle->ride = static_cast(value); } } diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp index 6bdd07b4f7..b0f7b211a4 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -20,7 +20,7 @@ namespace OpenRCT2::Scripting { - ScRide::ScRide(ride_id_t rideId) + ScRide::ScRide(RideId rideId) : _rideId(rideId) { } diff --git a/src/openrct2/scripting/bindings/ride/ScRide.hpp b/src/openrct2/scripting/bindings/ride/ScRide.hpp index 0ee26d3d46..cc2c5e10b9 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -60,10 +60,10 @@ namespace OpenRCT2::Scripting class ScRide { private: - ride_id_t _rideId = RIDE_ID_NULL; + RideId _rideId = RIDE_ID_NULL; public: - ScRide(ride_id_t rideId); + ScRide(RideId rideId); private: int32_t id_get() const; diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp index 1168d96060..5471c545b7 100644 --- a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp @@ -20,7 +20,7 @@ namespace OpenRCT2::Scripting { - ScRideStation::ScRideStation(ride_id_t rideId, StationIndex stationIndex) + ScRideStation::ScRideStation(RideId rideId, StationIndex stationIndex) : _rideId(rideId) , _stationIndex(stationIndex) { diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.hpp b/src/openrct2/scripting/bindings/ride/ScRideStation.hpp index 7b8c1804b9..c78ef5fe49 100644 --- a/src/openrct2/scripting/bindings/ride/ScRideStation.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.hpp @@ -21,11 +21,11 @@ namespace OpenRCT2::Scripting class ScRideStation { private: - ride_id_t _rideId = RIDE_ID_NULL; + RideId _rideId = RIDE_ID_NULL; StationIndex _stationIndex{}; public: - ScRideStation(ride_id_t rideId, StationIndex stationIndex); + ScRideStation(RideId rideId, StationIndex stationIndex); static void Register(duk_context* ctx); diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index 2b16f0f0d8..3cb2c7f535 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -69,7 +69,7 @@ namespace OpenRCT2::Scripting std::shared_ptr ScMap::getRide(int32_t id) const { auto rideManager = GetRideManager(); - auto ride = rideManager[static_cast(id)]; + auto ride = rideManager[static_cast(id)]; if (ride != nullptr) { return std::make_shared(ride->id); diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 5718f8e7eb..590c7bd3ad 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -488,7 +488,7 @@ namespace OpenRCT2::Scripting if (el->IsQueue()) { if (value.type() == DukValue::Type::NUMBER) - el->SetRideIndex(static_cast(value.as_uint())); + el->SetRideIndex(static_cast(value.as_uint())); else el->SetRideIndex(RIDE_ID_NULL); Invalidate(); @@ -500,7 +500,7 @@ namespace OpenRCT2::Scripting if (value.type() == DukValue::Type::NUMBER) { auto el = _element->AsTrack(); - el->SetRideIndex(static_cast(value.as_uint())); + el->SetRideIndex(static_cast(value.as_uint())); Invalidate(); } break; @@ -510,7 +510,7 @@ namespace OpenRCT2::Scripting if (value.type() == DukValue::Type::NUMBER) { auto el = _element->AsEntrance(); - el->SetRideIndex(static_cast(value.as_uint())); + el->SetRideIndex(static_cast(value.as_uint())); Invalidate(); } break; diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 3b81ee6a2d..b77c16c0c0 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -44,7 +44,7 @@ bool _deferClose; * rct2: 0x006CA162 */ money32 place_provisional_track_piece( - ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, + RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, const CoordsXYZ& trackPos) { auto ride = get_ride(rideIndex); @@ -238,10 +238,10 @@ static std::tuple window_ride_construction_update_state_get_ * @return (CF) */ bool window_ride_construction_update_state( - int32_t* _trackType, int32_t* _trackDirection, ride_id_t* _rideIndex, int32_t* _liftHillAndInvertedState, + int32_t* _trackType, int32_t* _trackDirection, RideId* _rideIndex, int32_t* _liftHillAndInvertedState, CoordsXYZ* _trackPos, int32_t* _properties) { - ride_id_t rideIndex; + RideId rideIndex; uint8_t trackDirection; uint16_t x, y, liftHillAndInvertedState, properties; diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 2f5ebfd711..a848e3efc8 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -87,10 +87,10 @@ void Banner::FormatTextTo(Formatter& ft) const * * rct2: 0x006B7EAB */ -static ride_id_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords) +static RideId banner_get_ride_index_at(const CoordsXYZ& bannerCoords) { TileElement* tileElement = map_get_first_element_at(bannerCoords); - ride_id_t resultRideIndex = RIDE_ID_NULL; + RideId resultRideIndex = RIDE_ID_NULL; if (tileElement == nullptr) return resultRideIndex; do @@ -98,7 +98,7 @@ static ride_id_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords) if (tileElement->GetType() != TileElementType::Track) continue; - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) continue; @@ -193,7 +193,7 @@ WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex) * * rct2: 0x006B7D86 */ -ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos) +RideId banner_get_closest_ride_index(const CoordsXYZ& mapPos) { static constexpr const std::array NeighbourCheckOrder = { CoordsXY{ COORDS_XY_STEP, 0 }, @@ -209,7 +209,7 @@ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos) for (const auto& neighhbourCoords : NeighbourCheckOrder) { - ride_id_t rideIndex = banner_get_ride_index_at({ CoordsXY{ mapPos } + neighhbourCoords, mapPos.z }); + RideId rideIndex = banner_get_ride_index_at({ CoordsXY{ mapPos } + neighhbourCoords, mapPos.z }); if (rideIndex != RIDE_ID_NULL) { return rideIndex; @@ -371,7 +371,7 @@ void UnlinkAllRideBanners() } } -void UnlinkAllBannersForRide(ride_id_t rideId) +void UnlinkAllBannersForRide(RideId rideId) { for (auto& banner : _banners) { diff --git a/src/openrct2/world/Banner.h b/src/openrct2/world/Banner.h index 4be4ddb115..35ac5a7839 100644 --- a/src/openrct2/world/Banner.h +++ b/src/openrct2/world/Banner.h @@ -32,7 +32,7 @@ struct Banner uint8_t flags{}; std::string text; uint8_t colour{}; - ride_id_t ride_index{}; + RideId ride_index{}; uint8_t text_colour{}; TileCoordsXY position; @@ -57,11 +57,11 @@ enum BANNER_FLAGS void banner_init(); TileElement* banner_get_tile_element(BannerIndex bannerIndex); WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex); -ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos); +RideId banner_get_closest_ride_index(const CoordsXYZ& mapPos); void banner_reset_broken_index(); void fix_duplicated_banners(); void UnlinkAllRideBanners(); -void UnlinkAllBannersForRide(ride_id_t rideId); +void UnlinkAllBannersForRide(RideId rideId); Banner* GetBanner(BannerIndex id); Banner* GetOrCreateBanner(BannerIndex id); Banner* CreateBanner(); diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 3043a4aaf7..f35f60099a 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -40,7 +40,7 @@ CoordsXYZD gRideEntranceExitGhostPosition; StationIndex gRideEntranceExitGhostStationIndex; static money32 RideEntranceExitPlaceGhost( - ride_id_t rideIndex, const CoordsXY& entranceExitCoords, Direction direction, uint8_t placeType, StationIndex stationNum) + RideId rideIndex, const CoordsXY& entranceExitCoords, Direction direction, uint8_t placeType, StationIndex stationNum) { auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( entranceExitCoords, direction, rideIndex, stationNum, placeType == ENTRANCE_TYPE_RIDE_EXIT); @@ -137,7 +137,7 @@ void maze_entrance_hedge_replacement(const CoordsXYE& entrance) int32_t direction = entrance.element->GetDirection(); auto hedgePos = entrance + CoordsDirectionDelta[direction]; int32_t z = entrance.element->GetBaseZ(); - ride_id_t rideIndex = entrance.element->AsEntrance()->GetRideIndex(); + RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex(); auto tileElement = map_get_first_element_at(hedgePos); if (tileElement == nullptr) @@ -174,7 +174,7 @@ void maze_entrance_hedge_removal(const CoordsXYE& entrance) int32_t direction = entrance.element->GetDirection(); auto hedgePos = entrance + CoordsDirectionDelta[direction]; int32_t z = entrance.element->GetBaseZ(); - ride_id_t rideIndex = entrance.element->AsEntrance()->GetRideIndex(); + RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex(); auto tileElement = map_get_first_element_at(hedgePos); if (tileElement == nullptr) @@ -255,12 +255,12 @@ void EntranceElement::SetEntranceType(uint8_t newType) entranceType = newType; } -ride_id_t EntranceElement::GetRideIndex() const +RideId EntranceElement::GetRideIndex() const { return rideIndex; } -void EntranceElement::SetRideIndex(ride_id_t newRideIndex) +void EntranceElement::SetRideIndex(RideId newRideIndex) { rideIndex = newRideIndex; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 1eed7fddbd..cb5d37b485 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -51,8 +51,8 @@ CoordsXYZ gFootpathConstructFromPosition; uint8_t gFootpathConstructSlope; uint8_t gFootpathGroundFlags; -static ride_id_t* _footpathQueueChainNext; -static ride_id_t _footpathQueueChain[64]; +static RideId* _footpathQueueChainNext; +static RideId _footpathQueueChain[64]; // This is the coordinates that a user of the bin should move to // rct2: 0x00992A4C @@ -583,7 +583,7 @@ struct rct_neighbour { uint8_t order; uint8_t direction; - ride_id_t ride_index; + RideId ride_index; uint8_t entrance_index; }; @@ -617,7 +617,7 @@ static void neighbour_list_init(rct_neighbour_list* neighbourList) } static void neighbour_list_push( - rct_neighbour_list* neighbourList, int32_t order, int32_t direction, ride_id_t rideIndex, uint8_t entrance_index) + rct_neighbour_list* neighbourList, int32_t order, int32_t direction, RideId rideIndex, uint8_t entrance_index) { Guard::Assert(neighbourList->count < std::size(neighbourList->items)); neighbourList->items[neighbourList->count].order = order; @@ -1038,7 +1038,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen if (tileElement->GetType() == TileElementType::Path && tileElement->AsPath()->IsQueue()) { - ride_id_t rideIndex = RIDE_ID_NULL; + RideId rideIndex = RIDE_ID_NULL; uint8_t entranceIndex = 255; for (size_t i = 0; i < neighbourList.count; i++) { @@ -1081,7 +1081,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen * rct2: 0x006A742F */ void footpath_chain_ride_queue( - ride_id_t rideIndex, int32_t entranceIndex, const CoordsXY& initialFootpathPos, TileElement* const initialTileElement, + RideId rideIndex, int32_t entranceIndex, const CoordsXY& initialFootpathPos, TileElement* const initialTileElement, int32_t direction) { TileElement *lastPathElement, *lastQueuePathElement; @@ -1210,7 +1210,7 @@ void footpath_queue_chain_reset() * * rct2: 0x006A76E9 */ -void footpath_queue_chain_push(ride_id_t rideIndex) +void footpath_queue_chain_push(RideId rideIndex) { if (rideIndex != RIDE_ID_NULL) { @@ -1230,7 +1230,7 @@ void footpath_update_queue_chains() { for (auto* queueChainPtr = _footpathQueueChain; queueChainPtr < _footpathQueueChainNext; queueChainPtr++) { - ride_id_t rideIndex = *queueChainPtr; + RideId rideIndex = *queueChainPtr; auto ride = get_ride(rideIndex); if (ride == nullptr) continue; @@ -2379,12 +2379,12 @@ const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex) return static_cast(obj); } -ride_id_t PathElement::GetRideIndex() const +RideId PathElement::GetRideIndex() const { return rideIndex; } -void PathElement::SetRideIndex(ride_id_t newRideIndex) +void PathElement::SetRideIndex(RideId newRideIndex) { rideIndex = newRideIndex; } diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index ce058ec45b..834c2bed30 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -245,7 +245,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen void footpath_update_queue_chains(); bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction); void footpath_chain_ride_queue( - ride_id_t rideIndex, int32_t entranceIndex, const CoordsXY& footpathPos, TileElement* tileElement, int32_t direction); + RideId rideIndex, int32_t entranceIndex, const CoordsXY& footpathPos, TileElement* tileElement, int32_t direction); void footpath_update_path_wide_flags(const CoordsXY& footpathPos); bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position); @@ -257,4 +257,4 @@ const FootpathSurfaceObject* GetPathSurfaceEntry(ObjectEntryIndex entryIndex); const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex); void footpath_queue_chain_reset(); -void footpath_queue_chain_push(ride_id_t rideIndex); +void footpath_queue_chain_push(RideId rideIndex); diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 1f1aaaa8e7..6cecb6ad27 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -2133,7 +2133,7 @@ TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, t * @param y y units, not tiles. * @param z Base height. */ -TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, ride_id_t rideIndex) +TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex) { TileElement* tileElement = map_get_first_element_at(trackPos); if (tileElement == nullptr) @@ -2162,7 +2162,7 @@ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPo * @param y y units, not tiles. * @param z Base height. */ -TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_id_t rideIndex) +TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex) { TileElement* tileElement = map_get_first_element_at(trackPos); if (tileElement == nullptr) @@ -2190,7 +2190,7 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_ * @param z Base height. * @param direction The direction (0 - 3). */ -TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, ride_id_t rideIndex) +TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex) { TileElement* tileElement = map_get_first_element_at(trackPos); if (tileElement == nullptr) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 50ebadefb7..59491ba6f1 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -248,9 +248,9 @@ TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_t TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence); TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track_type_t trackType); TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence); -TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_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); +TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex); +TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex); +TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex); bool map_is_location_at_edge(const CoordsXY& loc); diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index e76b22f0b5..7a83557e76 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -86,7 +86,7 @@ void TileElement::RemoveBannerEntry() } } -ride_id_t TileElement::GetRideIndex() const +RideId TileElement::GetRideIndex() const { switch (GetType()) { diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 92fc42d18a..57b72a4284 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -176,7 +176,7 @@ struct TileElement : public TileElementBase void ClearAs(TileElementType newType); - ride_id_t GetRideIndex() const; + RideId GetRideIndex() const; void SetBannerIndex(BannerIndex newIndex); void RemoveBannerEntry(); @@ -245,7 +245,7 @@ private: union { uint8_t AdditionStatus; // 13, only used for litter bins - ride_id_t rideIndex; // 13 + RideId rideIndex; // 13 }; ::StationIndex StationIndex; // 15 @@ -275,8 +275,8 @@ public: Direction GetSlopeDirection() const; void SetSlopeDirection(Direction newSlope); - ride_id_t GetRideIndex() const; - void SetRideIndex(ride_id_t newRideIndex); + RideId GetRideIndex() const; + void SetRideIndex(RideId newRideIndex); ::StationIndex GetStationIndex() const; void SetStationIndex(::StationIndex newStationIndex); @@ -350,7 +350,7 @@ private: }; }; uint8_t Flags2; - ride_id_t RideIndex; + RideId RideIndex; ride_type_t RideType; public: @@ -363,8 +363,8 @@ public: uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); - ride_id_t GetRideIndex() const; - void SetRideIndex(ride_id_t newRideIndex); + RideId GetRideIndex() const; + void SetRideIndex(RideId newRideIndex); uint8_t GetColourScheme() const; void SetColourScheme(uint8_t newColourScheme); @@ -547,7 +547,7 @@ private: uint8_t SequenceIndex; // 6. Only uses the lower nibble. uint8_t StationIndex; // 7 ObjectEntryIndex PathType; // 8 - ride_id_t rideIndex; // A + RideId rideIndex; // A uint8_t flags2; // C #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" @@ -558,8 +558,8 @@ public: uint8_t GetEntranceType() const; void SetEntranceType(uint8_t newType); - ride_id_t GetRideIndex() const; - void SetRideIndex(ride_id_t newRideIndex); + RideId GetRideIndex() const; + void SetRideIndex(RideId newRideIndex); uint8_t GetStationIndex() const; void SetStationIndex(uint8_t newStationIndex); diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 01d0a12bfd..d49face68e 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -64,7 +64,7 @@ protected: return nullptr; } - static bool FindPath(TileCoordsXYZ* pos, const TileCoordsXYZ& goal, int expectedSteps, ride_id_t targetRideID) + static bool FindPath(TileCoordsXYZ* pos, const TileCoordsXYZ& goal, int expectedSteps, RideId targetRideID) { // Our start position is in tile coordinates, but we need to give the peep spawn // position in actual world coords (32 units per tile X/Y, 8 per Z level).