diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 3edebe5a22..1a8edf19f9 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -304,7 +304,7 @@ namespace OpenRCT2::Ui { auto ft = Formatter(); ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); SetMapTooltip(ft); } return info; @@ -340,7 +340,7 @@ namespace OpenRCT2::Ui StringId stringId; if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) { - if (ride->num_stations > 1) + if (ride->numStations > 1) { stringId = STR_RIDE_STATION_X_ENTRANCE; } @@ -351,7 +351,7 @@ namespace OpenRCT2::Ui } else { - if (ride->num_stations > 1) + if (ride->numStations > 1) { stringId = STR_RIDE_STATION_X_EXIT; } @@ -365,7 +365,7 @@ namespace OpenRCT2::Ui else if (tileElement->AsTrack()->IsStation()) { StringId stringId; - if (ride->num_stations > 1) + if (ride->numStations > 1) { stringId = STR_RIDE_STATION_X; } @@ -384,13 +384,13 @@ namespace OpenRCT2::Ui return info; } - ride->FormatNameTo(ft); + ride->formatNameTo(ft); return info; } - ride->FormatNameTo(ft); + ride->formatNameTo(ft); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); ft.Add(GetRideComponentName(rtd.NameConvention.station).capitalised); StationIndex::UnderlyingType stationIndex; @@ -400,7 +400,7 @@ namespace OpenRCT2::Ui stationIndex = tileElement->AsTrack()->GetStationIndex().ToUnderlying(); for (i = stationIndex; i >= 0; i--) - if (ride->GetStations()[i].Start.IsNull()) + if (ride->getStations()[i].Start.IsNull()) stationIndex--; stationIndex++; ft.Add(stationIndex); diff --git a/src/openrct2-ui/ride/Construction.cpp b/src/openrct2-ui/ride/Construction.cpp index 61167826f0..281910c752 100644 --- a/src/openrct2-ui/ride/Construction.cpp +++ b/src/openrct2-ui/ride/Construction.cpp @@ -278,7 +278,7 @@ namespace OpenRCT2 // Additional tower bases can only be built if the ride allows for it (elevator) if (trackType == TrackElemType::TowerBase - && !currentRide.GetRideTypeDescriptor().HasFlag(RtdFlag::allowExtraTowerBases)) + && !currentRide.getRideTypeDescriptor().HasFlag(RtdFlag::allowExtraTowerBases)) entryIsDisabled = true; // Check if a previous element exists, to collate entries if possible @@ -398,7 +398,7 @@ namespace OpenRCT2 return entranceExitCoords; } - auto stationBaseZ = ride->GetStation(gRideEntranceExitPlaceStationIndex).GetBaseZ(); + auto stationBaseZ = ride->getStation(gRideEntranceExitPlaceStationIndex).GetBaseZ(); auto coordsAtHeight = ScreenGetMapXYWithZ(screenCoords, stationBaseZ); if (!coordsAtHeight.has_value()) @@ -415,7 +415,7 @@ namespace OpenRCT2 return entranceExitCoords; } - auto stationStart = ride->GetStation(gRideEntranceExitPlaceStationIndex).Start; + auto stationStart = ride->getStation(gRideEntranceExitPlaceStationIndex).Start; if (stationStart.IsNull()) { entranceExitCoords.SetNull(); diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index b2a23a8d0b..4aaa0e87cb 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -85,7 +85,7 @@ namespace OpenRCT2::Ui::Windows auto stringId = (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID : STR_DEMOLISH_RIDE_ID_MONEY; auto ft = Formatter(); - currentRide->FormatNameTo(ft); + currentRide->formatNameTo(ft); ft.Add(_demolishRideCost); ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 73f8317648..d79480a871 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -326,7 +326,7 @@ namespace OpenRCT2::Ui::Windows // Check if there are any rides (not shops or facilities) const auto& rideManager = GetRideManager(); if (std::any_of( - rideManager.begin(), rideManager.end(), [](const Ride& rideToCheck) { return rideToCheck.IsRide(); })) + rideManager.begin(), rideManager.end(), [](const Ride& rideToCheck) { return rideToCheck.isRide(); })) { disabled_widgets &= ~(1uLL << WIDX_TAB_2); } @@ -1023,7 +1023,7 @@ namespace OpenRCT2::Ui::Windows _rideableRides.clear(); for (auto& currentRide : GetRideManager()) { - if (currentRide.IsRide()) + if (currentRide.isRide()) { _rideableRides.push_back(currentRide.id); } @@ -1060,7 +1060,7 @@ namespace OpenRCT2::Ui::Windows auto* currentRide = GetRide(_rideableRides[i]); if (currentRide != nullptr) { - currentRide->lifecycle_flags ^= RIDE_LIFECYCLE_INDESTRUCTIBLE; + currentRide->lifecycleFlags ^= RIDE_LIFECYCLE_INDESTRUCTIBLE; } Invalidate(); } @@ -1142,7 +1142,7 @@ namespace OpenRCT2::Ui::Windows auto* currentRide = GetRide(_rideableRides[i]); if (currentRide != nullptr) { - if (currentRide->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) + if (currentRide->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE) { auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark; DrawText( @@ -1153,7 +1153,7 @@ namespace OpenRCT2::Ui::Windows // Ride name Formatter ft; - currentRide->FormatNameTo(ft); + currentRide->formatNameTo(ft); DrawTextBasic(dpi, { 15, y }, stringId, ft); } } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 4686af8abc..e78bdae046 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -722,7 +722,7 @@ namespace OpenRCT2::Ui::Windows auto campaignRide = GetRide(marketingCampaign->RideId); if (campaignRide != nullptr) { - campaignRide->FormatNameTo(ft); + campaignRide->formatNameTo(ft); } else { diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 51fc04377c..b17084df12 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1231,7 +1231,7 @@ namespace OpenRCT2::Ui::Windows _riddenRides.clear(); for (const auto& r : GetRideManager()) { - if (r.IsRide() && guest->HasRidden(r)) + if (r.isRide() && guest->HasRidden(r)) { _riddenRides.push_back(r.id); } @@ -1327,7 +1327,7 @@ namespace OpenRCT2::Ui::Windows auto* r = GetRide(peep->FavouriteRide); if (r != nullptr) { - r->FormatNameTo(ft); + r->formatNameTo(ft); } else { @@ -1356,7 +1356,7 @@ namespace OpenRCT2::Ui::Windows if (r != nullptr) { auto ft = Formatter(); - r->FormatNameTo(ft); + r->formatNameTo(ft); DrawTextBasic(dpi, { 0, y - 1 }, stringId, ft); } } @@ -1641,7 +1641,7 @@ namespace OpenRCT2::Ui::Windows { ft.Rewind(); ft.Increment(2); - invRide->FormatNameTo(ft); + invRide->formatNameTo(ft); } break; @@ -1665,7 +1665,7 @@ namespace OpenRCT2::Ui::Windows ft.Rewind(); ft.Increment(2); ft.Add(STR_PEEP_INVENTORY_VOUCHER_RIDE_FREE); - invRide->FormatNameTo(ft); + invRide->formatNameTo(ft); } break; case VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE: @@ -1695,7 +1695,7 @@ namespace OpenRCT2::Ui::Windows { ft.Rewind(); ft.Increment(2); - invRide->FormatNameTo(ft); + invRide->formatNameTo(ft); } break; case ShopItem::Photo3: @@ -1704,7 +1704,7 @@ namespace OpenRCT2::Ui::Windows { ft.Rewind(); ft.Increment(2); - invRide->FormatNameTo(ft); + invRide->formatNameTo(ft); } break; case ShopItem::Photo4: @@ -1713,7 +1713,7 @@ namespace OpenRCT2::Ui::Windows { ft.Rewind(); ft.Increment(2); - invRide->FormatNameTo(ft); + invRide->formatNameTo(ft); } break; default: diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 5035f66edd..961bc300e8 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -192,8 +192,8 @@ namespace OpenRCT2::Ui::Windows if (guestRide != nullptr) { ft.Add( - guestRide->GetRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? STR_IN_RIDE : STR_ON_RIDE); - guestRide->FormatNameTo(ft); + guestRide->getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? STR_IN_RIDE : STR_ON_RIDE); + guestRide->formatNameTo(ft); _selectedFilter = GuestFilterType::Guests; _highlightedIndex = {}; @@ -208,7 +208,7 @@ namespace OpenRCT2::Ui::Windows if (guestRide != nullptr) { ft.Add(STR_QUEUING_FOR); - guestRide->FormatNameTo(ft); + guestRide->formatNameTo(ft); _selectedFilter = GuestFilterType::Guests; _highlightedIndex = {}; @@ -223,7 +223,7 @@ namespace OpenRCT2::Ui::Windows if (guestRide != nullptr) { ft.Add(kStringIdNone); - guestRide->FormatNameTo(ft); + guestRide->formatNameTo(ft); _selectedFilter = GuestFilterType::GuestsThinking; _highlightedIndex = {}; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 0e1fa3ed22..2db2a48ffe 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -926,7 +926,7 @@ namespace OpenRCT2::Ui::Windows Ride* targetRide = GetRide(tileElement->AsEntrance()->GetRideIndex()); if (targetRide != nullptr) { - const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; + const auto& colourKey = targetRide->getRideTypeDescriptor().ColourKey; colourA = RideKeyColours[EnumValue(colourKey)]; } break; @@ -936,7 +936,7 @@ namespace OpenRCT2::Ui::Windows Ride* targetRide = GetRide(tileElement->AsTrack()->GetRideIndex()); if (targetRide != nullptr) { - const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; + const auto& colourKey = targetRide->getRideTypeDescriptor().ColourKey; colourA = RideKeyColours[EnumValue(colourKey)]; } diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index c3762c96bd..c4695c388f 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -129,7 +129,7 @@ namespace OpenRCT2::Ui::Windows auto currentRide = GetRide(_currentRideIndex); if (currentRide != nullptr) { - if (currentRide->overall_view.IsNull()) + if (currentRide->overallView.IsNull()) { auto gameAction = RideDemolishAction(currentRide->id, RideModifyType::demolish); gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); @@ -292,7 +292,7 @@ namespace OpenRCT2::Ui::Windows if (currentRide != nullptr) { ft.Increment(4); - currentRide->FormatNameTo(ft); + currentRide->formatNameTo(ft); } else { @@ -373,7 +373,7 @@ namespace OpenRCT2::Ui::Windows if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful) { ToolCancel(); - if (!currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { windowMgr->CloseByClass(WindowClass::RideConstruction); } diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index a3a9fc1e76..d87f4d62f3 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -95,12 +95,12 @@ namespace OpenRCT2::Ui::Windows std::string rideAName = ""; auto rideA = GetRide(a); if (rideA != nullptr) - rideAName = rideA->GetName(); + rideAName = rideA->getName(); std::string rideBName = ""; auto rideB = GetRide(b); if (rideB != nullptr) - rideBName = rideB->GetName(); + rideBName = rideB->getName(); return String::logicalCmp(rideAName.c_str(), rideBName.c_str()) < 0; } @@ -114,7 +114,7 @@ namespace OpenRCT2::Ui::Windows BitSet items = {}; for (auto& curRide : GetRideManager()) { - auto rideEntry = curRide.GetRideEntry(); + auto rideEntry = curRide.getRideEntry(); if (rideEntry != nullptr) { for (const auto itemType : rideEntry->shop_item) @@ -146,7 +146,7 @@ namespace OpenRCT2::Ui::Windows { if (curRide.status == RideStatus::open) { - const auto& rtd = curRide.GetRideTypeDescriptor(); + const auto& rtd = curRide.getRideTypeDescriptor(); if (rtd.HasFlag(RtdFlag::isShopOrFacility)) continue; if (rtd.HasFlag(RtdFlag::sellsFood)) @@ -234,14 +234,14 @@ namespace OpenRCT2::Ui::Windows // HACK until dropdown items have longer argument buffers gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; Formatter ft(reinterpret_cast(&gDropdownItems[numItems].Args)); - if (curRide->custom_name.empty()) + if (curRide->customName.empty()) { - curRide->FormatNameTo(ft); + curRide->formatNameTo(ft); } else { gDropdownItems[numItems].Format = STR_OPTIONS_DROPDOWN_ITEM; - ft.Add(curRide->custom_name.c_str()); + ft.Add(curRide->customName.c_str()); } numItems++; } @@ -337,7 +337,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_RIDE_DROPDOWN].text = STR_STRINGID; auto ft = Formatter::Common(); - curRide->FormatNameTo(ft); + curRide->formatNameTo(ft); } } break; diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index 6666118d47..ae5239d089 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -84,7 +84,7 @@ namespace OpenRCT2::Ui::Windows auto stringId = (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY : STR_REFURBISH_RIDE_ID_MONEY; auto ft = Formatter(); - currentRide->FormatNameTo(ft); + currentRide->formatNameTo(ft); ft.Add(_demolishRideCost / 2); ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e34bc1fa99..e45a786ef6 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -661,15 +661,14 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return 0; - auto* rideEntry = ride->GetRideEntry(); + auto* rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return 0; uint8_t numItems = 0; - for (auto i = 0; i < ride->num_cars_per_train; i++) + for (auto i = 0; i < ride->numCarsPerTrain; i++) { - const auto& carEntry = rideEntry - ->Cars[RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, i)]; + const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition(ride->subtype, ride->numCarsPerTrain, i)]; if (carEntry.isVisible()) numItems++; } @@ -683,17 +682,17 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr || ride->vehicleColourSettings != VehicleColourSettings::perCar) return dropdownIndex; - auto* rideEntry = ride->GetRideEntry(); + auto* rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return dropdownIndex; // `dropdownIndex` will contain a number picked from the visible cars. // Convert this to the actual index. auto carDropdownIndex = -1; - for (auto carIndex = 0; carIndex < ride->num_cars_per_train; carIndex++) + for (auto carIndex = 0; carIndex < ride->numCarsPerTrain; carIndex++) { const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, carIndex)]; + ride->subtype, ride->numCarsPerTrain, carIndex)]; if (!carEntry.isVisible()) continue; @@ -714,17 +713,17 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr || ride->vehicleColourSettings != VehicleColourSettings::perCar) return selectedCarIndex; - auto* rideEntry = ride->GetRideEntry(); + auto* rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return selectedCarIndex; // `selectedCarIndex` will contain an offset that includes invisible cars. // Convert this to the corresponding dropdown index of actually visible cars. auto carDropdownIndex = -1; - for (auto carIndex = 0; carIndex < ride->num_cars_per_train; carIndex++) + for (auto carIndex = 0; carIndex < ride->numCarsPerTrain; carIndex++) { const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, carIndex)]; + ride->subtype, ride->numCarsPerTrain, carIndex)]; if (!carEntry.isVisible()) continue; @@ -1220,7 +1219,7 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { int32_t spriteIndex = 0; - switch (ride->GetClassification()) + switch (ride->getClassification()) { case RideClassification::ride: spriteIndex = SPR_TAB_RIDE_0; @@ -1272,7 +1271,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -1286,12 +1285,12 @@ namespace OpenRCT2::Ui::Windows } // For any suspended rides, move image higher in the vehicle tab on the rides window - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isSuspended)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::isSuspended)) { screenCoords.y /= 4; } - const auto vehicle = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, rideEntry->TabCar); + const auto vehicle = RideEntryGetVehicleAtPosition(ride->subtype, ride->numCarsPerTrain, rideEntry->TabCar); const auto& carEntry = rideEntry->Cars[vehicle]; auto vehicleId = (ride->vehicleColourSettings == VehicleColourSettings::perCar) ? rideEntry->TabCar : 0; @@ -1351,7 +1350,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (!rtd.HasFlag(RtdFlag::hasDataLogging)) disabledTabs |= (1uLL << WIDX_TAB_8); // 0x800 @@ -1481,17 +1480,17 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return std::nullopt; - int32_t viewSelectionIndex = _viewIndex - 1 - ride->NumTrains; + int32_t viewSelectionIndex = _viewIndex - 1 - ride->numTrains; if (viewSelectionIndex < 0) { return std::nullopt; } - for (const auto& station : ride->GetStations()) + for (const auto& station : ride->getStations()) { if (!station.Start.IsNull() && viewSelectionIndex-- == 0) { - const auto stationIndex = ride->GetStationIndex(&station); + const auto stationIndex = ride->getStationIndex(&station); return std::make_optional(stationIndex); } } @@ -1511,11 +1510,11 @@ namespace OpenRCT2::Ui::Windows std::optional newFocus; - if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->NumTrains - && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->numTrains + && ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { auto vehId = ride->vehicles[viewSelectionIndex]; - const auto* rideEntry = ride->GetRideEntry(); + const auto* rideEntry = ride->getRideEntry(); if (rideEntry != nullptr && rideEntry->TabCar != 0) { Vehicle* vehicle = GetEntity(vehId); @@ -1533,12 +1532,12 @@ namespace OpenRCT2::Ui::Windows newFocus = Focus(vehId); } } - else if (viewSelectionIndex >= ride->NumTrains && viewSelectionIndex < (ride->NumTrains + ride->num_stations)) + else if (viewSelectionIndex >= ride->numTrains && viewSelectionIndex < (ride->numTrains + ride->numStations)) { auto stationIndex = GetStationIndexFromViewSelection(); if (stationIndex) { - const auto location = ride->GetStation(*stationIndex).GetStart(); + const auto location = ride->getStation(*stationIndex).GetStart(); newFocus = Focus(location); } } @@ -1575,7 +1574,7 @@ namespace OpenRCT2::Ui::Windows focus = newFocus; // rct2: 0x006aec9c only used here so brought it into the function - if (viewport == nullptr && !ride->overall_view.IsNull() && focus.has_value()) + if (viewport == nullptr && !ride->overallView.IsNull() && focus.has_value()) { const auto& viewWidget = widgets[WIDX_VIEWPORT]; @@ -1600,7 +1599,7 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - auto rideName = ride->GetName(); + auto rideName = ride->getName(); WindowTextInputRawOpen( this, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, {}, rideName.c_str(), 32); @@ -1691,12 +1690,12 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { #ifdef __SIMULATE_IN_RIDE_WINDOW__ - if (ride->SupportsStatus(RideStatus::simulating)) + if (ride->supportsStatus(RideStatus::simulating)) { minHeight += 14; } #endif - if (ride->SupportsStatus(RideStatus::testing)) + if (ride->supportsStatus(RideStatus::testing)) { minHeight += 14; } @@ -1728,10 +1727,10 @@ namespace OpenRCT2::Ui::Windows bool TrainMustBeHidden(const Ride& ride, int32_t trainIndex) const { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) return true; - const auto* rideEntry = ride.GetRideEntry(); + const auto* rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return false; @@ -1748,13 +1747,13 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); int32_t numItems = 1; if (!rtd.HasFlag(RtdFlag::noVehicles)) { - numItems += ride->num_stations; - numItems += ride->NumTrains; + numItems += ride->numStations; + numItems += ride->numTrains; } WindowDropdownShowTextCustomWidth( @@ -1768,7 +1767,7 @@ namespace OpenRCT2::Ui::Windows // Vehicles int32_t name = GetRideComponentName(rtd.NameConvention.vehicle).number; - for (int32_t i = 0; i < ride->NumTrains; i++) + for (int32_t i = 0; i < ride->numTrains; i++) { gDropdownItems[currentItem].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[currentItem].Args = name | (currentItem << 16); @@ -1781,7 +1780,7 @@ namespace OpenRCT2::Ui::Windows // Stations name = GetRideComponentName(rtd.NameConvention.station).number; - for (int32_t i = 1; i <= ride->num_stations; i++) + for (int32_t i = 1; i <= ride->numStations; i++) { gDropdownItems[currentItem].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[currentItem].Args = name | (i << 16); @@ -1798,12 +1797,12 @@ namespace OpenRCT2::Ui::Windows { default: case RideStatus::closed: - if ((ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED) - || (ride.lifecycle_flags & RIDE_LIFECYCLE_HAS_STALLED_VEHICLE)) + if ((ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED) + || (ride.lifecycleFlags & RIDE_LIFECYCLE_HAS_STALLED_VEHICLE)) { return RideStatus::closed; } - if (ride.SupportsStatus(RideStatus::testing) && !(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (ride.supportsStatus(RideStatus::testing) && !(ride.lifecycleFlags & RIDE_LIFECYCLE_TESTED)) { return RideStatus::testing; } @@ -1811,7 +1810,7 @@ namespace OpenRCT2::Ui::Windows case RideStatus::simulating: return RideStatus::testing; case RideStatus::testing: - return (ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED) ? RideStatus::open : RideStatus::closed; + return (ride.lifecycleFlags & RIDE_LIFECYCLE_TESTED) ? RideStatus::open : RideStatus::closed; case RideStatus::open: return RideStatus::closed; } @@ -1830,7 +1829,7 @@ namespace OpenRCT2::Ui::Windows void SetDropdown(RideStatusDropdownInfo& info, RideStatus status, StringId text) const { - if (info.Ride->SupportsStatus(status)) + if (info.Ride->supportsStatus(status)) { auto index = info.NumItems; gDropdownItems[index].Format = STR_DROPDOWN_MENU_LABEL; @@ -1963,7 +1962,7 @@ namespace OpenRCT2::Ui::Windows WindowDropdownShowText( { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 2); gDropdownDefaultIndex = 0; - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack) || _viewIndex == 0 || _viewIndex > ride->NumTrains) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack) || _viewIndex == 0 || _viewIndex > ride->numTrains) { // Disable if we're a flat ride, 'overall view' is selected or a station is selected Dropdown::SetDisabled(1, true); @@ -1975,11 +1974,11 @@ namespace OpenRCT2::Ui::Windows auto* ride = GetRide(rideId); if (ride != nullptr) { - if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) + if (!(ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_MAIN)) { if (_viewIndex > 0) { - if (_viewIndex <= ride->NumTrains) + if (_viewIndex <= ride->numTrains) { Vehicle* vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); if (vehicle != nullptr) @@ -1997,13 +1996,13 @@ namespace OpenRCT2::Ui::Windows void PopulateVehicleTypeDropdown(const Ride& ride, bool forceRefresh = false) { auto& objManager = GetContext()->GetObjectManager(); - const auto* rideEntry = ride.GetRideEntry(); + const auto* rideEntry = ride.getRideEntry(); bool selectionShouldBeExpanded; ride_type_t rideTypeIterator, rideTypeIteratorMax; const auto& gameState = GetGameState(); - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (gameState.Cheats.showVehiclesFromOtherTrackTypes && !( rtd.HasFlag(RtdFlag::isFlatRide) || rtd.specialType == RtdSpecialType::maze @@ -2137,7 +2136,7 @@ namespace OpenRCT2::Ui::Windows { gDropdownItems[i].Args = _entranceDropdownData[i].LabelId; gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - if (_entranceDropdownData[i].EntranceTypeId == ride->entrance_style) + if (_entranceDropdownData[i].EntranceTypeId == ride->entranceStyle) gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL_SELECTED; } @@ -2177,10 +2176,10 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - if (dropdownIndex != 0 && dropdownIndex <= ride->NumTrains - && !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (dropdownIndex != 0 && dropdownIndex <= ride->numTrains + && !(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) { - dropdownIndex = ride->NumTrains + 1; + dropdownIndex = ride->numTrains + 1; } if (dropdownIndex >= gDropdownNumItems) { @@ -2271,12 +2270,12 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) + if (!(ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_MAIN)) { if (_viewIndex == 0) return; - if (_viewIndex <= ride->NumTrains) + if (_viewIndex <= ride->numTrains) { Vehicle* vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); if (vehicle == nullptr @@ -2289,7 +2288,7 @@ namespace OpenRCT2::Ui::Windows } } } - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAIN; + ride->windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_MAIN; } InvalidateWidget(WIDX_STATUS); } @@ -2325,12 +2324,12 @@ namespace OpenRCT2::Ui::Windows const auto& gameState = GetGameState(); disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); - if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + if (ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && !gameState.Cheats.makeAllDestructible) disabled_widgets |= (1uLL << WIDX_DEMOLISH); auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); uint32_t spriteIds[] = { SPR_CLOSED, @@ -2391,7 +2390,7 @@ namespace OpenRCT2::Ui::Windows else { widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_RIDE_TYPE].text = ride->GetRideTypeDescriptor().Naming.Name; + widgets[WIDX_RIDE_TYPE].text = ride->getRideTypeDescriptor().Naming.Name; widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button; } @@ -2403,10 +2402,10 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::Empty; #ifdef __SIMULATE_IN_RIDE_WINDOW__ - if (ride->SupportsStatus(RideStatus::simulating)) + if (ride->supportsStatus(RideStatus::simulating)) widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::ImgBtn; #endif - widgets[WIDX_TEST_LIGHT].type = ride->SupportsStatus(RideStatus::testing) ? WindowWidgetType::ImgBtn + widgets[WIDX_TEST_LIGHT].type = ride->supportsStatus(RideStatus::testing) ? WindowWidgetType::ImgBtn : WindowWidgetType::Empty; widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; @@ -2456,9 +2455,9 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - ride->FormatStatusTo(ft); + ride->formatStatusTo(ft); stringId = STR_BLACK_STRING; - if ((ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) || (ride->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if ((ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) || (ride->lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { stringId = STR_RED_OUTLINED_STRING; } @@ -2476,7 +2475,7 @@ namespace OpenRCT2::Ui::Windows if (vehicle == nullptr) return kStringIdEmpty; - auto& rtd = ride->GetRideTypeDescriptor(); + auto& rtd = ride->getRideTypeDescriptor(); if (vehicle->status != Vehicle::Status::Crashing && vehicle->status != Vehicle::Status::Crashed) { auto trackType = vehicle->GetTrackType(); @@ -2497,7 +2496,7 @@ namespace OpenRCT2::Ui::Windows return kStringIdEmpty; auto stringId = VehicleStatusNames[EnumValue(vehicle->status)]; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::singleSession) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::singleSession) && vehicle->status <= Vehicle::Status::UnloadingPassengers) { stringId = SingleSessionVehicleStatusNames[EnumValue(vehicle->status)]; @@ -2506,8 +2505,8 @@ namespace OpenRCT2::Ui::Windows ft.Add(stringId); uint16_t speedInMph = ToHumanReadableSpeed(abs(vehicle->velocity)); ft.Add(speedInMph); - const RideComponentName stationName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station); - ft.Add(ride->num_stations > 1 ? stationName.number : stationName.singular); + const RideComponentName stationName = GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.station); + ft.Add(ride->numStations > 1 ? stationName.number : stationName.singular); ft.Add(vehicle->current_station.ToUnderlying() + 1); if (stringId != STR_CRASHING && stringId != STR_CRASHED_0) @@ -2528,7 +2527,7 @@ namespace OpenRCT2::Ui::Windows return kStringIdNone; } - const auto& station = ride->GetStation(*stationIndex); + const auto& station = ride->getStation(*stationIndex); StringId stringId = kStringIdEmpty; // Entrance / exit if (ride->status == RideStatus::closed) @@ -2547,7 +2546,7 @@ namespace OpenRCT2::Ui::Windows if (stringId == kStringIdEmpty) { stringId = STR_QUEUE_EMPTY; - uint16_t queueLength = ride->GetStation(*stationIndex).QueueLength; + uint16_t queueLength = ride->getStation(*stationIndex).QueueLength; if (queueLength == 1) stringId = STR_QUEUE_ONE_PERSON; else if (queueLength > 1) @@ -2569,9 +2568,9 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (_viewIndex == 0) return GetStatusOverallView(ft); - if (ride != nullptr && _viewIndex <= ride->NumTrains) + if (ride != nullptr && _viewIndex <= ride->numTrains) return GetStatusVehicle(ft); - if (ride != nullptr && ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride != nullptr && ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) return GetStatusOverallView(ft); return GetStatusStation(ft); } @@ -2597,14 +2596,14 @@ namespace OpenRCT2::Ui::Windows auto ft = Formatter(); if (_viewIndex != 0) { - if (_viewIndex > ride->NumTrains) + if (_viewIndex > ride->numTrains) { - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number); - ft.Add(_viewIndex - ride->NumTrains); + ft.Add(GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.station).number); + ft.Add(_viewIndex - ride->numTrains); } else { - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); + ft.Add(GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.vehicle).number); ft.Add(_viewIndex); } } @@ -2671,23 +2670,23 @@ namespace OpenRCT2::Ui::Windows ShowVehicleTypeDropdown(&widgets[widgetIndex]); break; case WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX: - ride->SetReversedTrains(!ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)); + ride->setReversedTrains(!ride->hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)); break; case WIDX_VEHICLE_TRAINS_INCREASE: - if (ride->NumTrains < OpenRCT2::Limits::kMaxTrainsPerRide) - ride->SetNumTrains(ride->NumTrains + 1); + if (ride->numTrains < OpenRCT2::Limits::kMaxTrainsPerRide) + ride->setNumTrains(ride->numTrains + 1); break; case WIDX_VEHICLE_TRAINS_DECREASE: - if (ride->NumTrains > 1) - ride->SetNumTrains(ride->NumTrains - 1); + if (ride->numTrains > 1) + ride->setNumTrains(ride->numTrains - 1); break; case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE: - if (ride->num_cars_per_train < OpenRCT2::Limits::kMaxCarsPerTrain) - ride->SetNumCarsPerVehicle(ride->num_cars_per_train + 1); + if (ride->numCarsPerTrain < OpenRCT2::Limits::kMaxCarsPerTrain) + ride->setNumCarsPerTrain(ride->numCarsPerTrain + 1); break; case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: - if (ride->num_cars_per_train > 1) - ride->SetNumCarsPerVehicle(ride->num_cars_per_train - 1); + if (ride->numCarsPerTrain > 1) + ride->setNumCarsPerTrain(ride->numCarsPerTrain - 1); break; } } @@ -2706,7 +2705,7 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { auto newRideType = _vehicleDropdownData[dropdownIndex].SubTypeId; - ride->SetRideEntry(newRideType); + ride->setRideEntry(newRideType); } } break; @@ -2735,30 +2734,30 @@ namespace OpenRCT2::Ui::Windows auto ft = Formatter(); ft.Increment(12); - RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; + RideComponentType vehicleType = ride->getRideTypeDescriptor().NameConvention.vehicle; StringId stringId = GetRideComponentName(vehicleType).count; - if (ride->max_trains > 1) + if (ride->maxTrains > 1) { stringId = GetRideComponentName(vehicleType).count_plural; } ft.Add(stringId); - ft.Add(ride->max_trains); + ft.Add(ride->maxTrains); return { fallback, ft }; } case WIDX_VEHICLE_CARS_PER_TRAIN: case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE: { - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return { kStringIdNone, {} }; auto ft = Formatter(); ft.Increment(16); - ft.Add(std::max(uint8_t(1), ride->MaxCarsPerTrain) - rideEntry->zero_cars); + ft.Add(std::max(uint8_t(1), ride->maxCarsPerTrain) - rideEntry->zero_cars); StringId stringId = GetRideComponentName(RideComponentType::Car).singular; - if (ride->MaxCarsPerTrain - rideEntry->zero_cars > 1) + if (ride->maxCarsPerTrain - rideEntry->zero_cars > 1) { stringId = GetRideComponentName(RideComponentType::Car).plural; } @@ -2780,12 +2779,12 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - const auto* rideEntry = ride->GetRideEntry(); + const auto* rideEntry = ride->getRideEntry(); widgets[WIDX_TITLE].text = STR_ARG_20_STRINGID; // Widget setup - carsPerTrain = ride->num_cars_per_train - rideEntry->zero_cars; + carsPerTrain = ride->numCarsPerTrain - rideEntry->zero_cars; // Vehicle type widgets[WIDX_VEHICLE_TYPE].text = rideEntry->naming.Name; @@ -2819,11 +2818,11 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE].type = WindowWidgetType::Empty; } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::allowReversedTrains) - || (gameState.Cheats.disableTrainLengthLimit && !ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide))) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::allowReversedTrains) + || (gameState.Cheats.disableTrainLengthLimit && !ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide))) { widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Checkbox; - if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) + if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) { pressed_widgets |= (1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); } @@ -2840,23 +2839,23 @@ namespace OpenRCT2::Ui::Windows auto ft = Formatter::Common(); ft.Increment(6); ft.Add(carsPerTrain); - RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; + RideComponentType vehicleType = ride->getRideTypeDescriptor().NameConvention.vehicle; stringId = GetRideComponentName(vehicleType).count; - if (ride->NumTrains > 1) + if (ride->numTrains > 1) { stringId = GetRideComponentName(vehicleType).count_plural; } ft.Add(stringId); - ft.Add(ride->NumTrains); + ft.Add(ride->numTrains); ft.Increment(8); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); AnchorBorderWidgets(); WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - if (abs(ride->num_cars_per_train - rideEntry->zero_cars) == 1) + if (abs(ride->numCarsPerTrain - rideEntry->zero_cars) == 1) { widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_1_CAR_PER_TRAIN; } @@ -2875,7 +2874,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -2959,24 +2958,24 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - const auto* rideEntry = ride->GetRideEntry(); + const auto* rideEntry = ride->getRideEntry(); // Background GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, PALETTE_INDEX_12); Widget* widget = &widgets[WIDX_VEHICLE_TRAINS_PREVIEW]; - int32_t startX = std::max(2, (widget->width() - ((ride->NumTrains - 1) * 36)) / 2 - 25); + int32_t startX = std::max(2, (widget->width() - ((ride->numTrains - 1) * 36)) / 2 - 25); int32_t startY = widget->height() - 4; - bool isReversed = ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS); - int32_t carIndex = (isReversed) ? ride->num_cars_per_train - 1 : 0; + bool isReversed = ride->hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS); + int32_t carIndex = (isReversed) ? ride->numCarsPerTrain - 1 : 0; const auto& firstCarEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, carIndex)]; + ride->subtype, ride->numCarsPerTrain, carIndex)]; startY += firstCarEntry.tab_height; // For each train - for (int32_t i = 0; i < ride->NumTrains; i++) + for (int32_t i = 0; i < ride->numTrains; i++) { VehicleDrawInfo trainCarImages[OpenRCT2::Limits::kMaxCarsPerTrain]; VehicleDrawInfo* nextSpriteToDraw = trainCarImages; @@ -2984,13 +2983,13 @@ namespace OpenRCT2::Ui::Windows int32_t y = startY; // For each car in train - static_assert(std::numeric_limitsnum_cars_per_train)>::max() <= std::size(trainCarImages)); - for (int32_t j = 0; j < ride->num_cars_per_train; j++) + static_assert(std::numeric_limitsnumCarsPerTrain)>::max() <= std::size(trainCarImages)); + for (int32_t j = 0; j < ride->numCarsPerTrain; j++) { - carIndex = (isReversed) ? (ride->num_cars_per_train - 1) - j : j; + carIndex = (isReversed) ? (ride->numCarsPerTrain - 1) - j : j; const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, carIndex)]; + ride->subtype, ride->numCarsPerTrain, carIndex)]; x += carEntry.spacing / 17432; y -= (carEntry.spacing / 2) / 17432; @@ -3034,7 +3033,7 @@ namespace OpenRCT2::Ui::Windows y -= (carEntry.spacing / 2) / 17432; } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::layeredVehiclePreview)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::layeredVehiclePreview)) { VehicleDrawInfo tmp = *(nextSpriteToDraw - 1); *(nextSpriteToDraw - 1) = *(nextSpriteToDraw - 2); @@ -3059,7 +3058,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + const auto& operatingSettings = ride->getRideTypeDescriptor().OperatingSettings; const auto& gameState = GetGameState(); uint8_t maxValue = operatingSettings.MaxValue; uint8_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue; @@ -3072,7 +3071,7 @@ namespace OpenRCT2::Ui::Windows uint8_t increment = ride->mode == RideMode::dodgems ? 10 : 1; SetOperatingSetting( - rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); + rideId, RideSetSetting::Operation, std::clamp(ride->operationOption + increment, minValue, maxValue)); } void ModeTweakDecrease() @@ -3081,7 +3080,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + const auto& operatingSettings = ride->getRideTypeDescriptor().OperatingSettings; const auto& gameState = GetGameState(); uint8_t maxValue = operatingSettings.MaxValue; uint8_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue; @@ -3093,7 +3092,7 @@ namespace OpenRCT2::Ui::Windows uint8_t decrement = ride->mode == RideMode::dodgems ? 10 : 1; SetOperatingSetting( - rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); + rideId, RideSetSetting::Operation, std::clamp(ride->operationOption - decrement, minValue, maxValue)); } void ModeDropdown(Widget* widget) @@ -3105,7 +3104,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto availableModes = ride->GetAvailableModes(); + auto availableModes = ride->getAvailableModes(); // Create dropdown list auto numAvailableModes = 0; @@ -3150,7 +3149,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, 5, widget->right - dropdownWidget->left); - Dropdown::SetChecked(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK, true); + Dropdown::SetChecked(ride->departFlags & RIDE_DEPART_WAIT_FOR_LOAD_MASK, true); } void OperatingOnMouseUp(WidgetIndex widgetIndex) @@ -3177,23 +3176,23 @@ namespace OpenRCT2::Ui::Windows SetPage(widgetIndex - WIDX_TAB_1); break; case WIDX_LOAD_CHECKBOX: - SetOperatingSetting(rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_LOAD); + SetOperatingSetting(rideId, RideSetSetting::Departure, ride->departFlags ^ RIDE_DEPART_WAIT_FOR_LOAD); break; case WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX: SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES); + rideId, RideSetSetting::Departure, ride->departFlags ^ RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES); break; case WIDX_MINIMUM_LENGTH_CHECKBOX: SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH); + rideId, RideSetSetting::Departure, ride->departFlags ^ RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH); break; case WIDX_MAXIMUM_LENGTH_CHECKBOX: SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH); + rideId, RideSetSetting::Departure, ride->departFlags ^ RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH); break; case WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX: SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS); + rideId, RideSetSetting::Departure, ride->departFlags ^ RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS); break; } } @@ -3225,24 +3224,24 @@ namespace OpenRCT2::Ui::Windows case WIDX_LIFT_HILL_SPEED_INCREASE: upperBound = GetGameState().Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit - : ride->GetRideTypeDescriptor().LiftData.maximum_speed; + : ride->getRideTypeDescriptor().LiftData.maximum_speed; lowerBound = GetGameState().Cheats.unlockOperatingLimits ? 0 - : ride->GetRideTypeDescriptor().LiftData.minimum_speed; + : ride->getRideTypeDescriptor().LiftData.minimum_speed; SetOperatingSetting( rideId, RideSetSetting::LiftHillSpeed, - std::clamp(ride->lift_hill_speed + 1, lowerBound, upperBound)); + std::clamp(ride->liftHillSpeed + 1, lowerBound, upperBound)); break; case WIDX_LIFT_HILL_SPEED_DECREASE: upperBound = GetGameState().Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit - : ride->GetRideTypeDescriptor().LiftData.maximum_speed; + : ride->getRideTypeDescriptor().LiftData.maximum_speed; lowerBound = GetGameState().Cheats.unlockOperatingLimits ? 0 - : ride->GetRideTypeDescriptor().LiftData.minimum_speed; + : ride->getRideTypeDescriptor().LiftData.minimum_speed; SetOperatingSetting( rideId, RideSetSetting::LiftHillSpeed, - std::clamp(ride->lift_hill_speed - 1, lowerBound, upperBound)); + std::clamp(ride->liftHillSpeed - 1, lowerBound, upperBound)); break; case WIDX_MINIMUM_LENGTH: OperatingLengthWindow(WIDX_MINIMUM_LENGTH); @@ -3255,28 +3254,28 @@ namespace OpenRCT2::Ui::Windows lowerBound = 0; SetOperatingSetting( rideId, RideSetSetting::MinWaitingTime, - std::clamp(ride->min_waiting_time + 1, lowerBound, upperBound)); + std::clamp(ride->minWaitingTime + 1, lowerBound, upperBound)); break; case WIDX_MINIMUM_LENGTH_DECREASE: upperBound = OpenRCT2::Limits::kMaxWaitingTime; lowerBound = 0; SetOperatingSetting( rideId, RideSetSetting::MinWaitingTime, - std::clamp(ride->min_waiting_time - 1, lowerBound, upperBound)); + std::clamp(ride->minWaitingTime - 1, lowerBound, upperBound)); break; case WIDX_MAXIMUM_LENGTH_INCREASE: upperBound = OpenRCT2::Limits::kMaxWaitingTime; lowerBound = 0; SetOperatingSetting( rideId, RideSetSetting::MaxWaitingTime, - std::clamp(ride->max_waiting_time + 1, lowerBound, upperBound)); + std::clamp(ride->maxWaitingTime + 1, lowerBound, upperBound)); break; case WIDX_MAXIMUM_LENGTH_DECREASE: upperBound = OpenRCT2::Limits::kMaxWaitingTime; lowerBound = 0; SetOperatingSetting( rideId, RideSetSetting::MaxWaitingTime, - std::clamp(ride->max_waiting_time - 1, lowerBound, upperBound)); + std::clamp(ride->maxWaitingTime - 1, lowerBound, upperBound)); break; case WIDX_MODE_DROPDOWN: ModeDropdown(&widgets[widgetIndex]); @@ -3290,7 +3289,7 @@ namespace OpenRCT2::Ui::Windows lowerBound = 1; SetOperatingSetting( rideId, RideSetSetting::NumCircuits, - std::clamp(ride->num_circuits + 1, lowerBound, upperBound)); + std::clamp(ride->numCircuits + 1, lowerBound, upperBound)); break; case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE: upperBound = GetGameState().Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit @@ -3298,7 +3297,7 @@ namespace OpenRCT2::Ui::Windows lowerBound = 1; SetOperatingSetting( rideId, RideSetSetting::NumCircuits, - std::clamp(ride->num_circuits - 1, lowerBound, upperBound)); + std::clamp(ride->numCircuits - 1, lowerBound, upperBound)); break; } } @@ -3315,7 +3314,7 @@ namespace OpenRCT2::Ui::Windows ft.Add(lowerBound); ft.Add(upperBound); auto title = (widgetIndex == WIDX_MINIMUM_LENGTH) ? STR_MINIMUM_WAITING_TIME : STR_MAXIMUM_WAITING_TIME; - auto currentValue = (widgetIndex == WIDX_MINIMUM_LENGTH) ? ride->min_waiting_time : ride->max_waiting_time; + auto currentValue = (widgetIndex == WIDX_MINIMUM_LENGTH) ? ride->minWaitingTime : ride->maxWaitingTime; char buffer[5]{}; snprintf(buffer, std::size(buffer), "%u", currentValue); WindowTextInputRawOpen(this, widgetIndex, title, STR_ENTER_VALUE, ft, buffer, 4); @@ -3336,7 +3335,7 @@ namespace OpenRCT2::Ui::Windows break; } - const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; + const auto& operatingSettings = ride.getRideTypeDescriptor().OperatingSettings; const auto& gameState = GetGameState(); int16_t maxValue = gameState.Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit : operatingSettings.MaxValue; @@ -3347,7 +3346,7 @@ namespace OpenRCT2::Ui::Windows ft.Add(minValue * operatingSettings.OperatingSettingMultiplier); ft.Add(maxValue * operatingSettings.OperatingSettingMultiplier); - uint16_t currentValue = static_cast(ride.operation_option) * operatingSettings.OperatingSettingMultiplier; + uint16_t currentValue = static_cast(ride.operationOption) * operatingSettings.OperatingSettingMultiplier; char buffer[6]{}; snprintf(buffer, std::size(buffer), "%u", currentValue); @@ -3368,7 +3367,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_MODE_DROPDOWN: { RideMode rideMode = RideMode::nullMode; - auto availableModes = ride->GetAvailableModes(); + auto availableModes = ride->getAvailableModes(); auto modeInDropdownIndex = -1; for (RideMode rideModeIndex = RideMode::normal; rideModeIndex < RideMode::count; rideModeIndex++) { @@ -3389,7 +3388,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_LOAD_DROPDOWN: SetOperatingSetting( rideId, RideSetSetting::Departure, - (ride->depart_flags & ~RIDE_DEPART_WAIT_FOR_LOAD_MASK) | dropdownIndex); + (ride->departFlags & ~RIDE_DEPART_WAIT_FOR_LOAD_MASK) | dropdownIndex); break; } } @@ -3401,9 +3400,9 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(WIDX_TAB_3); auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) + if (ride != nullptr && ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_OPERATING) { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_OPERATING; + ride->windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_OPERATING; Invalidate(); } } @@ -3419,12 +3418,12 @@ namespace OpenRCT2::Ui::Windows if (widgetIndex == WIDX_MODE_TWEAK) { - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + const auto& operatingSettings = ride->getRideTypeDescriptor().OperatingSettings; const auto& gameState = GetGameState(); uint32_t maxValue = gameState.Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit : operatingSettings.MaxValue; uint32_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue; - auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; + auto multiplier = ride->getRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; try { @@ -3468,7 +3467,7 @@ namespace OpenRCT2::Ui::Windows return; auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); // Widget setup pressed_widgets &= ~( @@ -3477,7 +3476,7 @@ namespace OpenRCT2::Ui::Windows | (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX)); // Sometimes, only one of the alternatives support lift hill pieces. Make sure to check both. - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); bool hasAlternativeType = rtd.HasFlag(RtdFlag::hasInvertedVariant); if (rtd.TrackPaintFunctions.Regular.SupportsTrackGroup(TrackGroup::liftHill) || (hasAlternativeType && rtd.InvertedTrackPaintFunctions.Regular.SupportsTrackGroup(TrackGroup::liftHill))) @@ -3488,7 +3487,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_LIFT_HILL_SPEED_DECREASE].type = WindowWidgetType::Button; ft.Rewind(); ft.Increment(20); - ft.Add(ride->lift_hill_speed); + ft.Add(ride->liftHillSpeed); } else { @@ -3499,7 +3498,7 @@ namespace OpenRCT2::Ui::Windows } // Number of circuits - if (ride->CanHaveMultipleCircuits()) + if (ride->canHaveMultipleCircuits()) { widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_LABEL].type = WindowWidgetType::Label; widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS].type = WindowWidgetType::Spinner; @@ -3507,7 +3506,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE].type = WindowWidgetType::Button; ft.Rewind(); ft.Increment(22); - ft.Add(ride->num_circuits); + ft.Add(ride->numCircuits); } else { @@ -3518,12 +3517,12 @@ namespace OpenRCT2::Ui::Windows } // Leave if another vehicle arrives at station - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation) - && ride->NumTrains > 1 && !ride->IsBlockSectioned()) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation) + && ride->numTrains > 1 && !ride->isBlockSectioned()) { widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Checkbox; widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].tooltip = STR_LEAVE_IF_ANOTHER_VEHICLE_ARRIVES_TIP; - widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = ride->GetRideTypeDescriptor().NameConvention.vehicle + widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = ride->getRideTypeDescriptor().NameConvention.vehicle == RideComponentType::Boat ? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES : STR_LEAVE_IF_ANOTHER_TRAIN_ARRIVES; @@ -3534,7 +3533,7 @@ namespace OpenRCT2::Ui::Windows } // Synchronise with adjacent stations - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::canSynchroniseWithAdjacentStations)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::canSynchroniseWithAdjacentStations)) { widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Checkbox; widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].text = STR_SYNCHRONISE_WITH_ADJACENT_STATIONS; @@ -3549,8 +3548,8 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_MODE].text = kRideModeNames[EnumValue(ride->mode)]; // Waiting - widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)]; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLoadOptions)) + widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->departFlags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)]; + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasLoadOptions)) { widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Checkbox; widgets[WIDX_LOAD].type = WindowWidgetType::DropdownMenu; @@ -3569,11 +3568,11 @@ namespace OpenRCT2::Ui::Windows ft.Rewind(); ft.Increment(10); ft.Add(STR_FORMAT_SECONDS); - ft.Add(ride->min_waiting_time); + ft.Add(ride->minWaitingTime); ft.Add(STR_FORMAT_SECONDS); - ft.Add(ride->max_waiting_time); + ft.Add(ride->maxWaitingTime); - if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD) + if (ride->departFlags & RIDE_DEPART_WAIT_FOR_LOAD) pressed_widgets |= (1uLL << WIDX_LOAD_CHECKBOX); } else @@ -3593,20 +3592,20 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_MAXIMUM_LENGTH_DECREASE].type = WindowWidgetType::Empty; } - if (ride->depart_flags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) + if (ride->departFlags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) pressed_widgets |= (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); - if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) + if (ride->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) pressed_widgets |= (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); - if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) + if (ride->departFlags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) pressed_widgets |= (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX); - if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) + if (ride->departFlags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) pressed_widgets |= (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX); // Mode specific functionality - auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; + auto multiplier = ride->getRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; ft.Rewind(); ft.Increment(18); - ft.Add(static_cast(ride->operation_option) * multiplier); + ft.Add(static_cast(ride->operationOption) * multiplier); switch (ride->mode) { case RideMode::poweredLaunchPasstrough: @@ -3615,7 +3614,7 @@ namespace OpenRCT2::Ui::Windows case RideMode::poweredLaunchBlockSectioned: ft.Rewind(); ft.Increment(18); - ft.Add((ride->launch_speed * 9) / 4); + ft.Add((ride->launchSpeed * 9) / 4); format = STR_RIDE_MODE_SPEED_VALUE; caption = STR_LAUNCH_SPEED; tooltip = STR_LAUNCH_SPEED_TIP; @@ -3631,7 +3630,7 @@ namespace OpenRCT2::Ui::Windows case RideMode::race: ft.Rewind(); ft.Increment(18); - ft.Add(ride->NumLaps); + ft.Add(ride->numLaps); format = STR_NUMBER_OF_LAPS_VALUE; caption = STR_NUMBER_OF_LAPS; tooltip = STR_NUMBER_OF_LAPS_TIP; @@ -3657,7 +3656,7 @@ namespace OpenRCT2::Ui::Windows format = STR_MAX_PEOPLE_ON_RIDE_VALUE; caption = STR_MAX_PEOPLE_ON_RIDE; tooltip = STR_MAX_PEOPLE_ON_RIDE_TIP; - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) format = 0; break; } @@ -3703,10 +3702,10 @@ namespace OpenRCT2::Ui::Windows colours[1], INSET_RECT_FLAG_BORDER_INSET); // Number of block sections - if (ride->IsBlockSectioned()) + if (ride->isBlockSectioned()) { auto ft = Formatter(); - ft.Add(ride->num_block_brakes + ride->num_stations); + ft.Add(ride->numBlockBrakes + ride->numStations); auto underWidget = ride->mode == RideMode::poweredLaunchBlockSectioned ? WIDX_MODE_TWEAK : WIDX_MODE; DrawTextBasic( dpi, windowPos + ScreenCoordsXY{ 21, widgets[underWidget].bottom + 3 }, STR_BLOCK_SECTIONS, ft, @@ -3781,7 +3780,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -3801,7 +3800,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, 7, widgets[widgetIndex].right - dropdownWidget->left); - Dropdown::SetChecked(ride->inspection_interval, true); + Dropdown::SetChecked(ride->inspectionInterval, true); break; case WIDX_FORCE_BREAKDOWN: @@ -3818,9 +3817,9 @@ namespace OpenRCT2::Ui::Windows assert(j < static_cast(std::size(rideEntry->ride_type))); if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast(1 << i)) { - if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) + if (i == BREAKDOWN_BRAKES_FAILURE && ride->isBlockSectioned()) { - if (ride->NumTrains != 1) + if (ride->numTrains != 1) continue; } gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; @@ -3839,17 +3838,17 @@ namespace OpenRCT2::Ui::Windows dropdownWidget->height() + 1, colours[1], Dropdown::Flag::StayOpen, numItems); numItems = 1; - int32_t breakdownReason = ride->breakdown_reason_pending; - if (breakdownReason != BREAKDOWN_NONE && (ride->lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING)) + int32_t breakdownReason = ride->breakdownReasonPending; + if (breakdownReason != BREAKDOWN_NONE && (ride->lifecycleFlags & RIDE_LIFECYCLE_BREAKDOWN_PENDING)) { for (int32_t i = 0; i < 8; i++) { if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast(1 << i)) { - if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) + if (i == BREAKDOWN_BRAKES_FAILURE && ride->isBlockSectioned()) { - if (ride->NumTrains != 1) + if (ride->numTrains != 1) continue; } if (i == breakdownReason) @@ -3864,7 +3863,7 @@ namespace OpenRCT2::Ui::Windows } } - if ((ride->lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING) == 0) + if ((ride->lifecycleFlags & RIDE_LIFECYCLE_BREAKDOWN_PENDING) == 0) { Dropdown::SetDisabled(0, true); } @@ -3882,7 +3881,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -3896,12 +3895,12 @@ namespace OpenRCT2::Ui::Windows if (dropdownIndex == 0) { Vehicle* vehicle; - switch (ride->breakdown_reason_pending) + switch (ride->breakdownReasonPending) { case BREAKDOWN_SAFETY_CUT_OUT: - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) break; - for (int32_t i = 0; i < ride->NumTrains; ++i) + for (int32_t i = 0; i < ride->numTrains; ++i) { for (vehicle = GetEntity(ride->vehicles[i]); vehicle != nullptr; vehicle = GetEntity(vehicle->next_vehicle_on_train)) @@ -3916,27 +3915,27 @@ namespace OpenRCT2::Ui::Windows case BREAKDOWN_RESTRAINTS_STUCK_OPEN: case BREAKDOWN_DOORS_STUCK_CLOSED: case BREAKDOWN_DOORS_STUCK_OPEN: - vehicle = GetEntity(ride->vehicles[ride->broken_vehicle]); + vehicle = GetEntity(ride->vehicles[ride->brokenTrain]); if (vehicle != nullptr) { vehicle->ClearFlag(VehicleFlags::CarIsBroken); } break; case BREAKDOWN_VEHICLE_MALFUNCTION: - vehicle = GetEntity(ride->vehicles[ride->broken_vehicle]); + vehicle = GetEntity(ride->vehicles[ride->brokenTrain]); if (vehicle != nullptr) { vehicle->ClearFlag(VehicleFlags::TrainIsBroken); } break; } - ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); + ride->lifecycleFlags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); auto* windowMgr = GetWindowManager(); windowMgr->InvalidateByNumber(WindowClass::Ride, number); break; } - if (ride->lifecycle_flags + if (ride->lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) { ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_ALREADY_BROKEN, {}); @@ -3961,9 +3960,9 @@ namespace OpenRCT2::Ui::Windows if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast(1 << i)) { - if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) + if (i == BREAKDOWN_BRAKES_FAILURE && ride->isBlockSectioned()) { - if (ride->NumTrains != 1) + if (ride->numTrains != 1) continue; } if (numItems == dropdownIndex) @@ -3984,9 +3983,9 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(WIDX_TAB_4); auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) + if (ride != nullptr && ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_MAINTENANCE) { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride->windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; Invalidate(); } } @@ -4000,9 +3999,9 @@ namespace OpenRCT2::Ui::Windows return; auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); - widgets[WIDX_INSPECTION_INTERVAL].text = kRideInspectionIntervalNames[ride->inspection_interval]; + widgets[WIDX_INSPECTION_INTERVAL].text = kRideInspectionIntervalNames[ride->inspectionInterval]; AnchorBorderWidgets(); WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); @@ -4016,8 +4015,8 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::Empty; } - if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0 - || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) + if (ride->getRideTypeDescriptor().AvailableBreakdowns == 0 + || !(ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) { disabled_widgets |= (1uLL << WIDX_REFURBISH_RIDE); widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED; @@ -4035,7 +4034,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - uint16_t reliability = ride->reliability_percentage; + uint16_t reliability = ride->reliabilityPercentage; WidgetProgressBarSetNewPercentage(widgets[WIDX_RELIABILITY_BAR], std::max(10, reliability)); uint16_t downTime = ride->downtime; @@ -4071,32 +4070,32 @@ namespace OpenRCT2::Ui::Windows // Last inspection StringId stringId; - if (ride->last_inspection <= 1) + if (ride->lastInspection <= 1) stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE; - else if (ride->last_inspection <= 240) + else if (ride->lastInspection <= 240) stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTES; else stringId = STR_TIME_SINCE_LAST_INSPECTION_MORE_THAN_4_HOURS; ft = Formatter(); - ft.Add(ride->last_inspection); + ft.Add(ride->lastInspection); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += 12; // Last / current breakdown - if (ride->breakdown_reason == BREAKDOWN_NONE) + if (ride->breakdownReason == BREAKDOWN_NONE) return; - stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; + stringId = (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; ft = Formatter(); - ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); + ft.Add(RideBreakdownReasonNames[ride->breakdownReason]); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += 12; // Mechanic status - if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - switch (ride->mechanic_status) + switch (ride->mechanicStatus) { case RIDE_MECHANIC_STATUS_CALLING: { @@ -4152,9 +4151,9 @@ namespace OpenRCT2::Ui::Windows { // Get station flags (shops don't have them) auto stationObjFlags = 0; - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { - auto stationObj = ride.GetStationObject(); + auto stationObj = ride.getStationObject(); if (stationObj != nullptr) { stationObjFlags = stationObj->Flags; @@ -4165,12 +4164,12 @@ namespace OpenRCT2::Ui::Windows { case 0: return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR) - || ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrackColourMain); + || ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrackColourMain); case 1: return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR) - || ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrackColourAdditional); + || ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrackColourAdditional); case 2: - return ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrackColourSupports); + return ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrackColourSupports); default: return 0; } @@ -4231,7 +4230,7 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - const bool currentlyEnabled = ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); + const bool currentlyEnabled = ride->hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); auto rideSetAppearanceAction = RideSetAppearanceAction( rideId, RideSetAppearanceType::SellingItemColourIsRandom, currentlyEnabled ? 0 : 1, 0); GameActions::Execute(&rideSetAppearanceAction); @@ -4244,15 +4243,15 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; bool allowChangingTrimColour = false; bool allowChangingTertiaryColour = false; - for (int32_t i = 0; i < ride->num_cars_per_train; i++) + for (int32_t i = 0; i < ride->numCarsPerTrain; i++) { - uint8_t vehicleTypeIndex = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, i); + uint8_t vehicleTypeIndex = RideEntryGetVehicleAtPosition(ride->subtype, ride->numCarsPerTrain, i); if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TRIM_COLOUR) { @@ -4264,9 +4263,9 @@ namespace OpenRCT2::Ui::Windows } } - int32_t numItems = ride->NumTrains; + int32_t numItems = ride->numTrains; if (ride->vehicleColourSettings != VehicleColourSettings::perTrain) - numItems = ride->num_cars_per_train; + numItems = ride->numCarsPerTrain; for (auto i = 0; i < numItems; i++) { @@ -4310,7 +4309,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -4336,15 +4335,15 @@ namespace OpenRCT2::Ui::Windows } case WIDX_TRACK_MAIN_COLOUR: WindowDropdownShowColour( - this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].main); + this, &widgets[widgetIndex], colours[1], ride->trackColours[colourSchemeIndex].main); break; case WIDX_TRACK_ADDITIONAL_COLOUR: WindowDropdownShowColour( - this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].additional); + this, &widgets[widgetIndex], colours[1], ride->trackColours[colourSchemeIndex].additional); break; case WIDX_TRACK_SUPPORT_COLOUR: WindowDropdownShowColour( - this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].supports); + this, &widgets[widgetIndex], colours[1], ride->trackColours[colourSchemeIndex].supports); break; case WIDX_MAZE_STYLE_DROPDOWN: { @@ -4358,7 +4357,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, 4, widgets[widgetIndex].right - dropdownWidget->left); - Dropdown::SetChecked(ride->track_colour[colourSchemeIndex].supports, true); + Dropdown::SetChecked(ride->trackColours[colourSchemeIndex].supports, true); break; } case WIDX_ENTRANCE_STYLE_DROPDOWN: @@ -4367,7 +4366,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN: { // Train, boat, ... - auto vehicleTypeName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular; + auto vehicleTypeName = GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.vehicle).singular; auto numDropdownItems = 2; gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; @@ -4392,9 +4391,9 @@ namespace OpenRCT2::Ui::Windows } case WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN: { - numItems = ride->NumTrains; + numItems = ride->numTrains; if (ride->vehicleColourSettings != VehicleColourSettings::perTrain) - numItems = ride->num_cars_per_train; + numItems = ride->numCarsPerTrain; stringId = ride->vehicleColourSettings == VehicleColourSettings::perTrain ? STR_RIDE_COLOUR_TRAIN_OPTION : STR_RIDE_COLOUR_VEHICLE_OPTION; @@ -4404,7 +4403,7 @@ namespace OpenRCT2::Ui::Windows if (ride->vehicleColourSettings == VehicleColourSettings::perCar) { const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, i)]; + ride->subtype, ride->numCarsPerTrain, i)]; if (!carEntry.isVisible()) { continue; @@ -4414,7 +4413,7 @@ namespace OpenRCT2::Ui::Windows int64_t vehicleIndex = dropdownIndex + 1; gDropdownItems[dropdownIndex].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[dropdownIndex].Args = (vehicleIndex << 32) - | ((GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised) << 16) + | ((GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.vehicle).capitalised) << 16) | stringId; dropdownIndex++; } @@ -4576,21 +4575,21 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; widgets[WIDX_TITLE].text = STR_ARG_16_STRINGID; auto ft = Formatter::Common(); ft.Increment(16); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); // Track colours int32_t colourScheme = _rideColour; - trackColour = ride->track_colour[colourScheme]; + trackColour = ride->trackColours[colourScheme]; // Maze style - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { widgets[WIDX_MAZE_STYLE].type = WindowWidgetType::DropdownMenu; @@ -4604,7 +4603,7 @@ namespace OpenRCT2::Ui::Windows } // Track, multiple colour schemes - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::supportsMultipleColourSchemes)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::supportsMultipleColourSchemes)) { widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu; widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button; @@ -4640,10 +4639,10 @@ namespace OpenRCT2::Ui::Windows } // Selling item random colour checkbox - if (ride->HasRecolourableShopItems()) + if (ride->hasRecolourableShopItems()) { widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WindowWidgetType::Checkbox; - if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) + if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) { pressed_widgets |= (1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } @@ -4676,14 +4675,14 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Empty; // Entrance style - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasEntranceAndExit)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasEntranceAndExit)) { widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Spinner; widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu; widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Button; auto stringId = kStringIdNone; - auto stationObj = ride->GetStationObject(); + auto stationObj = ride->getStationObject(); if (stationObj != nullptr) { stringId = stationObj->NameStringId; @@ -4698,8 +4697,8 @@ namespace OpenRCT2::Ui::Windows } // Vehicle colours - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles) - && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasVehicleColours)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles) + && ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasVehicleColours)) { if (ride->vehicleColourSettings == VehicleColourSettings::same) { @@ -4720,9 +4719,9 @@ namespace OpenRCT2::Ui::Windows bool allowChangingTrimColour = false; bool allowChangingTertiaryColour = false; - for (int32_t i = 0; i < ride->num_cars_per_train; i++) + for (int32_t i = 0; i < ride->numCarsPerTrain; i++) { - uint8_t vehicleTypeIndex = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, i); + uint8_t vehicleTypeIndex = RideEntryGetVehicleAtPosition(ride->subtype, ride->numCarsPerTrain, i); if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TRIM_COLOUR) { @@ -4756,8 +4755,8 @@ namespace OpenRCT2::Ui::Windows } // Vehicle colour scheme type - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral) - && (ride->num_cars_per_train | ride->NumTrains) > 1) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral) + && (ride->numCarsPerTrain | ride->numTrains) > 1) { widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu; widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button; @@ -4770,8 +4769,8 @@ namespace OpenRCT2::Ui::Windows ft.Rewind(); ft.Increment(6); ft.Add(VehicleColourSchemeNames[EnumValue(ride->vehicleColourSettings)]); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised); + ft.Add(GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.vehicle).singular); + ft.Add(GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.vehicle).capitalised); ft.Add(carIndexToDropdownIndex(_vehicleIndex) + 1); // Vehicle index @@ -4831,23 +4830,23 @@ namespace OpenRCT2::Ui::Windows { windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } }, PALETTE_INDEX_12); - auto trackColour = ride->track_colour[_rideColour]; + auto trackColour = ride->trackColours[_rideColour]; // - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr || rideEntry->shop_item[0] == ShopItem::None) { auto screenCoords = windowPos + ScreenCoordsXY{ trackPreviewWidget.left, trackPreviewWidget.top }; // Track - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { GfxDrawSprite(dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords); } else { - auto typeDescriptor = ride->GetRideTypeDescriptor(); + auto typeDescriptor = ride->getRideTypeDescriptor(); int32_t spriteIndex = typeDescriptor.ColourPreview.Track; if (spriteIndex != 0) { @@ -4870,7 +4869,7 @@ namespace OpenRCT2::Ui::Windows ShopItem shopItem = rideEntry->shop_item[1] == ShopItem::None ? rideEntry->shop_item[0] : rideEntry->shop_item[1]; - if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) + if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) { colour_t spriteColour = COLOUR_BLACK; // Limit update rate of preview to avoid making people dizzy. @@ -4888,12 +4887,12 @@ namespace OpenRCT2::Ui::Windows else { GfxDrawSprite( - dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords); + dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->trackColours[0].main), screenCoords); } } // Entrance preview - trackColour = ride->track_colour[0]; + trackColour = ride->trackColours[0]; const auto& entrancePreviewWidget = widgets[WIDX_ENTRANCE_PREVIEW]; if (entrancePreviewWidget.type != WindowWidgetType::Empty) { @@ -4904,7 +4903,7 @@ namespace OpenRCT2::Ui::Windows { GfxClear(clippedDpi, PALETTE_INDEX_12); - auto stationObj = ride->GetStationObject(); + auto stationObj = ride->getStationObject(); if (stationObj != nullptr && stationObj->BaseImageId != kImageIndexUndefined) { auto imageId = ImageId(stationObj->BaseImageId, trackColour.main, trackColour.additional); @@ -4934,7 +4933,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -4952,7 +4951,7 @@ namespace OpenRCT2::Ui::Windows : rideEntry->TabCar; const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, trainCarIndex)]; + ride->subtype, ride->numCarsPerTrain, trainCarIndex)]; screenCoords.y += carEntry.tab_height; @@ -4976,9 +4975,9 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - int32_t activateMusic = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) ? 0 : 1; + int32_t activateMusic = (ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC) ? 0 : 1; SetOperatingSetting(rideId, RideSetSetting::Music, activateMusic); - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MUSIC; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MUSIC; } } @@ -5016,7 +5015,7 @@ namespace OpenRCT2::Ui::Windows return; // Expand the window when music is playing - auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; + auto isMusicActivated = (ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC) != 0; auto standardHeight = widgets[WIDX_MUSIC_DROPDOWN].bottom + 6; auto minHeight = isMusicActivated ? standardHeight + 133 : standardHeight; auto maxHeight = isMusicActivated ? standardHeight + 369 : standardHeight; @@ -5125,9 +5124,9 @@ namespace OpenRCT2::Ui::Windows OnPrepareDraw(); InvalidateWidget(WIDX_TAB_6); - if (auto ride = GetRide(rideId); ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MUSIC) + if (auto ride = GetRide(rideId); ride != nullptr && ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_MUSIC) { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MUSIC; + ride->windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_MUSIC; Invalidate(); OnResize(); OnPrepareDraw(); @@ -5151,7 +5150,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return size; - auto musicObj = ride->GetMusicObject(); + auto musicObj = ride->getMusicObject(); if (musicObj == nullptr) return size; @@ -5184,7 +5183,7 @@ namespace OpenRCT2::Ui::Windows return; auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); // Align music dropdown widgets[WIDX_MUSIC].right = width - 8; @@ -5193,14 +5192,14 @@ namespace OpenRCT2::Ui::Windows // Set selected music StringId musicName = kStringIdNone; - auto musicObj = ride->GetMusicObject(); + auto musicObj = ride->getMusicObject(); if (musicObj != nullptr) { musicName = musicObj->NameStringId; } widgets[WIDX_MUSIC].text = musicName; - auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; + auto isMusicActivated = (ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC) != 0; bool hasPreviewImage = musicObj != nullptr && musicObj->HasPreview(); WidgetSetVisible(*this, WIDX_MUSIC_DATA, isMusicActivated); @@ -5244,7 +5243,7 @@ namespace OpenRCT2::Ui::Windows return; // Draw music data only when music is activated - auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; + auto isMusicActivated = (ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC) != 0; if (!isMusicActivated) return; @@ -5253,7 +5252,7 @@ namespace OpenRCT2::Ui::Windows DrawTextWrapped(dpi, trackLabelPos, width, STR_MUSIC_OBJECT_TRACK_HEADER, {}, { TextAlignment::LEFT }); // Do we have a preview image to draw? - auto musicObj = ride->GetMusicObject(); + auto musicObj = ride->getMusicObject(); bool hasPreview = musicObj != nullptr && musicObj->HasPreview(); if (!hasPreview) return; @@ -5279,14 +5278,14 @@ namespace OpenRCT2::Ui::Windows return; // Only draw track listing when music is activated - auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; + auto isMusicActivated = (ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC) != 0; if (!isMusicActivated) return; uint8_t paletteIndex = ColourMapA[colours[1].colour].mid_light; GfxClear(dpi, paletteIndex); - auto* musicObj = ride->GetMusicObject(); + auto* musicObj = ride->getMusicObject(); if (musicObj == nullptr) return; @@ -5390,7 +5389,7 @@ namespace OpenRCT2::Ui::Windows TrackDesignState tds{}; Ride* ride = GetRide(rideId); - _trackDesign = ride->SaveToTrackDesign(tds); + _trackDesign = ride->saveToTrackDesign(tds); if (!_trackDesign) { return; @@ -5410,7 +5409,7 @@ namespace OpenRCT2::Ui::Windows } } - auto trackName = ride->GetName(); + auto trackName = ride->getName(); auto intent = Intent(WindowClass::Loadsave); intent.PutEnumExtra(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save); intent.PutEnumExtra(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::track); @@ -5481,7 +5480,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + widgets[widgetIndex].left, windowPos.y + widgets[widgetIndex].top }, widgets[widgetIndex].height() + 1, colours[1], Dropdown::Flag::StayOpen, 2); gDropdownDefaultIndex = 0; - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { // Disable saving without scenery if we're a flat ride Dropdown::SetDisabled(0, true); @@ -5574,7 +5573,7 @@ namespace OpenRCT2::Ui::Windows return; auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN_NOT_POSSIBLE; widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::Empty; @@ -5594,7 +5593,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::FlatBtn; disabled_widgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); - if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_TESTED) { if (!ride->ratings.isNull()) { @@ -5635,7 +5634,7 @@ namespace OpenRCT2::Ui::Windows auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_TESTED) { // Excitement StringId ratingName = GetRatingName(ride->ratings.excitement); @@ -5676,9 +5675,9 @@ namespace OpenRCT2::Ui::Windows dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, colours[1], INSET_RECT_FLAG_BORDER_INSET); - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_NO_RAW_STATS)) + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_NO_RAW_STATS)) { - if (ride->GetRideTypeDescriptor().specialType == RtdSpecialType::miniGolf) + if (ride->getRideTypeDescriptor().specialType == RtdSpecialType::miniGolf) { // Holes ft = Formatter(); @@ -5690,13 +5689,13 @@ namespace OpenRCT2::Ui::Windows { // Max speed ft = Formatter(); - ft.Add(ToHumanReadableSpeed(ride->max_speed)); + ft.Add(ToHumanReadableSpeed(ride->maxSpeed)); DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft); screenCoords.y += kListRowHeight; // Average speed ft = Formatter(); - ft.Add(ToHumanReadableSpeed(ride->average_speed)); + ft.Add(ToHumanReadableSpeed(ride->averageSpeed)); DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft); screenCoords.y += kListRowHeight; @@ -5706,10 +5705,10 @@ namespace OpenRCT2::Ui::Windows // TODO: STR_RIDE_TIME only takes up to 4 stations modify to take more // also if modified may need to be split into multiple format strings // as formatter cannot take more than 256 bytes - for (int32_t i = 0; i < std::min(ride->num_stations, 4); i++) + for (int32_t i = 0; i < std::min(ride->numStations, 4); i++) { StationIndex stationIndex = StationIndex::FromUnderlying(numTimes); - auto time = ride->GetStation(stationIndex).SegmentTime; + auto time = ride->getStation(stationIndex).SegmentTime; if (time != 0) { ft.Add(STR_RIDE_TIME_ENTRY_WITH_SEPARATOR); @@ -5745,10 +5744,10 @@ namespace OpenRCT2::Ui::Windows ft = Formatter(); int32_t numLengths = 0; // TODO: see above STR_RIDE_LENGTH is also only able to display max 4 - for (int32_t i = 0; i < std::min(ride->num_stations, 4); i++) + for (int32_t i = 0; i < std::min(ride->numStations, 4); i++) { StationIndex stationIndex = StationIndex::FromUnderlying(i); - auto length = ride->GetStation(stationIndex).SegmentLength; + auto length = ride->getStation(stationIndex).SegmentLength; if (length != 0) { length >>= 16; @@ -5781,29 +5780,29 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += kListRowHeight; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) { // Max. positive vertical G's stringId = STR_MAX_POSITIVE_VERTICAL_G; ft = Formatter(); - ft.Add(ride->max_positive_vertical_g); + ft.Add(ride->maxPositiveVerticalG); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += kListRowHeight; // Max. negative vertical G's - stringId = ride->max_negative_vertical_g <= kRideGForcesRedNegVertical + stringId = ride->maxNegativeVerticalG <= kRideGForcesRedNegVertical ? STR_MAX_NEGATIVE_VERTICAL_G_RED : STR_MAX_NEGATIVE_VERTICAL_G; ft = Formatter(); - ft.Add(ride->max_negative_vertical_g); + ft.Add(ride->maxNegativeVerticalG); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += kListRowHeight; // Max lateral G's - stringId = ride->max_lateral_g > kRideGForcesRedLateral ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G; + stringId = ride->maxLateralG > kRideGForcesRedLateral ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G; ft = Formatter(); - ft.Add(ride->max_lateral_g); + ft.Add(ride->maxLateralG); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += kListRowHeight; @@ -5814,7 +5813,7 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += kListRowHeight; } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasDrops)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasDrops)) { ft = Formatter(); ft.Add(ride->getNumDrops()); @@ -5822,14 +5821,14 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += kListRowHeight; // Highest drop height - auto highestDropHeight = (ride->highest_drop_height * 3) / 4; + auto highestDropHeight = (ride->highestDropHeight * 3) / 4; ft = Formatter(); ft.Add(highestDropHeight); DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft); screenCoords.y += kListRowHeight; } - if (ride->GetRideTypeDescriptor().specialType != RtdSpecialType::miniGolf) + if (ride->getRideTypeDescriptor().specialType != RtdSpecialType::miniGolf) { // Inversions if (ride->inversions != 0) @@ -5939,7 +5938,7 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { RideMeasurement* measurement{}; - std::tie(measurement, std::ignore) = ride->GetMeasurement(); + std::tie(measurement, std::ignore) = ride->getMeasurement(); x = measurement == nullptr ? 0 : measurement->current_item - ((widget->width() / 4) * 3); } } @@ -5961,7 +5960,7 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { RideMeasurement* measurement{}; - std::tie(measurement, std::ignore) = ride->GetMeasurement(); + std::tie(measurement, std::ignore) = ride->getMeasurement(); if (measurement != nullptr) { size.width = std::max(size.width, measurement->num_items); @@ -5982,12 +5981,12 @@ namespace OpenRCT2::Ui::Windows auto ride = GetRide(rideId); if (ride != nullptr) { - auto [measurement, message] = ride->GetMeasurement(); + auto [measurement, message] = ride->getMeasurement(); if (measurement != nullptr && (measurement->flags & RIDE_MEASUREMENT_FLAG_RUNNING)) { auto ft = Formatter(); ft.Increment(2); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); + ft.Add(GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.vehicle).number); ft.Add(measurement->vehicle_index + 1); return { fallback, ft }; } @@ -6011,7 +6010,7 @@ namespace OpenRCT2::Ui::Windows return; auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); // Set pressed graph button type pressed_widgets &= ~(1uLL << WIDX_GRAPH_VELOCITY); @@ -6021,7 +6020,7 @@ namespace OpenRCT2::Ui::Windows pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + list_information_type)); // Hide graph buttons that are not applicable - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) { widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Button; widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Button; @@ -6070,7 +6069,7 @@ namespace OpenRCT2::Ui::Windows return; } - auto [measurement, message] = ride->GetMeasurement(); + auto [measurement, message] = ride->getMeasurement(); if (measurement == nullptr) { @@ -6262,7 +6261,7 @@ namespace OpenRCT2::Ui::Windows return; ShopItem shopItem; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::toilet) { shopItem = ShopItem::Admission; @@ -6300,7 +6299,7 @@ namespace OpenRCT2::Ui::Windows auto shop_item = rideEntry->shop_item[1]; if (shop_item == ShopItem::None) - shop_item = ride->GetRideTypeDescriptor().PhotoItem; + shop_item = ride->getRideTypeDescriptor().PhotoItem; UpdateSamePriceThroughoutFlags(shop_item); @@ -6367,8 +6366,8 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return false; - auto rideEntry = ride->GetRideEntry(); - const auto& rtd = ride->GetRideTypeDescriptor(); + auto rideEntry = ride->getRideEntry(); + const auto& rtd = ride->getRideTypeDescriptor(); return Park::RidePricesUnlocked() || rtd.specialType == RtdSpecialType::toilet || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::None); } @@ -6480,9 +6479,9 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(WIDX_TAB_9); auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) + if (ride != nullptr && ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_INCOME) { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_INCOME; + ride->windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_INCOME; Invalidate(); } } @@ -6523,9 +6522,9 @@ namespace OpenRCT2::Ui::Windows auto ft = Formatter::Common(); ft.Increment(18); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -6537,7 +6536,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_PRIMARY_PRICE].tooltip = kStringIdNone; // If ride prices are locked, do not allow setting the price, unless we're dealing with a shop or toilet. - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (!Park::RidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None && rtd.specialType != RtdSpecialType::toilet) { @@ -6569,8 +6568,8 @@ namespace OpenRCT2::Ui::Windows } // Get secondary item - auto secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) + auto secondaryItem = ride->getRideTypeDescriptor().PhotoItem; + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) { if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::None) { @@ -6627,7 +6626,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -6656,8 +6655,8 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += 44; // Secondary item profit / loss per item sold - secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) + secondaryItem = ride->getRideTypeDescriptor().PhotoItem; + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) secondaryItem = rideEntry->shop_item[1]; if (secondaryItem != ShopItem::None) @@ -6680,18 +6679,18 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += 18; // Income per hour - if (ride->income_per_hour != kMoney64Undefined) + if (ride->incomePerHour != kMoney64Undefined) { auto ft = Formatter(); - ft.Add(ride->income_per_hour); + ft.Add(ride->incomePerHour); DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft); screenCoords.y += kListRowHeight; } // Running cost per hour - money64 costPerHour = ride->upkeep_cost * 16; - stringId = ride->upkeep_cost == kMoney64Undefined ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; + money64 costPerHour = ride->upkeepCost * 16; + stringId = ride->upkeepCost == kMoney64Undefined ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; auto ft = Formatter(); ft.Add(costPerHour); DrawTextBasic(dpi, screenCoords, stringId, ft); @@ -6709,7 +6708,7 @@ namespace OpenRCT2::Ui::Windows // Total profit ft = Formatter(); - ft.Add(ride->total_profit); + ft.Add(ride->totalProfit); DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft); } @@ -6780,9 +6779,9 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(WIDX_TAB_10); auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) + if (ride != nullptr && ride->windowInvalidateFlags & RIDE_INVALIDATE_RIDE_CUSTOMER) { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; + ride->windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; Invalidate(); } } @@ -6795,10 +6794,10 @@ namespace OpenRCT2::Ui::Windows if (ride != nullptr) { auto ft = Formatter::Common(); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); widgets[WIDX_SHOW_GUESTS_THOUGHTS].type = WindowWidgetType::FlatBtn; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::Empty; widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::Empty; @@ -6831,10 +6830,10 @@ namespace OpenRCT2::Ui::Windows + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; // Customers currently on ride - if (ride->IsRide()) + if (ride->isRide()) { auto ft = Formatter(); - ft.Add(ride->num_riders); + ft.Add(ride->numRiders); DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); screenCoords.y += kListRowHeight; } @@ -6878,9 +6877,9 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += kListRowHeight; // Queue time - if (ride->IsRide()) + if (ride->isRide()) { - queueTime = ride->GetMaxQueueTime(); + queueTime = ride->getMaxQueueTime(); stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES; ft = Formatter(); ft.Add(queueTime); @@ -6889,40 +6888,40 @@ namespace OpenRCT2::Ui::Windows } // Primary shop items sold - shopItem = ride->GetRideEntry()->shop_item[0]; + shopItem = ride->getRideEntry()->shop_item[0]; if (shopItem != ShopItem::None) { ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); - ft.Add(ride->no_primary_items_sold); + ft.Add(ride->numPrimaryItemsSold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); screenCoords.y += kListRowHeight; } // Secondary shop items sold / on-ride photos sold - shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->GetRideTypeDescriptor().PhotoItem - : ride->GetRideEntry()->shop_item[1]; + shopItem = (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->getRideTypeDescriptor().PhotoItem + : ride->getRideEntry()->shop_item[1]; if (shopItem != ShopItem::None) { ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); - ft.Add(ride->no_secondary_items_sold); + ft.Add(ride->numSecondaryItemsSold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); screenCoords.y += kListRowHeight; } // Total customers ft = Formatter(); - ft.Add(ride->total_customers); + ft.Add(ride->totalCustomers); DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft); screenCoords.y += kListRowHeight; // Guests favourite - if (ride->IsRide()) + if (ride->isRide()) { ft = Formatter(); - ft.Add(ride->guests_favourite); - stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; + ft.Add(ride->guestsFavourite); + stringId = ride->guestsFavourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += kListRowHeight; } @@ -6930,7 +6929,7 @@ namespace OpenRCT2::Ui::Windows // Age // If the ride has a build date that is in the future, show it as built this year. - int16_t age = std::max(DateGetYear(ride->GetAge()), 0); + int16_t age = std::max(DateGetYear(ride->getAge()), 0); stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO; ft = Formatter(); ft.Add(age); @@ -6968,7 +6967,7 @@ namespace OpenRCT2::Ui::Windows w = WindowRideOpen(ride); w->SetViewIndex(0); } - else if (w->GetViewIndex() >= (1 + ride.NumTrains + ride.num_stations)) + else if (w->GetViewIndex() >= (1 + ride.numTrains + ride.numStations)) { w->SetViewIndex(0); } @@ -6996,7 +6995,7 @@ namespace OpenRCT2::Ui::Windows if (ride.type >= RIDE_TYPE_COUNT) return nullptr; - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) return RideMainOpen(ride); auto* windowMgr = GetWindowManager(); @@ -7014,13 +7013,13 @@ namespace OpenRCT2::Ui::Windows // View for (int32_t i = stationIndex.ToUnderlying(); i >= 0; i--) { - if (ride.GetStations()[i].Start.IsNull()) + if (ride.getStations()[i].Start.IsNull()) { stationIndex = StationIndex::FromUnderlying(stationIndex.ToUnderlying() - 1); } } - w->SetViewIndex(1 + ride.NumTrains + stationIndex.ToUnderlying()); + w->SetViewIndex(1 + ride.numTrains + stationIndex.ToUnderlying()); return w; } @@ -7151,7 +7150,7 @@ namespace OpenRCT2::Ui::Windows auto ride = vehicle.GetRide(); auto viewVehicleIndex = w->GetViewIndex() - 1; - if (ride == nullptr || viewVehicleIndex < 0 || viewVehicleIndex >= ride->NumTrains) + if (ride == nullptr || viewVehicleIndex < 0 || viewVehicleIndex >= ride->numTrains) return; if (vehicle.Id != ride->vehicles[viewVehicleIndex]) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 54de9c5102..2b63befbd7 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -256,13 +256,13 @@ namespace OpenRCT2::Ui::Windows _currentColourScheme = RideColourScheme::main; _currentSeatRotationAngle = 4; - _currentlySelectedTrack = currentRide->GetRideTypeDescriptor().StartTrackPiece; + _currentlySelectedTrack = currentRide->getRideTypeDescriptor().StartTrackPiece; _currentTrackPitchEnd = TrackPitch::None; _currentTrackRollEnd = TrackRoll::None; _currentTrackHasLiftHill = false; _currentTrackAlternative.clearAll(); - if (currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::startConstructionInverted)) + if (currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::startConstructionInverted)) _currentTrackAlternative.set(AlternativeTrackFlag::inverted); _previousTrackRollEnd = TrackRoll::None; @@ -318,7 +318,7 @@ namespace OpenRCT2::Ui::Windows } } - currentRide->SetToDefaultInspectionInterval(); + currentRide->setToDefaultInspectionInterval(); auto intent = Intent(WindowClass::Ride); intent.PutExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); ContextOpenIntent(&intent); @@ -341,7 +341,7 @@ namespace OpenRCT2::Ui::Windows { return; } - const auto& rtd = currentRide->GetRideTypeDescriptor(); + const auto& rtd = currentRide->getRideTypeDescriptor(); const auto currentTrackDrawerDescriptor = getCurrentTrackDrawerDescriptor(rtd); uint64_t disabledWidgets = 0; @@ -413,7 +413,7 @@ namespace OpenRCT2::Ui::Windows if (!IsTrackEnabled(TrackGroup::slope) && !IsTrackEnabled(TrackGroup::slopeSteepDown) && !IsTrackEnabled(TrackGroup::slopeSteepUp)) { - if (!currentRide->GetRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) + if (!currentRide->getRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) { // Disable all slopes disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_SLOPE_DOWN_STEEP) @@ -434,7 +434,7 @@ namespace OpenRCT2::Ui::Windows disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); } } - if (currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift) + if (currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift) && !GetGameState().Cheats.enableAllDrawableTrackPieces) { // Disable lift hill toggle and banking if current track piece is uphill @@ -805,7 +805,7 @@ namespace OpenRCT2::Ui::Windows } disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE) | (1uLL << WIDX_SLOPE_DOWN_STEEP); - if (currentRide->GetRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) + if (currentRide->getRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) { disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); @@ -819,7 +819,7 @@ namespace OpenRCT2::Ui::Windows } disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE) | (1uLL << WIDX_SLOPE_UP_STEEP); - if (currentRide->GetRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) + if (currentRide->getRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) { disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); @@ -867,7 +867,7 @@ namespace OpenRCT2::Ui::Windows if (_currentlySelectedTrack == TrackCurve::LeftSmall || _currentlySelectedTrack == TrackCurve::RightSmall) { if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None - && (!currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift) + && (!currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift) || GetGameState().Cheats.enableAllDrawableTrackPieces)) { disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); @@ -1258,7 +1258,7 @@ namespace OpenRCT2::Ui::Windows { _currentTrackRollEnd = TrackRoll::None; } - if (currentRide->GetRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) + if (currentRide->getRideTypeDescriptor().SupportsTrackGroup(TrackGroup::reverseFreefall)) { if (_rideConstructionState == RideConstructionState::Front && _currentlySelectedTrack == TrackCurve::None) @@ -1544,7 +1544,7 @@ namespace OpenRCT2::Ui::Windows StringId stringId = STR_RIDE_CONSTRUCTION_SPECIAL; if (_currentlySelectedTrack.isTrackType) { - const auto& rtd = currentRide->GetRideTypeDescriptor(); + const auto& rtd = currentRide->getRideTypeDescriptor(); const auto& ted = GetTrackElementDescriptor(_currentlySelectedTrack.trackType); stringId = ted.description; if (stringId == STR_RAPIDS && rtd.Category != RideCategory::water) @@ -1574,7 +1574,7 @@ namespace OpenRCT2::Ui::Windows // Simulate button auto& simulateWidget = widgets[WIDX_SIMULATE]; simulateWidget.type = WindowWidgetType::Empty; - if (currentRide->SupportsStatus(RideStatus::simulating)) + if (currentRide->supportsStatus(RideStatus::simulating)) { simulateWidget.type = WindowWidgetType::FlatBtn; if (currentRide->status == RideStatus::simulating) @@ -1588,7 +1588,7 @@ namespace OpenRCT2::Ui::Windows } // Set window title arguments - currentRide->FormatNameTo(ft); + currentRide->formatNameTo(ft); } static void OnDrawUpdateCoveredPieces(const TrackDrawerDescriptor& trackDrawerDescriptor, std::span widgets) @@ -1677,7 +1677,7 @@ namespace OpenRCT2::Ui::Windows hold_down_widgets = (1u << WIDX_CONSTRUCT) | (1u << WIDX_DEMOLISH) | (1u << WIDX_NEXT_SECTION) | (1u << WIDX_PREVIOUS_SECTION); - if (rtd.HasFlag(RtdFlag::isShopOrFacility) || !currentRide->HasStation()) + if (rtd.HasFlag(RtdFlag::isShopOrFacility) || !currentRide->hasStation()) { widgets[WIDX_ENTRANCE_EXIT_GROUPBOX].type = WindowWidgetType::Empty; widgets[WIDX_ENTRANCE].type = WindowWidgetType::Empty; @@ -1795,7 +1795,7 @@ namespace OpenRCT2::Ui::Windows } const auto& gameState = GetGameState(); - if (currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift) + if (currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift) && (_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60) && !gameState.Cheats.enableAllDrawableTrackPieces) { @@ -1804,7 +1804,7 @@ namespace OpenRCT2::Ui::Windows if ((IsTrackEnabled(TrackGroup::liftHill) && !_currentlySelectedTrack.isTrackType) || (gameState.Cheats.enableChainLiftOnAllTrack - && currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack))) + && currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack))) { widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn; } @@ -2407,7 +2407,7 @@ namespace OpenRCT2::Ui::Windows if (currentRide != nullptr) { // When flat rides are deleted, the window should be reset so the currentRide can be placed again. - const auto& rtd = currentRide->GetRideTypeDescriptor(); + const auto& rtd = currentRide->getRideTypeDescriptor(); if (rtd.HasFlag(RtdFlag::isFlatRide) && !rtd.HasFlag(RtdFlag::isShopOrFacility)) { RideInitialiseConstructionWindow(*currentRide); @@ -2548,7 +2548,7 @@ namespace OpenRCT2::Ui::Windows auto currentRide = GetRide(_currentRideIndex); if (currentRide != nullptr) { - const auto& rtd = currentRide->GetRideTypeDescriptor(); + const auto& rtd = currentRide->getRideTypeDescriptor(); if (rtd.Category != RideCategory::water) trackPieceStringId = STR_LOG_BUMPS; } @@ -2613,7 +2613,7 @@ namespace OpenRCT2::Ui::Windows if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful) { ToolCancel(); - if (!currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { windowMgr->CloseByClass(WindowClass::RideConstruction); } @@ -2705,9 +2705,9 @@ namespace OpenRCT2::Ui::Windows tempTrackTileElement.AsTrack()->SetRideIndex(rideIndex); const auto& ted = GetTrackElementDescriptor(trackType); - const auto* rideEntry = currentRide->GetRideEntry(); + const auto* rideEntry = currentRide->getRideEntry(); auto clearanceHeight = (rideEntry != nullptr) ? rideEntry->Clearance - : currentRide->GetRideTypeDescriptor().Heights.ClearanceHeight; + : currentRide->getRideTypeDescriptor().Heights.ClearanceHeight; for (uint8_t i = 0; i < ted.numSequences; i++) { @@ -2824,7 +2824,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); - const auto& rtd = currentRide->GetRideTypeDescriptor(); + const auto& rtd = currentRide->getRideTypeDescriptor(); switch (rtd.ConstructionWindowContext) { case RideConstructionWindowContext::Maze: @@ -3093,7 +3093,7 @@ namespace OpenRCT2::Ui::Windows { WindowRideConstructionUpdateEnabledTrackPieces(); if (auto currentRide = GetRide(_currentRideIndex); - !currentRide || currentRide->GetRideTypeDescriptor().specialType == RtdSpecialType::maze) + !currentRide || currentRide->getRideTypeDescriptor().specialType == RtdSpecialType::maze) { return; } @@ -3137,11 +3137,11 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; - auto trackDrawerDescriptor = getCurrentTrackDrawerDescriptor(ride->GetRideTypeDescriptor()); + auto trackDrawerDescriptor = getCurrentTrackDrawerDescriptor(ride->getRideTypeDescriptor()); UpdateEnabledRideGroups(trackDrawerDescriptor); } @@ -3327,7 +3327,7 @@ namespace OpenRCT2::Ui::Windows return; } - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) { auto* windowMgr = GetWindowManager(); @@ -3430,7 +3430,7 @@ namespace OpenRCT2::Ui::Windows } if (_autoRotatingShop && _rideConstructionState == RideConstructionState::Place - && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + && ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { PathElement* pathsByDir[kNumOrthogonalDirections]; @@ -3621,7 +3621,7 @@ namespace OpenRCT2::Ui::Windows // search for z value to build at, up to max ride height int numAttempts = (z <= MAX_TRACK_HEIGHT ? ((MAX_TRACK_HEIGHT - z) / kCoordsZStep + 1) : 2); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) @@ -4728,7 +4728,7 @@ namespace OpenRCT2::Ui::Windows return kMoney64Undefined; RideConstructionRemoveGhosts(); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { int32_t flags = GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST; @@ -4760,7 +4760,7 @@ namespace OpenRCT2::Ui::Windows int16_t zBegin{}, zEnd{}; const auto& ted = GetTrackElementDescriptor(trackType); const TrackCoordinates& coords = ted.coordinates; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { zBegin = coords.zBegin; zEnd = coords.zEnd; @@ -4975,7 +4975,7 @@ namespace OpenRCT2::Ui::Windows } } - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); const auto trackDrawerDescriptor = getCurrentTrackDrawerDescriptor(rtd); if (trackDrawerDescriptor.HasCoveredPieces() && _currentTrackAlternative.has(AlternativeTrackFlag::alternativePieces)) { @@ -5111,7 +5111,7 @@ namespace OpenRCT2::Ui::Windows int32_t y = _unkF440C5.y; int32_t z = _unkF440C5.z; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { const int32_t flags = GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST; diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index bc50e6fa64..33916013e2 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -491,10 +491,10 @@ namespace OpenRCT2::Ui::Windows { auto c = static_cast(page); allClosed = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& rideRef) { - return rideRef.GetClassification() == c && rideRef.status == RideStatus::open; + return rideRef.getClassification() == c && rideRef.status == RideStatus::open; }); allOpen = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& rideRef) { - return rideRef.GetClassification() == c && rideRef.status != RideStatus::open; + return rideRef.getClassification() == c && rideRef.status != RideStatus::open; }); } @@ -569,7 +569,7 @@ namespace OpenRCT2::Ui::Windows // Ride name auto ft = Formatter(); - ridePtr->FormatNameTo(ft); + ridePtr->formatNameTo(ft); DrawTextEllipsised(dpi, { 0, y - 1 }, 159, format, ft); // Ride information @@ -582,11 +582,11 @@ namespace OpenRCT2::Ui::Windows case INFORMATION_TYPE_STATUS: formatSecondaryEnabled = false; ft.Rewind(); - ridePtr->FormatStatusTo(ft); + ridePtr->formatStatusTo(ft); // Make test red and bold if broken down or crashed - if ((ridePtr->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) - || (ridePtr->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if ((ridePtr->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) + || (ridePtr->lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { format = STR_RED_OUTLINED_STRING; } @@ -617,14 +617,14 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_TOTAL_CUSTOMERS: formatSecondary = STR_RIDE_LIST_TOTAL_CUSTOMERS_LABEL; - ft.Add(ridePtr->total_customers); + ft.Add(ridePtr->totalCustomers); break; case INFORMATION_TYPE_TOTAL_PROFIT: formatSecondary = 0; - if (ridePtr->total_profit != kMoney64Undefined) + if (ridePtr->totalProfit != kMoney64Undefined) { formatSecondary = STR_RIDE_LIST_TOTAL_PROFIT_LABEL; - ft.Add(ridePtr->total_profit); + ft.Add(ridePtr->totalProfit); } break; case INFORMATION_TYPE_CUSTOMERS: @@ -633,7 +633,7 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_AGE: { - const auto age = DateGetYear(ridePtr->GetAge()); + const auto age = DateGetYear(ridePtr->getAge()); switch (age) { case 0: @@ -651,23 +651,23 @@ namespace OpenRCT2::Ui::Windows } case INFORMATION_TYPE_INCOME: formatSecondary = 0; - if (ridePtr->income_per_hour != kMoney64Undefined) + if (ridePtr->incomePerHour != kMoney64Undefined) { formatSecondary = STR_RIDE_LIST_INCOME_LABEL; - ft.Add(ridePtr->income_per_hour); + ft.Add(ridePtr->incomePerHour); } break; case INFORMATION_TYPE_RUNNING_COST: formatSecondary = STR_RIDE_LIST_RUNNING_COST_UNKNOWN; - if (ridePtr->upkeep_cost != kMoney64Undefined) + if (ridePtr->upkeepCost != kMoney64Undefined) { formatSecondary = STR_RIDE_LIST_RUNNING_COST_LABEL; - ft.Add(ridePtr->upkeep_cost * 16); + ft.Add(ridePtr->upkeepCost * 16); } break; case INFORMATION_TYPE_QUEUE_LENGTH: { - const auto queueLength = ridePtr->GetTotalQueueLength(); + const auto queueLength = ridePtr->getTotalQueueLength(); ft.Add(queueLength); if (queueLength == 1) @@ -686,7 +686,7 @@ namespace OpenRCT2::Ui::Windows } case INFORMATION_TYPE_QUEUE_TIME: { - const auto maxQueueTime = ridePtr->GetMaxQueueTime(); + const auto maxQueueTime = ridePtr->getMaxQueueTime(); ft.Add(maxQueueTime); if (maxQueueTime > 1) @@ -700,7 +700,7 @@ namespace OpenRCT2::Ui::Windows break; } case INFORMATION_TYPE_RELIABILITY: - ft.Add(ridePtr->reliability_percentage); + ft.Add(ridePtr->reliabilityPercentage); formatSecondary = STR_RELIABILITY_LABEL; break; case INFORMATION_TYPE_DOWN_TIME: @@ -709,11 +709,11 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_GUESTS_FAVOURITE: formatSecondary = 0; - if (ridePtr->IsRide()) + if (ridePtr->isRide()) { - ft.Add(ridePtr->guests_favourite); - formatSecondary = ridePtr->guests_favourite == 1 ? STR_GUESTS_FAVOURITE_LABEL - : STR_GUESTS_FAVOURITE_PLURAL_LABEL; + ft.Add(ridePtr->guestsFavourite); + formatSecondary = ridePtr->guestsFavourite == 1 ? STR_GUESTS_FAVOURITE_LABEL + : STR_GUESTS_FAVOURITE_PLURAL_LABEL; } break; case INFORMATION_TYPE_EXCITEMENT: @@ -822,20 +822,20 @@ namespace OpenRCT2::Ui::Windows _rideList.clear(); for (auto& rideRef : GetRideManager()) { - if (rideRef.GetClassification() != static_cast(page) + if (rideRef.getClassification() != static_cast(page) || (rideRef.status == RideStatus::closed && !RideHasAnyTrackElements(rideRef))) { continue; } - if (rideRef.window_invalidate_flags & RIDE_INVALIDATE_RIDE_LIST) + if (rideRef.windowInvalidateFlags & RIDE_INVALIDATE_RIDE_LIST) { - rideRef.window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_LIST; + rideRef.windowInvalidateFlags &= ~RIDE_INVALIDATE_RIDE_LIST; } RideListEntry entry{}; entry.Id = rideRef.id; - entry.Name = rideRef.GetName(); + entry.Name = rideRef.getName(); _rideList.push_back(std::move(entry)); } @@ -862,12 +862,12 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_TOTAL_CUSTOMERS: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.total_customers <= otherRide.total_customers; + return thisRide.totalCustomers <= otherRide.totalCustomers; }); break; case INFORMATION_TYPE_TOTAL_PROFIT: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.total_profit <= otherRide.total_profit; + return thisRide.totalProfit <= otherRide.totalProfit; }); break; case INFORMATION_TYPE_CUSTOMERS: @@ -877,32 +877,32 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_AGE: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.build_date <= otherRide.build_date; + return thisRide.buildDate <= otherRide.buildDate; }); break; case INFORMATION_TYPE_INCOME: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.income_per_hour <= otherRide.income_per_hour; + return thisRide.incomePerHour <= otherRide.incomePerHour; }); break; case INFORMATION_TYPE_RUNNING_COST: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.upkeep_cost <= otherRide.upkeep_cost; + return thisRide.upkeepCost <= otherRide.upkeepCost; }); break; case INFORMATION_TYPE_QUEUE_LENGTH: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.GetTotalQueueLength() <= otherRide.GetTotalQueueLength(); + return thisRide.getTotalQueueLength() <= otherRide.getTotalQueueLength(); }); break; case INFORMATION_TYPE_QUEUE_TIME: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.GetMaxQueueTime() <= otherRide.GetMaxQueueTime(); + return thisRide.getMaxQueueTime() <= otherRide.getMaxQueueTime(); }); break; case INFORMATION_TYPE_RELIABILITY: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.reliability_percentage <= otherRide.reliability_percentage; + return thisRide.reliabilityPercentage <= otherRide.reliabilityPercentage; }); break; case INFORMATION_TYPE_DOWN_TIME: @@ -912,7 +912,7 @@ namespace OpenRCT2::Ui::Windows break; case INFORMATION_TYPE_GUESTS_FAVOURITE: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.guests_favourite <= otherRide.guests_favourite; + return thisRide.guestsFavourite <= otherRide.guestsFavourite; }); break; case INFORMATION_TYPE_EXCITEMENT: @@ -949,7 +949,7 @@ namespace OpenRCT2::Ui::Windows for (auto& rideRef : GetRideManager()) { if (rideRef.status != RideStatus::closed - && rideRef.GetClassification() == static_cast(page)) + && rideRef.getClassification() == static_cast(page)) { auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::closed); GameActions::Execute(&gameAction); @@ -962,7 +962,7 @@ namespace OpenRCT2::Ui::Windows { for (auto& rideRef : GetRideManager()) { - if (rideRef.status != RideStatus::open && rideRef.GetClassification() == static_cast(page)) + if (rideRef.status != RideStatus::open && rideRef.getClassification() == static_cast(page)) { auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::open); GameActions::Execute(&gameAction); diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index cd48e8832c..62c19976a8 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1245,7 +1245,7 @@ static uint64_t PageDisabledWidgets[] = { if (rideTile != nullptr) { ft = Formatter(); - rideTile->FormatNameTo(ft); + rideTile->formatNameTo(ft); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { colours[1] }); diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index e674634400..21f3c8581b 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -246,7 +246,7 @@ void SetupInUseSelectionFlags() for (auto& ride : GetRideManager()) { Editor::SetSelectedObject(ObjectType::ride, ride.subtype, ObjectSelectionFlags::InUse); - Editor::SetSelectedObject(ObjectType::station, ride.entrance_style, ObjectSelectionFlags::InUse); + Editor::SetSelectedObject(ObjectType::station, ride.entranceStyle, ObjectSelectionFlags::InUse); Editor::SetSelectedObject(ObjectType::music, ride.music, ObjectSelectionFlags::InUse); } diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 86186d39df..9830ce2d56 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -313,7 +313,7 @@ namespace OpenRCT2 ContextBroadcastIntent(&restoreProvisionalIntent); VehicleUpdateAll(); UpdateAllMiscEntities(); - Ride::UpdateAll(); + Ride::updateAll(); if (!isInEditorMode()) { diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 7e7aad2791..db6568c27f 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -523,26 +523,25 @@ void CheatSetAction::FixBrokenRides() const { for (auto& ride : GetRideManager()) { - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) { auto mechanic = RideGetAssignedMechanic(ride); if (mechanic != nullptr) { - if (ride.mechanic_status == RIDE_MECHANIC_STATUS_FIXING) + if (ride.mechanicStatus == RIDE_MECHANIC_STATUS_FIXING) { mechanic->RideSubState = PeepRideSubState::ApproachExit; } else if ( - ride.mechanic_status == RIDE_MECHANIC_STATUS_CALLING - || ride.mechanic_status == RIDE_MECHANIC_STATUS_HEADING) + ride.mechanicStatus == RIDE_MECHANIC_STATUS_CALLING || ride.mechanicStatus == RIDE_MECHANIC_STATUS_HEADING) { mechanic->RemoveFromRide(); } } RideFixBreakdown(ride, 0); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } } @@ -551,7 +550,7 @@ void CheatSetAction::RenewRides() const { for (auto& ride : GetRideManager()) { - ride.Renew(); + ride.renew(); } auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByClass(WindowClass::Ride); @@ -562,8 +561,8 @@ void CheatSetAction::ResetRideCrashStatus() const for (auto& ride : GetRideManager()) { // Reset crash status and history - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_CRASHED; - ride.last_crash_type = RIDE_CRASH_TYPE_NONE; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_CRASHED; + ride.lastCrashType = RIDE_CRASH_TYPE_NONE; } auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByClass(WindowClass::Ride); @@ -574,7 +573,7 @@ void CheatSetAction::Set10MinuteInspection() const for (auto& ride : GetRideManager()) { // Set inspection interval to 10 minutes - ride.inspection_interval = RIDE_INSPECTION_EVERY_10_MINUTES; + ride.inspectionInterval = RIDE_INSPECTION_EVERY_10_MINUTES; } auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByClass(WindowClass::Ride); @@ -720,9 +719,9 @@ void CheatSetAction::RemoveAllGuests() const { for (auto& ride : GetRideManager()) { - ride.num_riders = 0; + ride.numRiders = 0; - for (auto& station : ride.GetStations()) + for (auto& station : ride.getStations()) { station.QueueLength = 0; station.LastPeepInQueue = EntityId::GetNull(); diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 65799a5ad8..9a34f7ccf3 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -280,14 +280,14 @@ StringId LandSetHeightAction::CheckRideSupports() const if (ride == nullptr) continue; - const auto* rideEntry = ride->GetRideEntry(); + const auto* rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) continue; int32_t maxHeight = rideEntry->max_height; if (maxHeight == 0) { - maxHeight = ride->GetRideTypeDescriptor().Heights.MaxHeight; + maxHeight = ride->getRideTypeDescriptor().Heights.MaxHeight; } int32_t zDelta = trackElement->ClearanceHeight - _height; diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 7f5aab8b09..81d9492400 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -95,7 +95,7 @@ GameActions::Result MazePlaceTrackAction::Query() const heightDifference /= kCoordsZPerTinyZ; auto* ride = GetRide(_rideIndex); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (heightDifference > rtd.Heights.MaxHeight) { res.Error = GameActions::Status::TooHigh; @@ -193,13 +193,13 @@ GameActions::Result MazePlaceTrackAction::Execute() const MapInvalidateTileFull(startLoc); - ride->maze_tiles++; - ride->GetStation().SetBaseZ(trackElement->GetBaseZ()); - ride->GetStation().Start = { 0, 0 }; + ride->mazeTiles++; + ride->getStation().SetBaseZ(trackElement->GetBaseZ()); + ride->getStation().Start = { 0, 0 }; - if (ride->maze_tiles == 1) + if (ride->mazeTiles == 1) { - ride->overall_view = startLoc; + ride->overallView = startLoc; } return res; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 883698907f..2e489dd743 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -130,7 +130,7 @@ GameActions::Result MazeSetTrackAction::Query() const heightDifference /= kCoordsZPerTinyZ; auto* ride = GetRide(_rideIndex); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (heightDifference > rtd.Heights.MaxHeight) { res.Error = GameActions::Status::TooHigh; @@ -232,13 +232,13 @@ GameActions::Result MazeSetTrackAction::Execute() const MapInvalidateTileFull(startLoc); - ride->maze_tiles++; - ride->GetStation().SetBaseZ(tileElement->GetBaseZ()); - ride->GetStation().Start = { 0, 0 }; + ride->mazeTiles++; + ride->getStation().SetBaseZ(tileElement->GetBaseZ()); + ride->getStation().Start = { 0, 0 }; if (_initialPlacement && !(flags & GAME_COMMAND_FLAG_GHOST)) { - ride->overall_view = startLoc; + ride->overallView = startLoc; } } @@ -333,8 +333,8 @@ GameActions::Result MazeSetTrackAction::Execute() const if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888) { TileElementRemove(tileElement); - ride->ValidateStations(); - ride->maze_tiles--; + ride->validateStations(); + ride->mazeTiles--; } return res; diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index dcb3c769ef..638ca213d5 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -144,19 +144,19 @@ GameActions::Result RideCreateAction::Execute() const ride->type = _rideType; ride->subtype = rideEntryIndex; - ride->SetColourPreset(_colour1); - ride->overall_view.SetNull(); - ride->SetNameToDefault(); + ride->setColourPreset(_colour1); + ride->overallView.SetNull(); + ride->setNameToDefault(); // Default initialize all stations. RideStation station{}; station.Start.SetNull(); station.Entrance.SetNull(); station.Exit.SetNull(); - std::ranges::fill(ride->GetStations(), station); + std::ranges::fill(ride->getStations(), station); ride->status = RideStatus::closed; - ride->NumTrains = 1; + ride->numTrains = 1; auto& gameState = GetGameState(); if (gameState.Cheats.disableTrainLengthLimit) @@ -164,25 +164,25 @@ GameActions::Result RideCreateAction::Execute() const // Reduce amount of proposed trains to prevent 32 trains from always spawning when limits are disabled if (rideEntry->cars_per_flat_ride == kNoFlatRideCars) { - ride->ProposedNumTrains = 12; + ride->proposedNumTrains = 12; } else { - ride->ProposedNumTrains = rideEntry->cars_per_flat_ride; + ride->proposedNumTrains = rideEntry->cars_per_flat_ride; } } else { - ride->ProposedNumTrains = 32; + ride->proposedNumTrains = 32; } - ride->max_trains = OpenRCT2::Limits::kMaxTrainsPerRide; - ride->num_cars_per_train = 1; - ride->proposed_num_cars_per_train = rideEntry->max_cars_in_train; - ride->min_waiting_time = 10; - ride->max_waiting_time = 60; - ride->depart_flags = RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH | 3; + ride->maxTrains = OpenRCT2::Limits::kMaxTrainsPerRide; + ride->numCarsPerTrain = 1; + ride->proposedNumCarsPerTrain = rideEntry->max_cars_in_train; + ride->minWaitingTime = 10; + ride->maxWaitingTime = 60; + ride->departFlags = RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH | 3; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.HasFlag(RtdFlag::allowMusic)) { auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); @@ -191,15 +191,15 @@ GameActions::Result RideCreateAction::Execute() const { if (rtd.HasFlag(RtdFlag::hasMusicByDefault)) { - ride->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + ride->lifecycleFlags |= RIDE_LIFECYCLE_MUSIC; } } } const auto& operatingSettings = rtd.OperatingSettings; - ride->operation_option = (operatingSettings.MinValue * 3 + operatingSettings.MaxValue) / 4; + ride->operationOption = (operatingSettings.MinValue * 3 + operatingSettings.MaxValue) / 4; - ride->lift_hill_speed = rtd.LiftData.minimum_speed; + ride->liftHillSpeed = rtd.LiftData.minimum_speed; ride->ratings.setNull(); @@ -272,28 +272,28 @@ GameActions::Result RideCreateAction::Execute() const ride->value = kRideValueUndefined; ride->satisfaction = 255; ride->popularity = 255; - ride->build_date = GetDate().GetMonthsElapsed(); - ride->music_tune_id = kTuneIDNull; + ride->buildDate = GetDate().GetMonthsElapsed(); + ride->musicTuneId = kTuneIDNull; - ride->breakdown_reason = 255; - ride->upkeep_cost = kMoney64Undefined; + ride->breakdownReason = 255; + ride->upkeepCost = kMoney64Undefined; ride->reliability = kRideInitialReliability; - ride->unreliability_factor = 1; - ride->inspection_interval = RIDE_INSPECTION_EVERY_30_MINUTES; - ride->last_crash_type = RIDE_CRASH_TYPE_NONE; - ride->income_per_hour = kMoney64Undefined; + ride->unreliabilityFactor = 1; + ride->inspectionInterval = RIDE_INSPECTION_EVERY_30_MINUTES; + ride->lastCrashType = RIDE_CRASH_TYPE_NONE; + ride->incomePerHour = kMoney64Undefined; ride->profit = kMoney64Undefined; - ride->entrance_style = kObjectEntryIndexNull; + ride->entranceStyle = kObjectEntryIndexNull; if (rtd.HasFlag(RtdFlag::hasEntranceAndExit)) { - ride->entrance_style = _entranceObjectIndex; + ride->entranceStyle = _entranceObjectIndex; } - ride->num_circuits = 1; - ride->mode = ride->GetDefaultMode(); - ride->MinCarsPerTrain = rideEntry->min_cars_in_train; - ride->MaxCarsPerTrain = rideEntry->max_cars_in_train; + ride->numCircuits = 1; + ride->mode = ride->getDefaultMode(); + ride->minCarsPerTrain = rideEntry->min_cars_in_train; + ride->maxCarsPerTrain = rideEntry->max_cars_in_train; RideSetVehicleColoursToRandomPreset(*ride, _colour2); auto* windowMgr = Ui::GetWindowManager(); diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 0bb9c984f4..470c812b29 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -63,7 +63,7 @@ GameActions::Result RideDemolishAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); } - if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + if ((ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _modifyType == RideModifyType::demolish) && !GetGameState().Cheats.makeAllDestructible) { @@ -81,13 +81,12 @@ GameActions::Result RideDemolishAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_MUST_BE_CLOSED_FIRST); } - if (ride->num_riders > 0) + if (ride->numRiders > 0) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_RIDE_NOT_YET_EMPTY); } - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) - || ride->GetRideTypeDescriptor().AvailableBreakdowns == 0) + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) || ride->getRideTypeDescriptor().AvailableBreakdowns == 0) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED); } @@ -125,10 +124,10 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const money64 refundPrice = DemolishTracks(); RideClearForConstruction(ride); - ride.RemovePeeps(); - ride.StopGuestsQueuing(); + ride.removePeeps(); + ride.stopGuestsQueuing(); - ride.ValidateStations(); + ride.validateStations(); RideClearLeftoverEntrances(ride); const auto rideId = ride.id; @@ -148,13 +147,13 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const res.Expenditure = ExpenditureType::RideConstruction; res.Cost = refundPrice; - if (!ride.overall_view.IsNull()) + if (!ride.overallView.IsNull()) { - auto xy = ride.overall_view.ToTileCentre(); + auto xy = ride.overallView.ToTileCentre(); res.Position = { xy, TileElementHeight(xy) }; } - ride.Delete(); + ride.remove(); GetGameState().Park.Value = Park::CalculateParkValue(); // Close windows related to the demolished ride @@ -274,16 +273,16 @@ GameActions::Result RideDemolishAction::RefurbishRide(Ride& ride) const res.Expenditure = ExpenditureType::RideConstruction; res.Cost = GetRefurbishPrice(ride); - ride.Renew(); + ride.renew(); - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_EVER_BEEN_OPENED; - ride.last_crash_type = RIDE_CRASH_TYPE_NONE; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_EVER_BEEN_OPENED; + ride.lastCrashType = RIDE_CRASH_TYPE_NONE; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_CUSTOMER; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_CUSTOMER; - if (!ride.overall_view.IsNull()) + if (!ride.overallView.IsNull()) { - auto location = ride.overall_view.ToTileCentre(); + auto location = ride.overallView.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; } diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index e006d5083b..58088b5c3d 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -76,12 +76,12 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const return GameActions::Result(GameActions::Status::NotClosed, errorTitle, STR_MUST_BE_CLOSED_FIRST); } - if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { return GameActions::Result(GameActions::Status::Disallowed, errorTitle, STR_NOT_ALLOWED_TO_MODIFY_STATION); } - const auto& station = ride->GetStation(_stationNum); + const auto& station = ride->getStation(_stationNum); const auto location = _isExit ? station.Exit : station.Entrance; if (!location.IsNull()) @@ -97,7 +97,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const } } - auto z = ride->GetStation(_stationNum).GetBaseZ(); + auto z = ride->getStation(_stationNum).GetBaseZ(); if (!LocationValid(_loc)) { return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP); @@ -153,10 +153,10 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { RideClearForConstruction(*ride); - ride->RemovePeeps(); + ride->removePeeps(); } - auto& station = ride->GetStation(_stationNum); + auto& station = ride->getStation(_stationNum); const auto location = _isExit ? station.Exit : station.Entrance; if (!location.IsNull()) { diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index 578ba262e2..553f8d0ba7 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -80,7 +80,7 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone); } - if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone); } @@ -124,7 +124,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const if (!isGhost) { RideClearForConstruction(*ride); - ride->RemovePeeps(); + ride->removePeeps(); InvalidateTestResults(*ride); } @@ -157,7 +157,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const TileElementRemove(entranceElement); - auto& station = ride->GetStation(_stationNum); + auto& station = ride->getStation(_stationNum); if (_isExit) { station.Exit.SetNull(); diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index 6e4bf30b29..2789578591 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -70,7 +70,7 @@ GameActions::Result RideFreezeRatingAction::Execute() const break; } - ride->lifecycle_flags |= RIDE_LIFECYCLE_FIXED_RATINGS; + ride->lifecycleFlags |= RIDE_LIFECYCLE_FIXED_RATINGS; auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 4fa37e25a3..958a3c50f1 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -62,7 +62,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::TrackColourMain: case RideSetAppearanceType::TrackColourAdditional: case RideSetAppearanceType::TrackColourSupports: - if (_index >= std::size(ride->track_colour)) + if (_index >= std::size(ride->trackColours)) { LOG_ERROR("Invalid track colour %u", _index); return GameActions::Result( @@ -72,7 +72,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::VehicleColourBody: case RideSetAppearanceType::VehicleColourTrim: case RideSetAppearanceType::VehicleColourTertiary: - if (_index >= std::size(ride->vehicle_colours)) + if (_index >= std::size(ride->vehicleColours)) { LOG_ERROR("Invalid vehicle colour %u", _index); return GameActions::Result( @@ -104,43 +104,43 @@ GameActions::Result RideSetAppearanceAction::Execute() const switch (_type) { case RideSetAppearanceType::TrackColourMain: - ride->track_colour[_index].main = _value; + ride->trackColours[_index].main = _value; GfxInvalidateScreen(); break; case RideSetAppearanceType::TrackColourAdditional: - ride->track_colour[_index].additional = _value; + ride->trackColours[_index].additional = _value; GfxInvalidateScreen(); break; case RideSetAppearanceType::TrackColourSupports: - ride->track_colour[_index].supports = _value; + ride->trackColours[_index].supports = _value; GfxInvalidateScreen(); break; case RideSetAppearanceType::VehicleColourBody: - ride->vehicle_colours[_index].Body = _value; + ride->vehicleColours[_index].Body = _value; RideUpdateVehicleColours(*ride); break; case RideSetAppearanceType::VehicleColourTrim: - ride->vehicle_colours[_index].Trim = _value; + ride->vehicleColours[_index].Trim = _value; RideUpdateVehicleColours(*ride); break; case RideSetAppearanceType::VehicleColourTertiary: - ride->vehicle_colours[_index].Tertiary = _value; + ride->vehicleColours[_index].Tertiary = _value; RideUpdateVehicleColours(*ride); break; case RideSetAppearanceType::VehicleColourScheme: ride->vehicleColourSettings = static_cast(_value); - for (uint32_t i = 1; i < std::size(ride->vehicle_colours); i++) + for (uint32_t i = 1; i < std::size(ride->vehicleColours); i++) { - ride->vehicle_colours[i] = ride->vehicle_colours[0]; + ride->vehicleColours[i] = ride->vehicleColours[0]; } RideUpdateVehicleColours(*ride); break; case RideSetAppearanceType::EntranceStyle: - ride->entrance_style = _value; + ride->entranceStyle = _value; GfxInvalidateScreen(); break; case RideSetAppearanceType::SellingItemColourIsRandom: - ride->SetLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS, static_cast(_value)); + ride->setLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS, static_cast(_value)); break; } @@ -148,9 +148,9 @@ GameActions::Result RideSetAppearanceAction::Execute() const windowMgr->InvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); auto res = GameActions::Result(); - if (!ride->overall_view.IsNull()) + if (!ride->overallView.IsNull()) { - auto location = ride->overall_view.ToTileCentre(); + auto location = ride->overallView.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; } diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index eab6a2fdd8..39b8b4f3ea 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -55,7 +55,7 @@ GameActions::Result RideSetNameAction::Query() const GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); } - if (!_name.empty() && Ride::NameExists(_name, ride->id)) + if (!_name.empty() && Ride::nameExists(_name, ride->id)) { return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERROR_EXISTING_NAME); @@ -76,11 +76,11 @@ GameActions::Result RideSetNameAction::Execute() const if (_name.empty()) { - ride->SetNameToDefault(); + ride->setNameToDefault(); } else { - ride->custom_name = _name; + ride->customName = _name; } ScrollingTextInvalidate(); @@ -93,7 +93,7 @@ GameActions::Result RideSetNameAction::Execute() const windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST)); auto res = GameActions::Result(); - auto location = ride->overall_view.ToTileCentre(); + auto location = ride->overallView.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; return res; diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index e6d96827ae..4fc90b3512 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -101,9 +101,9 @@ GameActions::Result RideSetPriceAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } - if (!ride->overall_view.IsNull()) + if (!ride->overallView.IsNull()) { - auto location = ride->overall_view.ToTileCentre(); + auto location = ride->overallView.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; } @@ -114,7 +114,7 @@ GameActions::Result RideSetPriceAction::Execute() const { shopItem = ShopItem::Admission; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::toilet) { shopItem = rideEntry->shop_item[0]; @@ -138,8 +138,8 @@ GameActions::Result RideSetPriceAction::Execute() const shopItem = rideEntry->shop_item[1]; if (shopItem == ShopItem::None) { - shopItem = ride->GetRideTypeDescriptor().PhotoItem; - if ((ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) == 0) + shopItem = ride->getRideTypeDescriptor().PhotoItem; + if ((ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) == 0) { ride->price[1] = _price; windowMgr->InvalidateByClass(WindowClass::Ride); @@ -167,7 +167,7 @@ void RideSetPriceAction::RideSetCommonPrice(ShopItem shopItem) const { auto invalidate = false; auto rideEntry = GetRideEntryByIndex(ride.subtype); - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::toilet && shopItem == ShopItem::Admission) { if (ride.price[0] != _price) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index a67eee0f43..55e7ec5f14 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -58,7 +58,7 @@ GameActions::Result RideSetSettingAction::Query() const switch (_setting) { case RideSetSetting::Mode: - if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING); @@ -134,7 +134,7 @@ GameActions::Result RideSetSettingAction::Query() const } break; case RideSetSetting::NumCircuits: - if (ride->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT && _value > 1) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT && _value > 1) { return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, @@ -179,76 +179,76 @@ GameActions::Result RideSetSettingAction::Execute() const case RideSetSetting::Mode: InvalidateTestResults(*ride); RideClearForConstruction(*ride); - ride->RemovePeeps(); + ride->removePeeps(); ride->mode = static_cast(_value); - ride->UpdateMaxVehicles(); - ride->UpdateNumberOfCircuits(); + ride->updateMaxVehicles(); + ride->updateNumberOfCircuits(); break; case RideSetSetting::Departure: - ride->depart_flags = _value; + ride->departFlags = _value; break; case RideSetSetting::MinWaitingTime: - ride->min_waiting_time = _value; - ride->max_waiting_time = std::max(_value, ride->max_waiting_time); + ride->minWaitingTime = _value; + ride->maxWaitingTime = std::max(_value, ride->maxWaitingTime); break; case RideSetSetting::MaxWaitingTime: - ride->max_waiting_time = _value; - ride->min_waiting_time = std::min(_value, ride->min_waiting_time); + ride->maxWaitingTime = _value; + ride->minWaitingTime = std::min(_value, ride->minWaitingTime); break; case RideSetSetting::Operation: InvalidateTestResults(*ride); - ride->operation_option = _value; + ride->operationOption = _value; break; case RideSetSetting::InspectionInterval: if (_value == RIDE_INSPECTION_NEVER) { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; } - ride->inspection_interval = _value; + ride->inspectionInterval = _value; break; case RideSetSetting::Music: - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_MUSIC; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_MUSIC; if (_value) { - ride->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + ride->lifecycleFlags |= RIDE_LIFECYCLE_MUSIC; } break; case RideSetSetting::MusicType: if (_value != ride->music) { ride->music = _value; - ride->music_tune_id = kTuneIDNull; + ride->musicTuneId = kTuneIDNull; } break; case RideSetSetting::LiftHillSpeed: - if (_value != ride->lift_hill_speed) + if (_value != ride->liftHillSpeed) { - ride->lift_hill_speed = _value; + ride->liftHillSpeed = _value; InvalidateTestResults(*ride); } break; case RideSetSetting::NumCircuits: - if (_value != ride->num_circuits) + if (_value != ride->numCircuits) { - ride->num_circuits = _value; + ride->numCircuits = _value; InvalidateTestResults(*ride); } break; case RideSetSetting::RideType: ride->type = _value; - ride->UpdateRideTypeForAllPieces(); + ride->updateRideTypeForAllPieces(); GfxInvalidateScreen(); break; } auto res = GameActions::Result(); - if (!ride->overall_view.IsNull()) + if (!ride->overallView.IsNull()) { - auto location = ride->overall_view.ToTileCentre(); + auto location = ride->overallView.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; } auto* windowMgr = Ui::GetWindowManager(); @@ -258,14 +258,14 @@ GameActions::Result RideSetSettingAction::Execute() const bool RideSetSettingAction::RideIsModeValid(const Ride& ride) const { - return ride.GetRideTypeDescriptor().RideModes & (1uLL << _value); + return ride.getRideTypeDescriptor().RideModes & (1uLL << _value); } bool RideSetSettingAction::RideIsValidLiftHillSpeed(const Ride& ride) const { auto& gameState = GetGameState(); - int32_t minSpeed = gameState.Cheats.unlockOperatingLimits ? 0 : ride.GetRideTypeDescriptor().LiftData.minimum_speed; - int32_t maxSpeed = gameState.Cheats.unlockOperatingLimits ? 255 : ride.GetRideTypeDescriptor().LiftData.maximum_speed; + int32_t minSpeed = gameState.Cheats.unlockOperatingLimits ? 0 : ride.getRideTypeDescriptor().LiftData.minimum_speed; + int32_t maxSpeed = gameState.Cheats.unlockOperatingLimits ? 255 : ride.getRideTypeDescriptor().LiftData.maximum_speed; return _value >= minSpeed && _value <= maxSpeed; } @@ -278,7 +278,7 @@ bool RideSetSettingAction::RideIsValidNumCircuits() const bool RideSetSettingAction::RideIsValidOperationOption(const Ride& ride) const { - const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; + const auto& operatingSettings = ride.getRideTypeDescriptor().OperatingSettings; uint8_t minValue = operatingSettings.MinValue; uint8_t maxValue = operatingSettings.MaxValue; if (GetGameState().Cheats.unlockOperatingLimits) @@ -307,7 +307,7 @@ StringId RideSetSettingAction::GetOperationErrorMessage(const Ride& ride) const case RideMode::backwardRotation: return STR_CANT_CHANGE_NUMBER_OF_ROTATIONS; default: - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) { return STR_CANT_CHANGE_THIS; } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 715a1c38b3..a3ff08ad13 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -78,10 +78,10 @@ GameActions::Result RideSetStatusAction::Query() const res.ErrorTitle = _StatusErrorTitles[EnumValue(_status)]; Formatter ft(res.ErrorMessageArgs.data()); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); if (_status != ride->status) { - if (_status == RideStatus::simulating && (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (_status == RideStatus::simulating && (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { // Simulating will force clear the track, so make sure player can't cheat around a break down res.Error = GameActions::Status::Disallowed; @@ -93,13 +93,13 @@ GameActions::Result RideSetStatusAction::Query() const switch (_status) { case RideStatus::open: - modeSwitchResult = ride->Open(false); + modeSwitchResult = ride->open(false); break; case RideStatus::testing: - modeSwitchResult = ride->Test(false); + modeSwitchResult = ride->test(false); break; case RideStatus::simulating: - modeSwitchResult = ride->Simulate(false); + modeSwitchResult = ride->simulate(false); break; default: break; @@ -134,10 +134,10 @@ GameActions::Result RideSetStatusAction::Execute() const Formatter ft(res.ErrorMessageArgs.data()); ft.Increment(6); - ride->FormatNameTo(ft); - if (!ride->overall_view.IsNull()) + ride->formatNameTo(ft); + if (!ride->overallView.IsNull()) { - auto location = ride->overall_view.ToTileCentre(); + auto location = ride->overallView.ToTileCentre(); res.Position = { location, TileElementHeight(location) }; } @@ -148,27 +148,27 @@ GameActions::Result RideSetStatusAction::Execute() const case RideStatus::closed: if (ride->status == _status || ride->status == RideStatus::simulating) { - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_CRASHED; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_CRASHED; RideClearForConstruction(*ride); - ride->RemovePeeps(); + ride->removePeeps(); } } ride->status = RideStatus::closed; - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; - ride->race_winner = EntityId::GetNull(); - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; + ride->raceWinner = EntityId::GetNull(); + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; windowMgr->InvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); break; case RideStatus::simulating: { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_CRASHED; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_CRASHED; RideClearForConstruction(*ride); - ride->RemovePeeps(); + ride->removePeeps(); - const auto modeSwitchResult = ride->Simulate(true); + const auto modeSwitchResult = ride->simulate(true); if (!modeSwitchResult.Successful) { res.Error = GameActions::Status::Unknown; @@ -177,12 +177,12 @@ GameActions::Result RideSetStatusAction::Execute() const } ride->status = _status; - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; - ride->race_winner = EntityId::GetNull(); - ride->current_issues = 0; - ride->last_issue_time = 0; - ride->GetMeasurement(); - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; + ride->raceWinner = EntityId::GetNull(); + ride->currentIssues = 0; + ride->lastIssueTime = 0; + ride->getMeasurement(); + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; windowMgr->InvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); break; } @@ -197,7 +197,7 @@ GameActions::Result RideSetStatusAction::Execute() const if (ride->status == RideStatus::simulating) { RideClearForConstruction(*ride); - ride->RemovePeeps(); + ride->removePeeps(); } // Fix #3183: Make sure we close the construction window so the ride finishes any editing code before opening @@ -210,7 +210,7 @@ GameActions::Result RideSetStatusAction::Execute() const if (_status == RideStatus::testing) { - const auto modeSwitchResult = ride->Test(true); + const auto modeSwitchResult = ride->test(true); if (!modeSwitchResult.Successful) { res.Error = GameActions::Status::Unknown; @@ -220,7 +220,7 @@ GameActions::Result RideSetStatusAction::Execute() const } else { - const auto modeSwitchResult = ride->Open(true); + const auto modeSwitchResult = ride->open(true); if (!modeSwitchResult.Successful) { res.Error = GameActions::Status::Unknown; @@ -229,12 +229,12 @@ GameActions::Result RideSetStatusAction::Execute() const } } - ride->race_winner = EntityId::GetNull(); + ride->raceWinner = EntityId::GetNull(); ride->status = _status; - ride->current_issues = 0; - ride->last_issue_time = 0; - ride->GetMeasurement(); - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride->currentIssues = 0; + ride->lastIssueTime = 0; + ride->getMeasurement(); + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; windowMgr->InvalidateByNumber(WindowClass::Ride, _rideIndex.ToUnderlying()); break; } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index b40ddede60..f0aad1b7ce 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -75,7 +75,7 @@ GameActions::Result RideSetVehicleAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); } - if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { return GameActions::Result(GameActions::Status::Broken, errTitle, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING); } @@ -137,16 +137,16 @@ GameActions::Result RideSetVehicleAction::Execute() const { case RideSetVehicleType::NumTrains: RideClearForConstruction(*ride); - ride->RemovePeeps(); - ride->vehicle_change_timeout = 100; + ride->removePeeps(); + ride->vehicleChangeTimeout = 100; - ride->ProposedNumTrains = _value; + ride->proposedNumTrains = _value; break; case RideSetVehicleType::NumCarsPerTrain: { RideClearForConstruction(*ride); - ride->RemovePeeps(); - ride->vehicle_change_timeout = 100; + ride->removePeeps(); + ride->vehicleChangeTimeout = 100; InvalidateTestResults(*ride); auto rideEntry = GetRideEntryByIndex(ride->subtype); @@ -156,19 +156,19 @@ GameActions::Result RideSetVehicleAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } uint8_t clampValue = _value; - static_assert(sizeof(clampValue) == sizeof(ride->proposed_num_cars_per_train)); + static_assert(sizeof(clampValue) == sizeof(ride->proposedNumCarsPerTrain)); if (!GetGameState().Cheats.disableTrainLengthLimit) { clampValue = std::clamp(clampValue, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train); } - ride->proposed_num_cars_per_train = clampValue; + ride->proposedNumCarsPerTrain = clampValue; break; } case RideSetVehicleType::RideEntry: { RideClearForConstruction(*ride); - ride->RemovePeeps(); - ride->vehicle_change_timeout = 100; + ride->removePeeps(); + ride->vehicleChangeTimeout = 100; InvalidateTestResults(*ride); ride->subtype = _value; @@ -182,18 +182,18 @@ GameActions::Result RideSetVehicleAction::Execute() const RideSetVehicleColoursToRandomPreset(*ride, _colour); if (!GetGameState().Cheats.disableTrainLengthLimit) { - ride->proposed_num_cars_per_train = std::clamp( - ride->proposed_num_cars_per_train, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train); + ride->proposedNumCarsPerTrain = std::clamp( + ride->proposedNumCarsPerTrain, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train); } break; } case RideSetVehicleType::TrainsReversed: { RideClearForConstruction(*ride); - ride->RemovePeeps(); - ride->vehicle_change_timeout = 100; + ride->removePeeps(); + ride->vehicleChangeTimeout = 100; - ride->SetLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS, _value); + ride->setLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS, _value); break; } @@ -202,13 +202,13 @@ GameActions::Result RideSetVehicleAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } - ride->num_circuits = 1; - ride->UpdateMaxVehicles(); + ride->numCircuits = 1; + ride->updateMaxVehicles(); auto res = GameActions::Result(); - if (!ride->overall_view.IsNull()) + if (!ride->overallView.IsNull()) { - auto location = ride->overall_view.ToTileCentre(); + auto location = ride->overallView.ToTileCentre(); res.Position = { location, TileElementHeight(res.Position) }; } @@ -227,10 +227,10 @@ bool RideSetVehicleAction::RideIsVehicleTypeValid(const Ride& ride) const auto& gameState = GetGameState(); { - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (gameState.Cheats.showVehiclesFromOtherTrackTypes && !( - ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide) || rtd.specialType == RtdSpecialType::maze + ride.getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide) || rtd.specialType == RtdSpecialType::maze || rtd.specialType == RtdSpecialType::miniGolf)) { selectionShouldBeExpanded = true; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index da26ec056b..fc16a96ee6 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -238,24 +238,24 @@ GameActions::Result TrackDesignAction::Execute() const auto numCircuits = std::max(1, _td.operation.numCircuits); SetOperatingSettingNested(ride->id, RideSetSetting::NumCircuits, numCircuits, flags); - ride->SetToDefaultInspectionInterval(); - ride->lifecycle_flags |= RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN; + ride->setToDefaultInspectionInterval(); + ride->lifecycleFlags |= RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN; ride->vehicleColourSettings = _td.appearance.vehicleColourSettings; - ride->entrance_style = objManager.GetLoadedObjectEntryIndex(_td.appearance.stationObjectIdentifier); - if (ride->entrance_style == kObjectEntryIndexNull) + ride->entranceStyle = objManager.GetLoadedObjectEntryIndex(_td.appearance.stationObjectIdentifier); + if (ride->entranceStyle == kObjectEntryIndexNull) { - ride->entrance_style = gameState.LastEntranceStyle; + ride->entranceStyle = gameState.LastEntranceStyle; } - for (size_t i = 0; i < std::min(std::size(ride->track_colour), std::size(_td.appearance.trackColours)); i++) + for (size_t i = 0; i < std::min(std::size(ride->trackColours), std::size(_td.appearance.trackColours)); i++) { - ride->track_colour[i] = _td.appearance.trackColours[i]; + ride->trackColours[i] = _td.appearance.trackColours[i]; } for (size_t i = 0; i < Limits::kMaxVehicleColours; i++) { - ride->vehicle_colours[i] = _td.appearance.vehicleColours[i]; + ride->vehicleColours[i] = _td.appearance.vehicleColours[i]; } for (int32_t count = 1; count == 1 || r.Error != GameActions::Status::Ok; ++count) diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index db183dfc1d..f997470a81 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -128,9 +128,9 @@ GameActions::Result TrackPlaceAction::Query() const auto resultData = TrackPlaceActionResult{}; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); - if ((ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation) + if ((ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NOT_ALLOWED_TO_MODIFY_STATION); @@ -150,7 +150,7 @@ GameActions::Result TrackPlaceAction::Query() const { if (_trackType == TrackElemType::OnRidePhoto) { - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, @@ -159,7 +159,7 @@ GameActions::Result TrackPlaceAction::Query() const } else if (_trackType == TrackElemType::CableLiftHill) { - if (ride->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, @@ -450,7 +450,7 @@ GameActions::Result TrackPlaceAction::Execute() const auto resultData = TrackPlaceActionResult{}; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); const auto& ted = GetTrackElementDescriptor(_trackType); @@ -560,7 +560,7 @@ GameActions::Result TrackPlaceAction::Execute() const supportCosts += (supportHeight / (2 * kCoordsZStep)) * rtd.BuildCosts.SupportPrice; int32_t entranceDirections = 0; - if (!ride->overall_view.IsNull()) + if (!ride->overallView.IsNull()) { if (!(GetFlags() & GAME_COMMAND_FLAG_NO_SPEND)) { @@ -568,9 +568,9 @@ GameActions::Result TrackPlaceAction::Execute() const } } - if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.IsNull()) + if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overallView.IsNull()) { - ride->overall_view = mapLoc; + ride->overallView = mapLoc; } auto* trackElement = TileElementInsert(mapLoc, quarterTile.GetBaseQuarterOccupied()); @@ -665,8 +665,8 @@ GameActions::Result TrackPlaceAction::Execute() const { TrackAddStationElement({ mapLoc, _origin.direction }, _rideIndex, GAME_COMMAND_FLAG_APPLY, _fromTrackDesign); } - ride->ValidateStations(); - ride->UpdateMaxVehicles(); + ride->validateStations(); + ride->updateMaxVehicles(); } auto* tileElement = trackElement->as(); @@ -695,17 +695,17 @@ GameActions::Result TrackPlaceAction::Execute() const switch (_trackType) { case TrackElemType::OnRidePhoto: - ride->lifecycle_flags |= RIDE_LIFECYCLE_ON_RIDE_PHOTO; + ride->lifecycleFlags |= RIDE_LIFECYCLE_ON_RIDE_PHOTO; break; case TrackElemType::CableLiftHill: - ride->lifecycle_flags |= RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED; - ride->CableLiftLoc = originLocation; + ride->lifecycleFlags |= RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED; + ride->cableLiftLoc = originLocation; break; case TrackElemType::DiagBlockBrakes: case TrackElemType::BlockBrakes: { - ride->num_block_brakes++; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_OPERATING; + ride->numBlockBrakes++; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING; // change the current mode to its circuit blocked equivalent RideMode newMode = RideMode::continuousCircuitBlockSectioned; @@ -736,7 +736,7 @@ GameActions::Result TrackPlaceAction::Execute() const break; [[fallthrough]]; case TrackElemType::CableLiftHill: - ride->num_block_brakes++; + ride->numBlockBrakes++; break; default: break; diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 03dffa0749..930ad01948 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -240,14 +240,14 @@ GameActions::Result TrackRemoveAction::Query() const _support_height = 10; } - supportCosts += (_support_height / 2) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice; + supportCosts += (_support_height / 2) * ride->getRideTypeDescriptor().BuildCosts.SupportPrice; } - money64 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; + money64 price = ride->getRideTypeDescriptor().BuildCosts.TrackPrice; price *= ted.priceModifier; price >>= 16; price = supportCosts + price; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) { // 70% modifier for opened rides price = (price * 45875) / 65536; @@ -416,7 +416,7 @@ GameActions::Result TrackRemoveAction::Execute() const _support_height = 10; } - supportCosts += (_support_height / 2) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice; + supportCosts += (_support_height / 2) * ride->getRideTypeDescriptor().BuildCosts.SupportPrice; // If the removed tile is a station modify station properties. // Don't do this if the ride is simulating and the tile is a ghost to prevent desyncs. @@ -433,7 +433,7 @@ GameActions::Result TrackRemoveAction::Execute() const } } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::trackMustBeOnWater)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::trackMustBeOnWater)) { surfaceElement->SetHasTrackThatNeedsWater(false); } @@ -445,10 +445,10 @@ GameActions::Result TrackRemoveAction::Execute() const FootpathRemoveEdgesAt(mapLoc, tileElement); } TileElementRemove(tileElement); - ride->ValidateStations(); + ride->validateStations(); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - ride->UpdateMaxVehicles(); + ride->updateMaxVehicles(); } } @@ -457,17 +457,17 @@ GameActions::Result TrackRemoveAction::Execute() const switch (trackType) { case TrackElemType::OnRidePhoto: - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_ON_RIDE_PHOTO; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_ON_RIDE_PHOTO; break; case TrackElemType::CableLiftHill: - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED; break; case TrackElemType::BlockBrakes: case TrackElemType::DiagBlockBrakes: - ride->num_block_brakes--; - if (ride->num_block_brakes == 0) + ride->numBlockBrakes--; + if (ride->numBlockBrakes == 0) { - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_OPERATING; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING; RideMode newMode = RideMode::continuousCircuit; if (ride->mode == RideMode::poweredLaunchBlockSectioned) { @@ -493,18 +493,18 @@ GameActions::Result TrackRemoveAction::Execute() const break; [[fallthrough]]; case TrackElemType::CableLiftHill: - ride->num_block_brakes--; + ride->numBlockBrakes--; break; default: break; } } - money64 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; + money64 price = ride->getRideTypeDescriptor().BuildCosts.TrackPrice; price *= ted.priceModifier; price >>= 16; price = supportCosts + price; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) { // 70% modifier for opened rides price = (price * 45875) / 65536; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 987bab0a9e..4d8c2bf14c 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -439,7 +439,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::allowDoorsOnTrack)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::allowDoorsOnTrack)) { return false; } diff --git a/src/openrct2/core/UnitConversion.cpp b/src/openrct2/core/UnitConversion.cpp index c3cd36d14e..8ed4b2aa6e 100644 --- a/src/openrct2/core/UnitConversion.cpp +++ b/src/openrct2/core/UnitConversion.cpp @@ -62,7 +62,7 @@ namespace OpenRCT2 int32_t ToHumanReadableSpeed(int32_t baseSpeed) { // Divide this value by 29127 to get the human-readable max speed - // (in RCT2, display_speed = (max_speed * 9) >> 18) + // (in RCT2, display_speed = (maxSpeed * 9) >> 18) return (baseSpeed * 9) >> 18; } diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8475217278..9eeae4be97 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1020,7 +1020,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) auto ride = GetRide(CurrentRide); if (ride != nullptr) { - PeepThoughtType thought_type = ride->GetRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) + PeepThoughtType thought_type = ride->getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? PeepThoughtType::GetOut : PeepThoughtType::GetOff; @@ -1647,25 +1647,25 @@ bool Guest::DecideAndBuyItem(Ride& ride, const ShopItem shopItem, money64 price) satisfaction++; } } - ride.UpdateSatisfaction(satisfaction); + ride.updateSatisfaction(satisfaction); } // The peep has now decided to buy the item (or, specifically, has not been // dissuaded so far). GiveItem(shopItem); - const auto hasRandomShopColour = ride.HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); + const auto hasRandomShopColour = ride.hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); if (shopItem == ShopItem::TShirt) - TshirtColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; + TshirtColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; if (shopItem == ShopItem::Hat) - HatColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; + HatColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; if (shopItem == ShopItem::Balloon) - BalloonColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; + BalloonColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; if (shopItem == ShopItem::Umbrella) - UmbrellaColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; + UmbrellaColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; if (shopItem == ShopItem::Map) ResetPathfindGoal(); @@ -1733,11 +1733,11 @@ bool Guest::DecideAndBuyItem(Ride& ride, const ShopItem shopItem, money64 price) { SpendMoney(*expend_type, price, expenditure); } - ride.total_profit += (price - shopItemDescriptor.Cost); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; - ride.cur_num_customers++; - ride.total_customers++; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + ride.totalProfit += (price - shopItemDescriptor.Cost); + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; + ride.curNumCustomers++; + ride.totalCustomers++; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; return true; } @@ -1761,7 +1761,7 @@ void Guest::OnEnterRide(Ride& ride) else if (satisfaction >= 0) rideSatisfaction = 1; - ride.UpdateSatisfaction(rideSatisfaction); + ride.updateSatisfaction(rideSatisfaction); // Update various peep stats. if (GuestNumRides < 255) @@ -1825,8 +1825,8 @@ void Guest::OnExitRide(Ride& ride) } } - ride.total_customers++; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + ride.totalCustomers++; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; } /** @@ -1873,7 +1873,7 @@ Ride* Guest::FindBestRideToGoOn() const auto rideIndex = ride.id.ToUnderlying(); if (rideConsideration.size() > rideIndex && rideConsideration[rideIndex]) { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_QUEUE_FULL)) { if (ShouldGoOnRide(ride, StationIndex::FromUnderlying(0), false, true) && RideHasRatings(ride)) { @@ -1934,7 +1934,7 @@ OpenRCT2::BitSet Guest::FindRidesToGoOn() // Always take the tall rides into consideration (realistic as you can usually see them from anywhere in the park) for (auto& ride : GetRideManager()) { - if (ride.highest_drop_height > 66 || ride.ratings.excitement >= MakeRideRating(8, 00)) + if (ride.highestDropHeight > 66 || ride.ratings.excitement >= MakeRideRating(8, 00)) { rideConsideration[ride.id.ToUnderlying()] = true; } @@ -1955,11 +1955,11 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // Indicates whether a peep is physically at the ride, or is just thinking about going on the ride. bool peepAtRide = !thinking; - if (ride.status == RideStatus::open && !(ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride.status == RideStatus::open && !(ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { // Peeps that are leaving the park will refuse to go on any rides, with the exception of free transport rides. assert(ride.type < std::size(kRideTypeDescriptors)); - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isTransportRide) || ride.value == kRideValueUndefined + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::isTransportRide) || ride.value == kRideValueUndefined || RideGetPrice(ride) != 0) { if (PeepFlags & PEEP_FLAGS_LEAVING_PARK) @@ -1969,7 +1969,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b } } - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { return ShouldGoToShop(ride, peepAtRide); } @@ -1978,7 +1978,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // This means we can use the existing !(flags & 4) check. if (peepAtRide) { - auto& station = ride.GetStation(entranceNum); + auto& station = ride.getStation(entranceNum); // Rides without queues can only have one peep waiting at a time. if (!atQueue) @@ -2020,7 +2020,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // Assuming the queue conditions are met, peeps will always go on free transport rides. // Ride ratings, recent crashes and weather will all be ignored. auto ridePrice = RideGetPrice(ride); - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isTransportRide) || ride.value == kRideValueUndefined + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::isTransportRide) || ride.value == kRideValueUndefined || ridePrice != 0) { if (PreviousRide == ride.id) @@ -2052,7 +2052,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b } // If happy enough, peeps will ignore the fact that a ride has recently crashed. - if (ride.last_crash_type != RIDE_CRASH_TYPE_NONE && Happiness < 225) + if (ride.lastCrashType != RIDE_CRASH_TYPE_NONE && Happiness < 225) { if (peepAtRide) { @@ -2061,7 +2061,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b { HappinessTarget -= 8; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } ChoseNotToGoOnRide(ride, peepAtRide, true); return false; @@ -2091,7 +2091,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b { HappinessTarget -= 8; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } ChoseNotToGoOnRide(ride, peepAtRide, true); return false; @@ -2116,7 +2116,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b { HappinessTarget -= 8; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } ChoseNotToGoOnRide(ride, peepAtRide, true); return false; @@ -2139,7 +2139,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b { HappinessTarget -= 8; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } ChoseNotToGoOnRide(ride, peepAtRide, true); return false; @@ -2158,7 +2158,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // If the ride has not yet been rated and is capable of having g-forces, // there's a 90% chance that the peep will ignore it. - if (!RideHasRatings(ride) && ride.GetRideTypeDescriptor().HasFlag(RtdFlag::checkGForces)) + if (!RideHasRatings(ride) && ride.getRideTypeDescriptor().HasFlag(RtdFlag::checkGForces)) { if ((ScenarioRand() & 0xFFFF) > 0x1999u) { @@ -2168,9 +2168,8 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b if (!GetGameState().Cheats.ignoreRideIntensity) { - if (ride.max_positive_vertical_g > MakeFixed16_2dp(5, 00) - || ride.max_negative_vertical_g < MakeFixed16_2dp(-4, 00) - || ride.max_lateral_g > MakeFixed16_2dp(4, 00)) + if (ride.maxPositiveVerticalG > MakeFixed16_2dp(5, 00) + || ride.maxNegativeVerticalG < MakeFixed16_2dp(-4, 00) || ride.maxLateralG > MakeFixed16_2dp(4, 00)) { ChoseNotToGoOnRide(ride, peepAtRide, false); return false; @@ -2199,7 +2198,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b { HappinessTarget -= 16; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } ChoseNotToGoOnRide(ride, peepAtRide, true); return false; @@ -2222,7 +2221,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // At this point, the peep has decided to go on the ride. if (peepAtRide) { - ride.UpdatePopularity(1); + ride.updatePopularity(1); } if (ride.id == GuestHeadingToRideId) @@ -2230,7 +2229,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b PeepResetRideHeading(this); } - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_QUEUE_FULL; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_QUEUE_FULL; return true; } @@ -2247,7 +2246,7 @@ bool Guest::ShouldGoToShop(Ride& ride, bool peepAtShop) return false; } - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::toilet) { if (Toilet < 70) @@ -2267,7 +2266,7 @@ bool Guest::ShouldGoToShop(Ride& ride, bool peepAtShop) { HappinessTarget -= 16; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } ChoseNotToGoOnRide(ride, peepAtShop, true); return false; @@ -2304,7 +2303,7 @@ bool Guest::ShouldGoToShop(Ride& ride, bool peepAtShop) if (peepAtShop) { - ride.UpdatePopularity(1); + ride.updatePopularity(1); if (ride.id == GuestHeadingToRideId) { PeepResetRideHeading(this); @@ -2380,13 +2379,13 @@ bool Guest::ShouldRideWhileRaining(const Ride& ride) { // Peeps will go on rides that are sufficiently undercover while it's raining. // The threshold is fairly low and only requires about 10-15% of the ride to be undercover. - if (ride.sheltered_eighths >= 3) + if (ride.shelteredEighths >= 3) { return true; } // Peeps with umbrellas will go on rides where they can use their umbrella on it (like the Maze) 50% of the time - if (HasItem(ShopItem::Umbrella) && ride.GetRideTypeDescriptor().HasFlag(RtdFlag::guestsCanUseUmbrella) + if (HasItem(ShopItem::Umbrella) && ride.getRideTypeDescriptor().HasFlag(RtdFlag::guestsCanUseUmbrella) && (ScenarioRand() & 2) == 0) { return true; @@ -2432,7 +2431,7 @@ static bool PeepHasVoucherForFreeRide(Guest* peep, const Ride& ride) */ static void PeepTriedToEnterFullQueue(Guest* peep, Ride& ride) { - ride.lifecycle_flags |= RIDE_LIFECYCLE_QUEUE_FULL; + ride.lifecycleFlags |= RIDE_LIFECYCLE_QUEUE_FULL; peep->PreviousRide = ride.id; peep->PreviousRideTimeOut = 0; // Change status "Heading to" to "Walking" if queue is full @@ -2457,7 +2456,7 @@ static void PeepRideIsTooIntense(Guest* peep, Ride& ride, bool peepAtRide) { peep->HappinessTarget -= 8; } - ride.UpdatePopularity(0); + ride.updatePopularity(0); } peep->ChoseNotToGoOnRide(ride, peepAtRide, true); } @@ -2469,7 +2468,7 @@ static void PeepRideIsTooIntense(Guest* peep, Ride& ride, bool peepAtRide) static Vehicle* PeepChooseCarFromRide(Peep* peep, const Ride& ride, std::span carArray) { uint8_t chosen_car = ScenarioRand(); - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasGForces) && ((chosen_car & 0xC) != 0xC)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasGForces) && ((chosen_car & 0xC) != 0xC)) { chosen_car = (ScenarioRand() & 1) ? 0 : static_cast(carArray.size()) - 1; } @@ -2521,7 +2520,7 @@ static void PeepChooseSeatFromCar(Peep* peep, const Ride& ride, Vehicle* vehicle */ void Guest::GoToRideEntrance(const Ride& ride) { - const auto& station = ride.GetStation(CurrentRideStation); + const auto& station = ride.getStation(CurrentRideStation); if (station.Entrance.IsNull()) { RemoveFromQueue(); @@ -2566,10 +2565,10 @@ static bool FindVehicleToEnter( if (ride.mode == RideMode::dodgems || ride.mode == RideMode::race) { - if (ride.lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) return false; - for (int32_t i = 0; i < ride.NumTrains; ++i) + for (int32_t i = 0; i < ride.numTrains; ++i) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle == nullptr) @@ -2586,7 +2585,7 @@ static bool FindVehicleToEnter( } else { - chosen_train = ride.GetStation(guest.CurrentRideStation).TrainAtStation; + chosen_train = ride.getStation(guest.CurrentRideStation).TrainAtStation; } if (chosen_train >= OpenRCT2::Limits::kMaxTrainsPerRide) { @@ -2879,7 +2878,7 @@ static void PeepUpdateRideNauseaGrowth(Guest* peep, const Ride& ride) static bool PeepShouldGoOnRideAgain(Guest* peep, const Ride& ride) { - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::guestsWillRideAgain)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::guestsWillRideAgain)) return false; if (!RideHasRatings(ride)) return false; @@ -3001,12 +3000,12 @@ static PeepThoughtType PeepAssessSurroundings(int16_t centre_x, int16_t centre_y if (ride == nullptr) break; - bool isPlayingMusic = ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC && ride->status != RideStatus::closed - && !(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)); + bool isPlayingMusic = ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC && ride->status != RideStatus::closed + && !(ride->lifecycleFlags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)); if (!isPlayingMusic) break; - const auto* musicObject = ride->GetMusicObject(); + const auto* musicObject = ride->getMusicObject(); if (musicObject == nullptr) break; @@ -3222,7 +3221,7 @@ static void PeepHeadForNearestRide(Guest* peep, bool considerOnlyCloseRides, T p { if (rideConsideration[ride.id.ToUnderlying()]) { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_QUEUE_FULL)) { if (peep->ShouldGoOnRide(ride, StationIndex::FromUnderlying(0), false, true)) { @@ -3240,7 +3239,7 @@ static void PeepHeadForNearestRide(Guest* peep, bool considerOnlyCloseRides, T p auto ride = GetRide(potentialRides[i]); if (ride != nullptr) { - auto rideLocation = ride->GetStation().Start; + auto rideLocation = ride->getStation().Start; int32_t distance = abs(rideLocation.x - peep->x) + abs(rideLocation.y - peep->y); if (distance < closestRideDistance) { @@ -3263,7 +3262,7 @@ static void PeepHeadForNearestRide(Guest* peep, bool considerOnlyCloseRides, T p static void PeepHeadForNearestRideWithFlag(Guest* peep, bool considerOnlyCloseRides, RtdFlag rtdFlag) { PeepHeadForNearestRide( - peep, considerOnlyCloseRides, [rtdFlag](const Ride& ride) { return ride.GetRideTypeDescriptor().HasFlag(rtdFlag); }); + peep, considerOnlyCloseRides, [rtdFlag](const Ride& ride) { return ride.getRideTypeDescriptor().HasFlag(rtdFlag); }); } static void GuestHeadForNearestRideWithSpecialType(Guest& guest, bool considerOnlyCloseRides, RtdSpecialType specialType) @@ -3273,7 +3272,7 @@ static void GuestHeadForNearestRideWithSpecialType(Guest& guest, bool considerOn return; } PeepHeadForNearestRide(&guest, considerOnlyCloseRides, [specialType](const Ride& ride) { - return ride.GetRideTypeDescriptor().specialType == specialType; + return ride.getRideTypeDescriptor().specialType == specialType; }); } @@ -3349,10 +3348,10 @@ static bool PeepShouldUseCashMachine(Guest* peep, RideId rideIndex) auto ride = GetRide(rideIndex); if (ride != nullptr) { - ride->UpdateSatisfaction(peep->Happiness >> 6); - ride->cur_num_customers++; - ride->total_customers++; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + ride->updateSatisfaction(peep->Happiness >> 6); + ride->curNumCustomers++; + ride->totalCustomers++; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; } return true; } @@ -3423,7 +3422,7 @@ void Guest::UpdateBuying() UpdateCurrentAnimationType(); - ride->no_primary_items_sold++; + ride->numPrimaryItemsSold++; } } else @@ -3440,7 +3439,7 @@ void Guest::UpdateBuying() item_bought = DecideAndBuyItem(*ride, ride_type->shop_item[1], price); if (item_bought) { - ride->no_secondary_items_sold++; + ride->numSecondaryItemsSold++; } } @@ -3451,7 +3450,7 @@ void Guest::UpdateBuying() item_bought = DecideAndBuyItem(*ride, ride_type->shop_item[0], price); if (item_bought) { - ride->no_primary_items_sold++; + ride->numPrimaryItemsSold++; } } } @@ -3459,13 +3458,13 @@ void Guest::UpdateBuying() if (item_bought) { - ride->UpdatePopularity(1); + ride->updatePopularity(1); StopPurchaseThought(ride->type); } else { - ride->UpdatePopularity(0); + ride->updatePopularity(0); } SubState = 1; } @@ -3494,7 +3493,7 @@ void Guest::UpdateRideAtEntrance() int16_t actionZ = z; if (xy_distance < 16) { - const auto& station = ride->GetStation(CurrentRideStation); + const auto& station = ride->getStation(CurrentRideStation); auto entrance = station.Entrance.ToCoordsXYZ(); actionZ = entrance.z + 2; } @@ -3510,9 +3509,9 @@ void Guest::UpdateRideAtEntrance() sfl::static_vector carArray; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) { - if (ride->num_riders >= ride->operation_option) + if (ride->numRiders >= ride->operationOption) return; } else @@ -3521,13 +3520,13 @@ void Guest::UpdateRideAtEntrance() return; } - if (ride->status != RideStatus::open || ride->vehicle_change_timeout != 0) + if (ride->status != RideStatus::open || ride->vehicleChangeTimeout != 0) { PeepUpdateRideAtEntranceTryLeave(this); return; } - if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) return; auto ridePrice = RideGetPrice(*ride); @@ -3537,7 +3536,7 @@ void Guest::UpdateRideAtEntrance() return; } - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) { Vehicle* vehicle = PeepChooseCarFromRide(this, *ride, carArray); PeepChooseSeatFromCar(this, *ride, vehicle); @@ -3577,14 +3576,14 @@ void PeepUpdateRideLeaveEntranceMaze(Guest* peep, Ride& ride, CoordsXYZD& entran peep->SetDestination(entrance_loc, 3); - ride.cur_num_customers++; + ride.curNumCustomers++; peep->OnEnterRide(ride); peep->RideSubState = PeepRideSubState::MazePathfinding; } void PeepUpdateRideLeaveEntranceSpiralSlide(Guest* peep, Ride& ride, CoordsXYZD& entrance_loc) { - entrance_loc = { ride.GetStation(peep->CurrentRideStation).GetStart(), entrance_loc.direction }; + entrance_loc = { ride.getStation(peep->CurrentRideStation).GetStart(), entrance_loc.direction }; TileElement* tile_element = RideGetStationStartTrackElement(ride, peep->CurrentRideStation); @@ -3597,7 +3596,7 @@ void PeepUpdateRideLeaveEntranceSpiralSlide(Guest* peep, Ride& ride, CoordsXYZD& peep->SetDestination(entrance_loc); peep->CurrentCar = 0; - ride.cur_num_customers++; + ride.curNumCustomers++; peep->OnEnterRide(ride); peep->RideSubState = PeepRideSubState::ApproachSpiralSlide; } @@ -3608,13 +3607,13 @@ void PeepUpdateRideLeaveEntranceDefault(Guest* peep, Ride& ride, CoordsXYZD& ent // If the ride type was changed guests will become stuck. // Inform the player about this if its a new issue or hasn't been addressed within 120 seconds. - if ((ride.current_issues & RIDE_ISSUE_GUESTS_STUCK) == 0 || currentTicks - ride.last_issue_time > 3000) + if ((ride.currentIssues & RIDE_ISSUE_GUESTS_STUCK) == 0 || currentTicks - ride.lastIssueTime > 3000) { - ride.current_issues |= RIDE_ISSUE_GUESTS_STUCK; - ride.last_issue_time = currentTicks; + ride.currentIssues |= RIDE_ISSUE_GUESTS_STUCK; + ride.lastIssueTime = currentTicks; auto ft = Formatter(); - ride.FormatNameTo(ft); + ride.formatNameTo(ft); if (Config::Get().notifications.RideWarnings) { News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, peep->CurrentRide.ToUnderlying(), ft); @@ -3649,7 +3648,7 @@ uint8_t Guest::GetWaypointedSeatLocation(const Ride& ride, const CarEntry* vehic void Guest::UpdateRideLeaveEntranceWaypoints(const Ride& ride) { - const auto& station = ride.GetStation(CurrentRideStation); + const auto& station = ride.getStation(CurrentRideStation); if (station.Entrance.IsNull()) { return; @@ -3671,7 +3670,7 @@ void Guest::UpdateRideLeaveEntranceWaypoints(const Ride& ride) Var37 = (direction_entrance | GetWaypointedSeatLocation(ride, carEntry, direction_track) * 4) * 4; - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); CoordsXY waypoint = rtd.GetGuestWaypointLocation(*vehicle, ride, CurrentRideStation); const auto waypointIndex = Var37 / 4u; @@ -3698,7 +3697,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() int16_t actionZ, xy_distance; - const auto* rideEntry = ride->GetRideEntry(); + const auto* rideEntry = ride->getRideEntry(); if (auto loc = UpdateAction(xy_distance); loc.has_value()) { @@ -3718,12 +3717,12 @@ void Guest::UpdateRideAdvanceThroughEntrance() RideSubState = PeepRideSubState::FreeVehicleCheck; } - actionZ = ride->GetStation(CurrentRideStation).GetBaseZ(); + actionZ = ride->getStation(CurrentRideStation).GetBaseZ(); distanceThreshold += 4; if (xy_distance < distanceThreshold) { - actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; + actionZ += ride->getRideTypeDescriptor().Heights.PlatformHeight; } MoveTo({ loc.value(), actionZ }); @@ -3736,9 +3735,9 @@ void Guest::UpdateRideAdvanceThroughEntrance() return; } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) { - const auto& station = ride->GetStation(CurrentRideStation); + const auto& station = ride->getStation(CurrentRideStation); auto entranceLocation = station.Entrance.ToCoordsXYZD(); if (entranceLocation.IsNull()) { @@ -3824,12 +3823,12 @@ void Guest::UpdateRideAdvanceThroughEntrance() */ static void PeepGoToRideExit(Peep* peep, const Ride& ride, int16_t x, int16_t y, int16_t z, uint8_t exit_direction) { - z += ride.GetRideTypeDescriptor().Heights.PlatformHeight; + z += ride.getRideTypeDescriptor().Heights.PlatformHeight; peep->MoveTo({ x, y, z }); Guard::Assert(peep->CurrentRideStation.ToUnderlying() < OpenRCT2::Limits::kMaxStationsPerRide); - auto exit = ride.GetStation(peep->CurrentRideStation).Exit; + auto exit = ride.getStation(peep->CurrentRideStation).Exit; x = exit.x; y = exit.y; x *= 32; @@ -3888,8 +3887,8 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) } else { - ride.total_profit = AddClamp(ride.total_profit, ridePrice); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; + ride.totalProfit = AddClamp(ride.totalProfit, ridePrice); + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; SpendMoney(PaidOnRides, ridePrice, ExpenditureType::ParkRideTickets); } } @@ -3900,7 +3899,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) queueTime += 3; queueTime /= 2; - auto& station = ride.GetStation(CurrentRideStation); + auto& station = ride.getStation(CurrentRideStation); if (queueTime != station.QueueTime) { station.QueueTime = queueTime; @@ -3912,10 +3911,10 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) { auto ft = Formatter(); FormatNameTo(ft); - ride.FormatNameTo(ft); + ride.formatNameTo(ft); StringId msg_string; - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside)) msg_string = STR_PEEP_TRACKING_PEEP_IS_IN_X; else msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X; @@ -3926,7 +3925,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) } } - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::spiralSlide) { SwitchToSpecialSprite(1); @@ -3941,7 +3940,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) */ static void PeepUpdateRideNoFreeVehicleRejoinQueue(Guest* peep, Ride& ride) { - TileCoordsXYZD entranceLocation = ride.GetStation(peep->CurrentRideStation).Entrance; + TileCoordsXYZD entranceLocation = ride.getStation(peep->CurrentRideStation).Entrance; int32_t x = entranceLocation.x * 32; int32_t y = entranceLocation.y * 32; @@ -3955,7 +3954,7 @@ static void PeepUpdateRideNoFreeVehicleRejoinQueue(Guest* peep, Ride& ride) peep->SetState(PeepState::QueuingFront); peep->RideSubState = PeepRideSubState::AtEntrance; - ride.QueueInsertGuestAtFront(peep->CurrentRideStation, peep); + ride.queueInsertGuestAtFront(peep->CurrentRideStation, peep); } /** @@ -3973,9 +3972,9 @@ void Guest::UpdateRideFreeVehicleCheck() if (ride == nullptr) return; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::noVehicles)) { - if (ride->status != RideStatus::open || ride->vehicle_change_timeout != 0 || (++RejoinQueueTimeout) == 0) + if (ride->status != RideStatus::open || ride->vehicleChangeTimeout != 0 || (++RejoinQueueTimeout) == 0) { PeepUpdateRideNoFreeVehicleRejoinQueue(this, *ride); return; @@ -4005,7 +4004,7 @@ void Guest::UpdateRideFreeVehicleCheck() { vehicle->mini_golf_flags &= ~MiniGolfFlag::Flag5; - for (size_t i = 0; i < ride->NumTrains; ++i) + for (size_t i = 0; i < ride->numTrains; ++i) { Vehicle* train = GetEntity(ride->vehicles[i]); if (train == nullptr) @@ -4110,7 +4109,7 @@ void Guest::UpdateRideEnterVehicle() return; vehicle->num_peeps++; - ride->cur_num_customers++; + ride->curNumCustomers++; vehicle->ApplyMass(seatedGuest->Mass); seatedGuest->MoveTo({ kLocationNull, 0, 0 }); @@ -4122,7 +4121,7 @@ void Guest::UpdateRideEnterVehicle() } vehicle->num_peeps++; - ride->cur_num_customers++; + ride->curNumCustomers++; vehicle->ApplyMass(Mass); vehicle->Invalidate(); @@ -4196,7 +4195,7 @@ void Guest::UpdateRideLeaveVehicle() const auto* carEntry = &rideEntry->Cars[vehicle->vehicle_type]; assert(CurrentRideStation.ToUnderlying() < OpenRCT2::Limits::kMaxStationsPerRide); - auto& station = ride->GetStation(CurrentRideStation); + auto& station = ride->getStation(CurrentRideStation); if (!(carEntry->flags & CAR_ENTRY_FLAG_LOADING_WAYPOINTS)) { @@ -4206,7 +4205,7 @@ void Guest::UpdateRideLeaveVehicle() platformLocation.direction = DirectionReverse(exitLocation.direction); - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) { for (; vehicle != nullptr && !vehicle->IsHead(); vehicle = GetEntity(vehicle->prev_vehicle_on_ride)) { @@ -4332,9 +4331,9 @@ void Guest::UpdateRideLeaveVehicle() } CoordsXYZ waypointLoc; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); waypointLoc = { rtd.GetGuestWaypointLocation(*vehicle, *ride, CurrentRideStation), - exitLocation.z + ride->GetRideTypeDescriptor().Heights.PlatformHeight }; + exitLocation.z + ride->getRideTypeDescriptor().Heights.PlatformHeight }; rideEntry = vehicle->GetRideEntry(); carEntry = &rideEntry->Cars[vehicle->vehicle_type]; @@ -4374,10 +4373,10 @@ void Guest::UpdateRideLeaveVehicle() void Guest::UpdateRidePrepareForExit() { const auto* ride = GetRide(CurrentRide); - if (ride == nullptr || CurrentRideStation.ToUnderlying() >= std::size(ride->GetStations())) + if (ride == nullptr || CurrentRideStation.ToUnderlying() >= std::size(ride->getStations())) return; - auto exit = ride->GetStation(CurrentRideStation).Exit; + auto exit = ride->getStation(CurrentRideStation).Exit; auto newDestination = exit.ToCoordsXY().ToTileCentre(); auto [xShift, yShift] = [exit]() { @@ -4393,7 +4392,7 @@ void Guest::UpdateRidePrepareForExit() int16_t shiftMultiplier = 20; - const auto* rideEntry = ride->GetRideEntry(); + const auto* rideEntry = ride->getRideEntry(); if (rideEntry != nullptr) { const auto& carEntry = rideEntry->Cars[rideEntry->DefaultCar]; @@ -4444,9 +4443,9 @@ void Guest::UpdateRideInExit() { if (xy_distance >= 16) { - int16_t actionZ = ride->GetStation(CurrentRideStation).GetBaseZ(); + int16_t actionZ = ride->getStation(CurrentRideStation).GetBaseZ(); - actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; + actionZ += ride->getRideTypeDescriptor().Heights.PlatformHeight; MoveTo({ loc.value(), actionZ }); return; } @@ -4455,12 +4454,12 @@ void Guest::UpdateRideInExit() MoveTo({ loc.value(), z }); } - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) { - ShopItem secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; + ShopItem secondaryItem = ride->getRideTypeDescriptor().PhotoItem; if (DecideAndBuyItem(*ride, secondaryItem, ride->price[1])) { - ride->no_secondary_items_sold++; + ride->numSecondaryItemsSold++; } } RideSubState = PeepRideSubState::LeaveExit; @@ -4469,7 +4468,7 @@ void Guest::UpdateRideInExit() CoordsXY GetGuestWaypointLocationDefault(const Vehicle& vehicle, const Ride& ride, const StationIndex& CurrentRideStation) { - return ride.GetStation(CurrentRideStation).Start.ToTileCentre(); + return ride.getStation(CurrentRideStation).Start.ToTileCentre(); } CoordsXY GetGuestWaypointLocationEnterprise(const Vehicle& vehicle, const Ride& ride, const StationIndex& CurrentRideStation) @@ -4490,7 +4489,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() int16_t xy_distance; uint8_t waypoint = Var37 & 3; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (auto loc = UpdateAction(xy_distance); loc.has_value()) { rtd.UpdateRideApproachVehicleWaypoints(*this, loc.value(), xy_distance); @@ -4538,7 +4537,7 @@ void UpdateRideApproachVehicleWaypointsMotionSimulator(Guest& guest, const Coord int16_t actionZ; auto ride = GetRide(guest.CurrentRide); // Motion simulators have steps this moves the peeps up the steps - actionZ = ride->GetStation(guest.CurrentRideStation).GetBaseZ() + 2; + actionZ = ride->getStation(guest.CurrentRideStation).GetBaseZ() + 2; uint8_t waypoint = guest.Var37 & 3; if (waypoint == 2) @@ -4578,7 +4577,7 @@ void Guest::UpdateRideApproachExitWaypoints() if (ride->type == RIDE_TYPE_MOTION_SIMULATOR) { - actionZ = ride->GetStation(CurrentRideStation).GetBaseZ() + 2; + actionZ = ride->getStation(CurrentRideStation).GetBaseZ() + 2; if ((Var37 & 3) == 1) { @@ -4627,7 +4626,7 @@ void Guest::UpdateRideApproachExitWaypoints() const auto waypoint = Var37 & 3; Guard::Assert(waypoint < 3); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); CoordsXY targetLoc = rtd.GetGuestWaypointLocation(*vehicle, *ride, CurrentRideStation); targetLoc += carEntry.peep_loading_waypoints[carPosition][waypoint]; @@ -4637,7 +4636,7 @@ void Guest::UpdateRideApproachExitWaypoints() Var37 |= 3; - auto targetLoc = ride->GetStation(CurrentRideStation).Exit.ToCoordsXYZD().ToTileCentre(); + auto targetLoc = ride->getStation(CurrentRideStation).Exit.ToCoordsXYZD().ToTileCentre(); uint8_t exit_direction = DirectionReverse(targetLoc.direction); int16_t x_shift = DirectionOffsets[exit_direction].x; @@ -4691,7 +4690,7 @@ void Guest::UpdateRideApproachSpiralSlide() return; } - [[maybe_unused]] const auto& rtd = ride->GetRideTypeDescriptor(); + [[maybe_unused]] const auto& rtd = ride->getRideTypeDescriptor(); if (waypoint == 2) { bool lastRide = false; @@ -4707,7 +4706,7 @@ void Guest::UpdateRideApproachSpiralSlide() if (lastRide) { - auto exit = ride->GetStation(CurrentRideStation).Exit; + auto exit = ride->getStation(CurrentRideStation).Exit; waypoint = 1; auto directionTemp = exit.direction; if (exit.direction == INVALID_DIRECTION) @@ -4715,7 +4714,7 @@ void Guest::UpdateRideApproachSpiralSlide() directionTemp = 0; } Var37 = (directionTemp * 4) | (Var37 & 0x30) | waypoint; - CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; + CoordsXY targetLoc = ride->getStation(CurrentRideStation).Start; assert(rtd.specialType == RtdSpecialType::spiralSlide); targetLoc += kSpiralSlideWalkingPath[Var37]; @@ -4729,7 +4728,7 @@ void Guest::UpdateRideApproachSpiralSlide() // Actually increment the real peep waypoint Var37++; - CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; + CoordsXY targetLoc = ride->getStation(CurrentRideStation).Start; assert(rtd.specialType == RtdSpecialType::spiralSlide); targetLoc += kSpiralSlideWalkingPath[Var37]; @@ -4764,7 +4763,7 @@ void Guest::UpdateRideOnSpiralSlide() if (ride == nullptr) return; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::spiralSlide) return; @@ -4781,13 +4780,13 @@ void Guest::UpdateRideOnSpiralSlide() SetDestination(destination); return; case 1: - if (ride->slide_in_use != 0) + if (ride->slideInUse != 0) return; - ride->slide_in_use++; - ride->slide_peep = Id; - ride->slide_peep_t_shirt_colour = TshirtColour; - ride->spiral_slide_progress = 0; + ride->slideInUse++; + ride->slidePeep = Id; + ride->slidePeepTShirtColour = TshirtColour; + ride->spiralSlideProgress = 0; destination.x++; SetDestination(destination); @@ -4796,7 +4795,7 @@ void Guest::UpdateRideOnSpiralSlide() return; case 3: { - auto newLocation = ride->GetStation(CurrentRideStation).Start; + auto newLocation = ride->getStation(CurrentRideStation).Start; uint8_t dir = (Var37 / 4) & 3; // Set the location that the peep walks to go on slide again @@ -4828,7 +4827,7 @@ void Guest::UpdateRideOnSpiralSlide() uint8_t waypoint = 2; Var37 = (Var37 * 4 & 0x30) + waypoint; - CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; + CoordsXY targetLoc = ride->getStation(CurrentRideStation).Start; targetLoc += kSpiralSlideWalkingPath[Var37]; @@ -4867,9 +4866,9 @@ void Guest::UpdateRideLeaveSpiralSlide() waypoint--; // Actually decrement the peep waypoint Var37--; - CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; + CoordsXY targetLoc = ride->getStation(CurrentRideStation).Start; - [[maybe_unused]] const auto& rtd = ride->GetRideTypeDescriptor(); + [[maybe_unused]] const auto& rtd = ride->getRideTypeDescriptor(); assert(rtd.specialType == RtdSpecialType::spiralSlide); targetLoc += kSpiralSlideWalkingPath[Var37]; @@ -4880,7 +4879,7 @@ void Guest::UpdateRideLeaveSpiralSlide() // Actually force the final waypoint Var37 |= 3; - auto targetLoc = ride->GetStation(CurrentRideStation).Exit.ToCoordsXYZD().ToTileCentre(); + auto targetLoc = ride->getStation(CurrentRideStation).Exit.ToCoordsXYZD().ToTileCentre(); int16_t xShift = DirectionOffsets[DirectionReverse(targetLoc.direction)].x; int16_t yShift = DirectionOffsets[DirectionReverse(targetLoc.direction)].y; @@ -4947,7 +4946,7 @@ void Guest::UpdateRideMazePathfinding() auto targetLoc = GetDestination().ToTileStart(); - auto stationBaseZ = ride->GetStation().GetBaseZ(); + auto stationBaseZ = ride->getStation().GetBaseZ(); // Find the station track element auto trackElement = MapGetTrackElementAt({ targetLoc, stationBaseZ }); @@ -5059,7 +5058,7 @@ void Guest::UpdateRideLeaveExit() { if (ride != nullptr) { - MoveTo({ loc.value(), ride->GetStation(CurrentRideStation).GetBaseZ() }); + MoveTo({ loc.value(), ride->getStation(CurrentRideStation).GetBaseZ() }); } return; } @@ -5072,7 +5071,7 @@ void Guest::UpdateRideLeaveExit() { auto ft = Formatter(); FormatNameTo(ft); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); if (Config::Get().notifications.GuestLeftRide) { @@ -5129,7 +5128,7 @@ void Guest::UpdateRideShopInteract() const int16_t tileCentreX = NextLoc.x + 16; const int16_t tileCentreY = NextLoc.y + 16; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::firstAid) { if (Nausea <= 35) @@ -5193,9 +5192,9 @@ void Guest::UpdateRideShopLeave() auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ride->total_customers++; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; - ride->UpdateSatisfaction(Happiness / 64); + ride->totalCustomers++; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + ride->updateSatisfaction(Happiness / 64); } } @@ -6311,7 +6310,7 @@ static bool PeepShouldWatchRide(TileElement* tileElement) } auto ride = GetRide(tileElement->AsTrack()->GetRideIndex()); - if (ride == nullptr || !ride->IsRide()) + if (ride == nullptr || !ride->isRide()) { return false; } @@ -6332,14 +6331,14 @@ static bool PeepShouldWatchRide(TileElement* tileElement) return true; } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::interestingToLookAt)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::interestingToLookAt)) { if ((ScenarioRand() & 0xFFFF) > 0x3333) { return false; } } - else if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::slightlyInterestingToLookAt)) + else if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::slightlyInterestingToLookAt)) { if ((ScenarioRand() & 0xFFFF) > 0x1000) { @@ -6377,7 +6376,7 @@ bool Loc690FD0(Peep* peep, RideId* rideToView, uint8_t* rideSeatToView, TileElem else { *rideSeatToView = 0; - if (ride->status == RideStatus::open && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride->status == RideStatus::open && !(ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { if (tileElement->GetClearanceZ() > peep->NextLoc.z + (8 * kCoordsZStep)) { @@ -6955,7 +6954,7 @@ void PeepThoughtSetFormatArgs(const PeepThought* thought, Formatter& ft) auto ride = GetRide(thought->rideId); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -7518,7 +7517,7 @@ void Guest::RemoveFromQueue() if (ride == nullptr) return; - auto& station = ride->GetStation(CurrentRideStation); + auto& station = ride->getStation(CurrentRideStation); // Make sure we don't underflow, building while paused might reset it to 0 where peeps have // not yet left the queue. if (station.QueueLength > 0) diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index e6678d477e..207e9ed00d 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -577,8 +577,8 @@ void PeepDecrementNumRiders(Peep* peep) auto ride = GetRide(peep->CurrentRide); if (ride != nullptr) { - ride->num_riders = std::max(0, ride->num_riders - 1); - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride->numRiders = std::max(0, ride->numRiders - 1); + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } } @@ -602,8 +602,8 @@ void PeepWindowStateUpdate(Peep* peep) auto ride = GetRide(peep->CurrentRide); if (ride != nullptr) { - ride->num_riders++; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride->numRiders++; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } @@ -1136,7 +1136,7 @@ void PeepProblemWarningsUpdate() break; } ride = GetRide(peep->GuestHeadingToRideId); - if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RtdFlag::sellsFood)) + if (ride != nullptr && !ride->getRideTypeDescriptor().HasFlag(RtdFlag::sellsFood)) hungerCounter++; break; @@ -1147,7 +1147,7 @@ void PeepProblemWarningsUpdate() break; } ride = GetRide(peep->GuestHeadingToRideId); - if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RtdFlag::sellsDrinks)) + if (ride != nullptr && !ride->getRideTypeDescriptor().HasFlag(RtdFlag::sellsDrinks)) thirstCounter++; break; @@ -1158,7 +1158,7 @@ void PeepProblemWarningsUpdate() break; } ride = GetRide(peep->GuestHeadingToRideId); - if (ride != nullptr && ride->GetRideTypeDescriptor().specialType != RtdSpecialType::toilet) + if (ride != nullptr && ride->getRideTypeDescriptor().specialType != RtdSpecialType::toilet) toiletCounter++; break; @@ -1446,8 +1446,8 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ft.Add(ride->GetRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? STR_IN_RIDE : STR_ON_RIDE); - ride->FormatNameTo(ft); + ft.Add(ride->getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? STR_IN_RIDE : STR_ON_RIDE); + ride->formatNameTo(ft); } else { @@ -1461,7 +1461,7 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -1481,7 +1481,7 @@ void Peep::FormatActionTo(Formatter& ft) const if (ride != nullptr) { ft.Add(STR_HEADING_FOR); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } } else @@ -1498,7 +1498,7 @@ void Peep::FormatActionTo(Formatter& ft) const if (ride != nullptr) { ft.Add(STR_QUEUING_FOR); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } break; } @@ -1512,7 +1512,7 @@ void Peep::FormatActionTo(Formatter& ft) const if (ride != nullptr) { ft.Add((StandingFlags & 0x1) ? STR_WATCHING_CONSTRUCTION_OF : STR_WATCHING_RIDE); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } } else @@ -1555,7 +1555,7 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -1569,7 +1569,7 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -1583,7 +1583,7 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -1597,7 +1597,7 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = GetRide(CurrentRide); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -1854,7 +1854,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ guest->AnimationImageIdOffset = _backupAnimationImageIdOffset; guest->InteractionRideIndex = rideIndex; - auto& station = ride->GetStation(stationNum); + auto& station = ride->getStation(stationNum); auto previous_last = station.LastPeepInQueue; station.LastPeepInQueue = guest->Id; guest->GuestNextInQueue = previous_last; @@ -1870,7 +1870,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ { auto ft = Formatter(); guest->FormatNameTo(ft); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); if (Config::Get().notifications.GuestQueuingForRide) { News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->Id, ft); @@ -2283,7 +2283,7 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) guest->InteractionRideIndex = rideIndex; // Add the peep to the ride queue. - auto& station = ride->GetStation(stationNum); + auto& station = ride->getStation(stationNum); auto old_last_peep = station.LastPeepInQueue; station.LastPeepInQueue = guest->Id; guest->GuestNextInQueue = old_last_peep; @@ -2303,7 +2303,7 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) { auto ft = Formatter(); guest->FormatNameTo(ft); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); if (Config::Get().notifications.GuestQueuingForRide) { News::AddItemToQueue( @@ -2352,7 +2352,7 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) { RideId rideIndex = coords.element->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); - if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride == nullptr || !ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) return false; auto* guest = peep->As(); @@ -2389,7 +2389,7 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) return true; } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::guestsShouldGoInsideFacility)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::guestsShouldGoInsideFacility)) { guest->TimeLost = 0; if (!guest->ShouldGoOnRide(*ride, StationIndex::FromUnderlying(0), false, false)) @@ -2401,8 +2401,8 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) auto cost = ride->price[0]; if (cost != 0 && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY)) { - ride->total_profit += cost; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; + ride->totalProfit += cost; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; guest->SpendMoney(cost, ExpenditureType::ParkRideTickets); } @@ -2413,13 +2413,13 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) guest->RideSubState = PeepRideSubState::ApproachShop; guest->GuestTimeOnRide = 0; - ride->cur_num_customers++; + ride->curNumCustomers++; if (guest->PeepFlags & PEEP_FLAGS_TRACKING) { auto ft = Formatter(); guest->FormatNameTo(ft); - ride->FormatNameTo(ft); - StringId string_id = ride->GetRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) + ride->formatNameTo(ft); + StringId string_id = ride->getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? STR_PEEP_TRACKING_PEEP_IS_IN_X : STR_PEEP_TRACKING_PEEP_IS_ON_X; if (Config::Get().notifications.GuestUsedFacility) diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 44ecfea79c..bf729b7966 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -612,10 +612,10 @@ Direction Staff::MechanicDirectionSurface() const auto ride = GetRide(CurrentRide); if (ride != nullptr && (State == PeepState::Answering || State == PeepState::HeadingToInspection) && (ScenarioRand() & 1)) { - auto location = ride->GetStation(CurrentRideStation).Exit; + auto location = ride->getStation(CurrentRideStation).Exit; if (location.IsNull()) { - location = ride->GetStation(CurrentRideStation).Entrance; + location = ride->getStation(CurrentRideStation).Entrance; } direction = DirectionFromTo(CoordsXY(x, y), location.ToCoordsXY()); @@ -693,10 +693,10 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat { /* Find location of the exit for the target ride station * or if the ride has no exit, the entrance. */ - TileCoordsXYZD location = ride->GetStation(CurrentRideStation).Exit; + TileCoordsXYZD location = ride->getStation(CurrentRideStation).Exit; if (location.IsNull()) { - location = ride->GetStation(CurrentRideStation).Entrance; + location = ride->getStation(CurrentRideStation).Entrance; // If no entrance is present either. This is an incorrect state. if (location.IsNull()) @@ -1234,14 +1234,14 @@ void Staff::UpdateHeadingToInspect() return; } - if (ride->GetStation(CurrentRideStation).Exit.IsNull()) + if (ride->getStation(CurrentRideStation).Exit.IsNull()) { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; SetState(PeepState::Falling); return; } - if (ride->mechanic_status != RIDE_MECHANIC_STATUS_HEADING || !(ride->lifecycle_flags & RIDE_LIFECYCLE_DUE_INSPECTION)) + if (ride->mechanicStatus != RIDE_MECHANIC_STATUS_HEADING || !(ride->lifecycleFlags & RIDE_LIFECYCLE_DUE_INSPECTION)) { SetState(PeepState::Falling); return; @@ -1259,9 +1259,9 @@ void Staff::UpdateHeadingToInspect() MechanicTimeSinceCall++; if (MechanicTimeSinceCall > 2500) { - if (ride->lifecycle_flags & RIDE_LIFECYCLE_DUE_INSPECTION && ride->mechanic_status == RIDE_MECHANIC_STATUS_HEADING) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_DUE_INSPECTION && ride->mechanicStatus == RIDE_MECHANIC_STATUS_HEADING) { - ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; + ride->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; } SetState(PeepState::Falling); return; @@ -1291,7 +1291,7 @@ void Staff::UpdateHeadingToInspect() if (pathingResult & PATHING_RIDE_ENTRANCE) { - if (!ride->GetStation(exitIndex).Exit.IsNull()) + if (!ride->getStation(exitIndex).Exit.IsNull()) { return; } @@ -1311,10 +1311,10 @@ void Staff::UpdateHeadingToInspect() int16_t delta_y = abs(GetLocation().y - GetDestination().y); if (auto loc = UpdateAction(); loc.has_value()) { - auto newZ = ride->GetStation(CurrentRideStation).GetBaseZ(); + auto newZ = ride->getStation(CurrentRideStation).GetBaseZ(); if (delta_y < 20) { - newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; + newZ += ride->getRideTypeDescriptor().Heights.PlatformHeight; } MoveTo({ loc.value(), newZ }); @@ -1332,7 +1332,7 @@ void Staff::UpdateHeadingToInspect() void Staff::UpdateAnswering() { auto ride = GetRide(CurrentRide); - if (ride == nullptr || ride->mechanic_status != RIDE_MECHANIC_STATUS_HEADING) + if (ride == nullptr || ride->mechanicStatus != RIDE_MECHANIC_STATUS_HEADING) { SetState(PeepState::Falling); return; @@ -1369,8 +1369,8 @@ void Staff::UpdateAnswering() MechanicTimeSinceCall++; if (MechanicTimeSinceCall > 2500) { - ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; SetState(PeepState::Falling); return; } @@ -1399,7 +1399,7 @@ void Staff::UpdateAnswering() if (pathingResult & PATHING_RIDE_ENTRANCE) { - if (!ride->GetStation(exitIndex).Exit.IsNull()) + if (!ride->getStation(exitIndex).Exit.IsNull()) { return; } @@ -1421,10 +1421,10 @@ void Staff::UpdateAnswering() int16_t delta_y = abs(y - GetDestination().y); if (auto loc = UpdateAction(); loc.has_value()) { - auto newZ = ride->GetStation(CurrentRideStation).GetBaseZ(); + auto newZ = ride->getStation(CurrentRideStation).GetBaseZ(); if (delta_y < 20) { - newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; + newZ += ride->getRideTypeDescriptor().Heights.PlatformHeight; } MoveTo({ loc.value(), newZ }); @@ -1776,7 +1776,7 @@ enum /** * FixingSubstatesForBreakdown[] defines the applicable peep sub_states for - * mechanics fixing a ride. The array is indexed by breakdown_reason: + * mechanics fixing a ride. The array is indexed by breakdownReason: * - indexes 0-7 are the 8 breakdown reasons (see BREAKDOWN_* in Ride.h) * when fixing a broken down ride; * - index 8 is for inspecting a ride. @@ -1873,7 +1873,7 @@ void Staff::UpdateFixing(int32_t steps) bool firstRun = true; if ((State == PeepState::Inspecting) - && (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN))) + && (ride->lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN))) { // Ride has broken down since Mechanic was called to inspect it. // Mechanic identifies the breakdown and switches to fixing it. @@ -1953,7 +1953,7 @@ void Staff::UpdateFixing(int32_t steps) if (State != PeepState::Inspecting) { - sub_state_sequence_mask = FixingSubstatesForBreakdown[ride->breakdown_reason_pending]; + sub_state_sequence_mask = FixingSubstatesForBreakdown[ride->breakdownReasonPending]; } do @@ -1971,8 +1971,8 @@ void Staff::UpdateFixing(int32_t steps) */ bool Staff::UpdateFixingEnterStation(Ride& ride) const { - ride.mechanic_status = RIDE_MECHANIC_STATUS_FIXING; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_FIXING; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; return true; } @@ -2131,13 +2131,13 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride& ride) { if (!firstRun) { - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation) - || !ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation) + || !ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { return true; } - auto stationPos = ride.GetStation(CurrentRideStation).GetStart(); + auto stationPos = ride.getStation(CurrentRideStation).GetStart(); if (stationPos.IsNull()) { return true; @@ -2218,13 +2218,13 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride& ride) { if (!firstRun) { - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation) - || !ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation) + || !ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { return true; } - auto stationPosition = ride.GetStation(CurrentRideStation).GetStart(); + auto stationPosition = ride.getStation(CurrentRideStation).GetStart(); if (stationPosition.IsNull()) { return true; @@ -2295,8 +2295,8 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, const Ride& ride) { if (!firstRun) { - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation) - || !ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation) + || !ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { return true; } @@ -2348,8 +2348,8 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride& ride) if (AnimationFrameNum == 0x28) { - ride.mechanic_status = RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; } if (AnimationFrameNum == 0x13 || AnimationFrameNum == 0x19 || AnimationFrameNum == 0x1F || AnimationFrameNum == 0x25 @@ -2370,10 +2370,10 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, const Ride& ride) { if (!firstRun) { - auto stationPosition = ride.GetStation(CurrentRideStation).Exit.ToCoordsXY(); + auto stationPosition = ride.getStation(CurrentRideStation).Exit.ToCoordsXY(); if (stationPosition.IsNull()) { - stationPosition = ride.GetStation(CurrentRideStation).Entrance.ToCoordsXY(); + stationPosition = ride.getStation(CurrentRideStation).Entrance.ToCoordsXY(); if (stationPosition.IsNull()) { @@ -2414,7 +2414,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride& r StaffRidesInspected = AddClamp(StaffRidesInspected, 1u); WindowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST; - ride.mechanic_status = RIDE_MECHANIC_STATUS_UNDEFINED; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_UNDEFINED; return true; } @@ -2437,7 +2437,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride& r } RideFixBreakdown(ride, steps); - ride.mechanic_status = RIDE_MECHANIC_STATUS_UNDEFINED; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_UNDEFINED; return true; } @@ -2450,10 +2450,10 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride& ride) { if (!firstRun) { - auto exitPosition = ride.GetStation(CurrentRideStation).Exit.ToCoordsXY(); + auto exitPosition = ride.getStation(CurrentRideStation).Exit.ToCoordsXY(); if (exitPosition.IsNull()) { - exitPosition = ride.GetStation(CurrentRideStation).Entrance.ToCoordsXY(); + exitPosition = ride.getStation(CurrentRideStation).Entrance.ToCoordsXY(); if (exitPosition.IsNull()) { @@ -2474,10 +2474,10 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride& ride) int16_t xy_distance; if (auto loc = UpdateAction(xy_distance); loc.has_value()) { - auto stationHeight = ride.GetStation(CurrentRideStation).GetBaseZ(); + auto stationHeight = ride.getStation(CurrentRideStation).GetBaseZ(); if (xy_distance >= 16) { - stationHeight += ride.GetRideTypeDescriptor().Heights.PlatformHeight; + stationHeight += ride.getRideTypeDescriptor().Heights.PlatformHeight; } MoveTo({ loc.value(), stationHeight }); @@ -2495,11 +2495,10 @@ void Staff::UpdateRideInspected(RideId rideIndex) auto ride = GetRide(rideIndex); if (ride != nullptr) { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; - ride->reliability += ((100 - ride->reliability_percentage) / 4) * (ScenarioRand() & 0xFF); - ride->last_inspection = 0; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_MAIN - | RIDE_INVALIDATE_RIDE_LIST; + ride->lifecycleFlags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; + ride->reliability += ((100 - ride->reliabilityPercentage) / 4) * (ScenarioRand() & 0xFF); + ride->lastInspection = 0; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index a23993cab0..0ab5732b0b 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -161,7 +161,7 @@ static void ConsoleCommandRides(InteractiveConsole& console, const arguments_t& { for (const auto& ride : GetRideManager()) { - auto name = ride.GetName(); + auto name = ride.getName(); console.WriteFormatLine( "ride: %03d type: %02u subtype %03u operating mode: %02u name: %s", ride.id, ride.type, ride.subtype, ride.mode, name.c_str()); @@ -282,7 +282,7 @@ static void ConsoleCommandRides(InteractiveConsole& console, const arguments_t& } else { - for (int32_t i = 0; i < ride->NumTrains; ++i) + for (int32_t i = 0; i < ride->numTrains; ++i) { for (Vehicle* vehicle = GetEntity(ride->vehicles[i]); vehicle != nullptr; vehicle = GetEntity(vehicle->next_vehicle_on_train)) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 2b4ac2dd96..03e6dc356e 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -785,7 +785,7 @@ namespace OpenRCT2 || (peep.State == PeepState::LeavingRide && peep.x == kLocationNull)) { auto ride = GetRide(peep.CurrentRide); - if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (ride != nullptr && (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) { auto train = GetEntity(ride->vehicles[peep.CurrentTrain]); if (train != nullptr) @@ -806,7 +806,7 @@ namespace OpenRCT2 auto ride = GetRide(peep.CurrentRide); if (ride != nullptr) { - auto xy = ride->overall_view.ToTileCentre(); + auto xy = ride->overallView.ToTileCentre(); CoordsXYZ coordFocus; coordFocus.x = xy.x; coordFocus.y = xy.y; @@ -1438,7 +1438,7 @@ namespace OpenRCT2 break; auto ride = vehicle->GetRide(); - if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (ride != nullptr && !ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { return (viewFlags & VIEWPORT_FLAG_INVISIBLE_RIDES) ? VisibilityKind::Hidden : VisibilityKind::Partial; diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 8fb63a9fc8..2606ca23e9 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -142,13 +142,13 @@ static bool AwardIsDeservedBestRollercoasters([[maybe_unused]] int32_t activeAwa auto rollerCoasters = 0; for (const auto& ride : GetRideManager()) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) { continue; } - if (ride.status != RideStatus::open || (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (ride.status != RideStatus::open || (ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { continue; } @@ -257,7 +257,7 @@ static bool AwardIsDeservedSafest([[maybe_unused]] int32_t activeAwardTypes) // Check for rides that have crashed maybe? const auto& rideManager = GetRideManager(); if (std::any_of(rideManager.begin(), rideManager.end(), [](const Ride& ride) { - return ride.last_crash_type != RIDE_CRASH_TYPE_NONE; + return ride.lastCrashType != RIDE_CRASH_TYPE_NONE; })) { return false; @@ -291,7 +291,7 @@ static bool AwardIsDeservedBestFood(int32_t activeAwardTypes) { if (ride.status != RideStatus::open) continue; - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::sellsFood)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::sellsFood)) continue; shops++; @@ -336,11 +336,11 @@ static bool AwardIsDeservedWorstFood(int32_t activeAwardTypes) { if (ride.status != RideStatus::open) continue; - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::sellsFood)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::sellsFood)) continue; shops++; - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry != nullptr) { if (!(shopTypes & EnumToFlag(rideEntry->shop_item[0]))) @@ -374,7 +374,7 @@ static bool AwardIsDeservedBestToilets([[maybe_unused]] int32_t activeAwardTypes // Count open toilets const auto& rideManager = GetRideManager(); auto numToilets = static_cast(std::count_if(rideManager.begin(), rideManager.end(), [](const Ride& ride) { - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); return rtd.specialType == RtdSpecialType::toilet && ride.status == RideStatus::open; })); @@ -433,13 +433,13 @@ static bool AwardIsDeservedBestWaterRides([[maybe_unused]] int32_t activeAwardTy auto waterRides = 0; for (const auto& ride : GetRideManager()) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) { continue; } - if (ride.status != RideStatus::open || (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (ride.status != RideStatus::open || (ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { continue; } @@ -464,13 +464,13 @@ static bool AwardIsDeservedBestCustomDesignedRides(int32_t activeAwardTypes) auto customDesignedRides = 0; for (const auto& ride : GetRideManager()) { - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) continue; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN) continue; if (ride.ratings.excitement < MakeRideRating(5, 50)) continue; - if (ride.status != RideStatus::open || (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (ride.status != RideStatus::open || (ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) continue; customDesignedRides++; @@ -496,12 +496,12 @@ static bool AwardIsDeservedMostDazzlingRideColours(int32_t activeAwardTypes) auto colourfulRides = 0; for (const auto& ride : GetRideManager()) { - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) continue; countedRides++; - auto mainTrackColour = ride.track_colour[0].main; + auto mainTrackColour = ride.trackColours[0].main; for (auto dazzling_ride_colour : dazzling_ride_colours) { if (mainTrackColour == dazzling_ride_colour) @@ -540,13 +540,13 @@ static bool AwardIsDeservedBestGentleRides([[maybe_unused]] int32_t activeAwardT auto gentleRides = 0; for (const auto& ride : GetRideManager()) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) { continue; } - if (ride.status != RideStatus::open || (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (ride.status != RideStatus::open || (ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { continue; } diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index b1c510e019..fa6befa07d 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -160,25 +160,25 @@ void FinancePayRideUpkeep() for (auto& ride : GetRideManager()) { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) { - ride.Renew(); + ride.renew(); } if (ride.status != RideStatus::closed && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY)) { - auto upkeep = ride.upkeep_cost; + auto upkeep = ride.upkeepCost; if (upkeep != kMoney64Undefined) { - ride.total_profit -= upkeep; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; + ride.totalProfit -= upkeep; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; FinancePayment(upkeep, ExpenditureType::RideRunningCosts); } } - if (ride.last_crash_type != RIDE_CRASH_TYPE_NONE) + if (ride.lastCrashType != RIDE_CRASH_TYPE_NONE) { - ride.last_crash_type--; + ride.lastCrashType--; } } } @@ -271,9 +271,9 @@ void FinanceUpdateDailyProfit() // Ride costs for (auto& ride : GetRideManager()) { - if (ride.status != RideStatus::closed && ride.upkeep_cost != kMoney64Undefined) + if (ride.status != RideStatus::closed && ride.upkeepCost != kMoney64Undefined) { - current_profit -= 2 * ride.upkeep_cost; + current_profit -= 2 * ride.upkeepCost; } } } diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index 8736e7daac..8892e1c0db 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -92,7 +92,7 @@ static void MarketingRaiseFinishedNotification(const MarketingCampaign& campaign auto ride = GetRide(campaign.RideId); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } } else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) @@ -202,7 +202,7 @@ bool MarketingIsCampaignTypeApplicable(int32_t campaignType) // Check if any rides exist for (auto& ride : GetRideManager()) { - if (ride.IsRide()) + if (ride.isRide()) { return true; } @@ -213,7 +213,7 @@ bool MarketingIsCampaignTypeApplicable(int32_t campaignType) // Check if any food or drink stalls exist for (auto& ride : GetRideManager()) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry != nullptr) { for (auto& item : rideEntry->shop_item) diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 686c987eb6..f1cc1f0934 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -218,11 +218,11 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s case News::ItemType::Ride: { Ride* ride = GetRide(RideId::FromUnderlying(subject)); - if (ride == nullptr || ride->overall_view.IsNull()) + if (ride == nullptr || ride->overallView.IsNull()) { break; } - auto rideViewCentre = ride->overall_view.ToTileCentre(); + auto rideViewCentre = ride->overallView.ToTileCentre(); subjectLoc = CoordsXYZ{ rideViewCentre, TileElementHeight(rideViewCentre) }; break; } @@ -244,7 +244,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s // Find which ride peep is on Ride* ride = GetRide(peep->CurrentRide); - if (ride == nullptr || !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (ride == nullptr || !(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) { subjectLoc = std::nullopt; break; diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index fc1825da95..d4441df284 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -188,7 +188,7 @@ void RideObject::ReadLegacy(IReadObjectContext* context, IStream* stream) _presetColours.list[i] = stream->ReadValue(); } - if (IsRideTypeShopOrFacility(_legacyType.ride_type[0])) + if (isRideTypeShopOrFacility(_legacyType.ride_type[0])) { // This used to be hard-coded. JSON objects set this themselves. _presetColours.count = 1; @@ -555,7 +555,7 @@ void RideObject::ReadJson(IReadObjectContext* context, json_t& root) auto carColours = Json::AsArray(properties["carColours"]); _presetColours = ReadJsonCarColours(carColours); - if (IsRideTypeShopOrFacility(_legacyType.ride_type[0])) + if (isRideTypeShopOrFacility(_legacyType.ride_type[0])) { // Standard car info for a shop auto& car = _legacyType.Cars[0]; @@ -962,7 +962,7 @@ std::vector RideObject::ReadJsonColourConfiguration(json_t& jColo return config; } -bool RideObject::IsRideTypeShopOrFacility(ride_type_t rideType) +bool RideObject::isRideTypeShopOrFacility(ride_type_t rideType) { return GetRideTypeDescriptor(rideType).HasFlag(RtdFlag::isShopOrFacility); } diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index d922fb774e..97507ba87a 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -66,7 +66,7 @@ private: static uint8_t CalculateNumVerticalFrames(const CarEntry& carEntry); static uint8_t CalculateNumHorizontalFrames(const CarEntry& carEntry); - static bool IsRideTypeShopOrFacility(ride_type_t rideType); + static bool isRideTypeShopOrFacility(ride_type_t rideType); static RideCategory ParseRideCategory(const std::string& s); static ShopItem ParseShopItem(const std::string& s); static colour_t ParseColour(const std::string& s); diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 454b052370..faa7aabde1 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -57,9 +57,9 @@ static void PaintRideEntranceExitScrollingText( auto ft = Formatter(); ft.Add(STR_RIDE_ENTRANCE_NAME); - if (ride->status == RideStatus::open && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride->status == RideStatus::open && !(ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -129,7 +129,7 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3 return; } - auto stationObj = ride->GetStationObject(); + auto stationObj = ride->getStationObject(); if (stationObj == nullptr || stationObj->BaseImageId == kImageIndexUndefined) { return; @@ -140,8 +140,8 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3 PaintRideEntranceExitLightEffects(session, height, entranceEl); auto hasGlass = (stationObj->Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT) != 0; - auto colourPrimary = ride->track_colour[0].main; - auto colourSecondary = ride->track_colour[0].additional; + auto colourPrimary = ride->trackColours[0].main; + auto colourSecondary = ride->trackColours[0].additional; auto imageTemplate = ImageId(0, colourPrimary, colourSecondary); ImageId glassImageTemplate; if (hasGlass) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index d02a58de28..f262c1db9d 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -155,10 +155,10 @@ static void PathPaintQueueBanner( auto ft = Formatter(); - if (ride->status == RideStatus::open && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride->status == RideStatus::open && !(ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { ft.Add(STR_RIDE_ENTRANCE_NAME); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { diff --git a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp index fb9660209d..468f6b4452 100644 --- a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp @@ -1889,7 +1889,7 @@ static void JuniorRCPaintStation( ImageId imageId; bool isBraked = trackElement.IsBrakeClosed(); - auto stationObj = ride.GetStationObject(); + auto stationObj = ride.getStationObject(); if (direction == 0 || direction == 2) { diff --git a/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp index 2995a256c0..b3505e5f9b 100644 --- a/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp @@ -204,7 +204,7 @@ static void MultiDimensionRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, supportType.metal); auto stationColour = GetStationColourScheme(session, trackElement); - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); bool hasFence; if (direction == 0 || direction == 2) { diff --git a/src/openrct2/paint/track/gentle/Circus.cpp b/src/openrct2/paint/track/gentle/Circus.cpp index 3d4ac5f868..850e524116 100644 --- a/src/openrct2/paint/track/gentle/Circus.cpp +++ b/src/openrct2/paint/track/gentle/Circus.cpp @@ -25,18 +25,18 @@ using namespace OpenRCT2; static void PaintCircusTent( PaintSession& session, const Ride& ride, uint8_t direction, int8_t al, int8_t cl, uint16_t height, ImageId stationColour) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; auto vehicle = GetEntity(ride.vehicles[0]); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = vehicle; } - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -63,7 +63,7 @@ static void PaintCircus( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/gentle/CrookedHouse.cpp b/src/openrct2/paint/track/gentle/CrookedHouse.cpp index 7573d2e0a8..bcdc103572 100644 --- a/src/openrct2/paint/track/gentle/CrookedHouse.cpp +++ b/src/openrct2/paint/track/gentle/CrookedHouse.cpp @@ -63,11 +63,11 @@ static void PaintCrookedHouseStructure( if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { auto vehicle = GetEntity(ride->vehicles[0]); if (vehicle != nullptr) @@ -97,7 +97,7 @@ static void PaintCrookedHouse( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/gentle/Dodgems.cpp b/src/openrct2/paint/track/gentle/Dodgems.cpp index 370957b480..bceba724dd 100644 --- a/src/openrct2/paint/track/gentle/Dodgems.cpp +++ b/src/openrct2/paint/track/gentle/Dodgems.cpp @@ -58,7 +58,7 @@ static void PaintDodgems( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/paint/track/gentle/FerrisWheel.cpp b/src/openrct2/paint/track/gentle/FerrisWheel.cpp index 5c9f7e0c7d..52df885dde 100644 --- a/src/openrct2/paint/track/gentle/FerrisWheel.cpp +++ b/src/openrct2/paint/track/gentle/FerrisWheel.cpp @@ -65,12 +65,12 @@ static void PaintFerrisWheelRiders( static void PaintFerrisWheelStructure( PaintSession& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height, ImageId stationColour) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; auto vehicle = GetEntity(ride.vehicles[0]); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = vehicle; @@ -81,7 +81,7 @@ static void PaintFerrisWheelStructure( BoundBoxXYZ bb = { { boundBox.offset, height + 7 }, { boundBox.length, 127 } }; auto supportsImageTemplate = session.TrackColours; - auto wheelImageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto wheelImageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { wheelImageTemplate = stationColour; @@ -124,7 +124,7 @@ static void PaintFerrisWheel( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, stationColour); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/gentle/FlyingSaucers.cpp b/src/openrct2/paint/track/gentle/FlyingSaucers.cpp index a7347d140a..59957c7206 100644 --- a/src/openrct2/paint/track/gentle/FlyingSaucers.cpp +++ b/src/openrct2/paint/track/gentle/FlyingSaucers.cpp @@ -50,7 +50,7 @@ static void PaintFlyingSaucers( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/paint/track/gentle/HauntedHouse.cpp b/src/openrct2/paint/track/gentle/HauntedHouse.cpp index f15bfb1c8b..319106a75b 100644 --- a/src/openrct2/paint/track/gentle/HauntedHouse.cpp +++ b/src/openrct2/paint/track/gentle/HauntedHouse.cpp @@ -34,12 +34,12 @@ static void PaintHauntedHouseStructure( { uint8_t frameNum = 0; - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; auto vehicle = GetEntity(ride.vehicles[0]); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = vehicle; @@ -76,7 +76,7 @@ static void PaintHauntedHouse( DrawSupportForSequenceA( session, supportType.wooden, trackSequence, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/gentle/Maze.cpp b/src/openrct2/paint/track/gentle/Maze.cpp index 357bf4d3eb..33b5848c3a 100644 --- a/src/openrct2/paint/track/gentle/Maze.cpp +++ b/src/openrct2/paint/track/gentle/Maze.cpp @@ -72,7 +72,7 @@ static void MazePaintSetup( PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~EnumToFlag(PaintSegment::centre), 0xFFFF, 0); int32_t baseImageId = 0; - switch (ride.track_colour[0].supports) + switch (ride.trackColours[0].supports) { case 0: baseImageId = SprMazeBaseBrick; diff --git a/src/openrct2/paint/track/gentle/MerryGoRound.cpp b/src/openrct2/paint/track/gentle/MerryGoRound.cpp index ea7849d85a..564c9645b1 100644 --- a/src/openrct2/paint/track/gentle/MerryGoRound.cpp +++ b/src/openrct2/paint/track/gentle/MerryGoRound.cpp @@ -35,7 +35,7 @@ static void PaintRiders( { if (session.DPI.zoom_level > ZoomLevel{ 0 }) return; - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) return; for (int32_t peep = 0; peep <= 14; peep += 2) @@ -60,18 +60,18 @@ static void PaintCarousel( { height += 7; - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; auto vehicle = GetEntity(ride.vehicles[0]); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = vehicle; - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN) - && ride.breakdown_reason_pending == BREAKDOWN_CONTROL_FAILURE && ride.breakdown_sound_modifier >= 128) + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN) + && ride.breakdownReasonPending == BREAKDOWN_CONTROL_FAILURE && ride.breakdownSoundModifier >= 128) { height += kMerryGoRoundBreakdownVibration[(vehicle->current_time >> 1) & 7]; } @@ -87,7 +87,7 @@ static void PaintCarousel( CoordsXYZ offset(xOffset, yOffset, height); BoundBoxXYZ bb = { { xOffset + 16, yOffset + 16, height }, { 24, 24, 48 } }; - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -117,7 +117,7 @@ static void PaintMerryGoRound( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/gentle/MiniGolf.cpp b/src/openrct2/paint/track/gentle/MiniGolf.cpp index 3d3a6292ca..615c3e191d 100644 --- a/src/openrct2/paint/track/gentle/MiniGolf.cpp +++ b/src/openrct2/paint/track/gentle/MiniGolf.cpp @@ -697,7 +697,7 @@ static void PaintMiniGolfStation( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); ImageId imageId; bool hasFence; diff --git a/src/openrct2/paint/track/gentle/ObservationTower.cpp b/src/openrct2/paint/track/gentle/ObservationTower.cpp index 69d06bde5d..a6349e6379 100644 --- a/src/openrct2/paint/track/gentle/ObservationTower.cpp +++ b/src/openrct2/paint/track/gentle/ObservationTower.cpp @@ -46,7 +46,7 @@ static void PaintObservationTowerBase( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesMetalB, stationObject); diff --git a/src/openrct2/paint/track/gentle/SpaceRings.cpp b/src/openrct2/paint/track/gentle/SpaceRings.cpp index 6a2c2d5088..ce166655cc 100644 --- a/src/openrct2/paint/track/gentle/SpaceRings.cpp +++ b/src/openrct2/paint/track/gentle/SpaceRings.cpp @@ -43,7 +43,7 @@ static void PaintSpaceRingsStructure( { uint32_t vehicleIndex = (segment - direction) & 0x3; const auto* rideEntry = GetRideEntryByIndex(ride.subtype); - if (rideEntry == nullptr || (ride.num_stations != 0 && vehicleIndex >= ride.NumTrains)) + if (rideEntry == nullptr || (ride.numStations != 0 && vehicleIndex >= ride.numTrains)) { session.CurrentlyDrawnEntity = nullptr; session.InteractionType = ViewportInteractionItem::Ride; @@ -53,7 +53,7 @@ static void PaintSpaceRingsStructure( int32_t frameNum = direction; uint32_t baseImageId = rideEntry->Cars[0].base_image_id; auto vehicle = GetEntity(ride.vehicles[vehicleIndex]); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = vehicle; @@ -67,7 +67,7 @@ static void PaintSpaceRingsStructure( if (stationColour == TrackStationColour) { - stationColour = ImageId(0, ride.vehicle_colours[vehicleIndex].Body, ride.vehicle_colours[vehicleIndex].Trim); + stationColour = ImageId(0, ride.vehicleColours[vehicleIndex].Body, ride.vehicleColours[vehicleIndex].Trim); } auto imageId = stationColour.WithIndex(baseImageId + frameNum); @@ -104,7 +104,7 @@ static void PaintSpaceRings( DrawSupportForSequenceA( session, supportType.wooden, trackSequence, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); switch (trackSequence) diff --git a/src/openrct2/paint/track/gentle/SpiralSlide.cpp b/src/openrct2/paint/track/gentle/SpiralSlide.cpp index 60eaa7c08c..87193def93 100644 --- a/src/openrct2/paint/track/gentle/SpiralSlide.cpp +++ b/src/openrct2/paint/track/gentle/SpiralSlide.cpp @@ -56,7 +56,7 @@ static void SpiralSlidePaintTileRight( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; @@ -78,7 +78,7 @@ static void SpiralSlidePaintTileLeft( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; @@ -100,7 +100,7 @@ static void SpiralSlidePaintTileFront( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; @@ -138,9 +138,9 @@ static void SpiralSlidePaintTileFront( PaintAddImageAsParent(session, imageId, { 16, 16, height }, { { 8, 0, height + 3 }, { 8, 16, 108 } }); } - if (session.DPI.zoom_level <= ZoomLevel{ 0 } && ride.slide_in_use != 0) + if (session.DPI.zoom_level <= ZoomLevel{ 0 } && ride.slideInUse != 0) { - uint8_t slide_progress = ride.spiral_slide_progress; + uint8_t slide_progress = ride.spiralSlideProgress; if (slide_progress != 0) { slide_progress--; @@ -186,7 +186,7 @@ static void SpiralSlidePaintTileFront( boundingBox.x = 8; } - imageId = ImageId(offset + slide_progress, ride.slide_peep_t_shirt_colour, COLOUR_GREY); + imageId = ImageId(offset + slide_progress, ride.slidePeepTShirtColour, COLOUR_GREY); PaintAddImageAsChild(session, imageId, { 16, 16, height }, { boundingBoxOffset, boundingBox }); } @@ -200,7 +200,7 @@ static void PaintSpiralSlide( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; @@ -213,7 +213,7 @@ static void PaintSpiralSlide( GetStationColourScheme(session, trackElement)); // Base - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/paint/track/shops/Facility.cpp b/src/openrct2/paint/track/shops/Facility.cpp index ca003055ce..c0026e6416 100644 --- a/src/openrct2/paint/track/shops/Facility.cpp +++ b/src/openrct2/paint/track/shops/Facility.cpp @@ -34,7 +34,7 @@ static void PaintFacility( bool hasSupports = DrawSupportForSequenceA( session, supportType.wooden, trackSequence, direction, height, GetShopSupportColourScheme(session, trackElement)); - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; diff --git a/src/openrct2/paint/track/shops/Shop.cpp b/src/openrct2/paint/track/shops/Shop.cpp index f653ad98fa..825b3eb324 100644 --- a/src/openrct2/paint/track/shops/Shop.cpp +++ b/src/openrct2/paint/track/shops/Shop.cpp @@ -33,7 +33,7 @@ static void PaintShop( bool hasSupports = DrawSupportForSequenceA( session, supportType.wooden, trackSequence, direction, height, GetShopSupportColourScheme(session, trackElement)); - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; diff --git a/src/openrct2/paint/track/thrill/3dCinema.cpp b/src/openrct2/paint/track/thrill/3dCinema.cpp index 49d93d357f..e2b18a4a15 100644 --- a/src/openrct2/paint/track/thrill/3dCinema.cpp +++ b/src/openrct2/paint/track/thrill/3dCinema.cpp @@ -25,17 +25,17 @@ static void Paint3dCinemaDome( PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height, ImageId stationColour) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && !ride.vehicles[0].IsNull()) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && !ride.vehicles[0].IsNull()) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = GetEntity(ride.vehicles[0]); } - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -64,7 +64,7 @@ static void Paint3dCinema( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, stationColour); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/thrill/Enterprise.cpp b/src/openrct2/paint/track/thrill/Enterprise.cpp index e1cbf96e80..033a4853dd 100644 --- a/src/openrct2/paint/track/thrill/Enterprise.cpp +++ b/src/openrct2/paint/track/thrill/Enterprise.cpp @@ -55,7 +55,7 @@ static void PaintEnterpriseStructure( return; Vehicle* vehicle = nullptr; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { vehicle = GetEntity(ride.vehicles[0]); if (vehicle != nullptr) @@ -74,7 +74,7 @@ static void PaintEnterpriseStructure( imageOffset = (vehicle->Pitch << 2) + (((vehicle->Orientation >> 3) + session.CurrentRotation) % 4); } - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); auto imageFlags = GetStationColourScheme(session, trackElement); if (imageFlags != TrackStationColour) { @@ -104,7 +104,7 @@ static void PaintEnterprise( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); TrackPaintUtilPaintFences( diff --git a/src/openrct2/paint/track/thrill/GoKarts.cpp b/src/openrct2/paint/track/thrill/GoKarts.cpp index 0ebc55d2e0..6be488d3e2 100644 --- a/src/openrct2/paint/track/thrill/GoKarts.cpp +++ b/src/openrct2/paint/track/thrill/GoKarts.cpp @@ -354,7 +354,7 @@ static void PaintGoKartsStation( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); bool hasFence; ImageId imageId; diff --git a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp index 2f56dadc46..dba9d0565e 100644 --- a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp @@ -44,7 +44,7 @@ static void PaintLaunchedFreefallBase( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesMetal, stationObject); diff --git a/src/openrct2/paint/track/thrill/MagicCarpet.cpp b/src/openrct2/paint/track/thrill/MagicCarpet.cpp index ac8d78bf83..ed7c85ab4d 100644 --- a/src/openrct2/paint/track/thrill/MagicCarpet.cpp +++ b/src/openrct2/paint/track/thrill/MagicCarpet.cpp @@ -93,7 +93,7 @@ static ImageIndex GetMagicCarpetPendulumImage(Plane plane, Direction direction, static Vehicle* GetFirstVehicle(const Ride& ride) { - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { return GetEntity(ride.vehicles[0]); } @@ -146,7 +146,7 @@ static void PaintMagicCarpetVehicle( PaintSession& session, const Ride& ride, uint8_t direction, int32_t swing, CoordsXYZ offset, const BoundBoxXYZ& bb, ImageId stationColour) { - const auto* rideEntry = ride.GetRideEntry(); + const auto* rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; @@ -169,7 +169,7 @@ static void PaintMagicCarpetVehicle( offset.z += kMagicCarpetOscillationZ[swing]; // Vehicle - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -225,7 +225,7 @@ static void PaintMagicCarpet( case 0: case 2: DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/paint/track/thrill/MotionSimulator.cpp b/src/openrct2/paint/track/thrill/MotionSimulator.cpp index 25b02ba441..b1ea751351 100644 --- a/src/openrct2/paint/track/thrill/MotionSimulator.cpp +++ b/src/openrct2/paint/track/thrill/MotionSimulator.cpp @@ -38,14 +38,14 @@ static void PaintMotionSimulatorVehicle( PaintSession& session, const Ride& ride, int8_t offsetX, int8_t offsetY, uint8_t direction, int32_t height, ImageId stationColour) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return; CoordsXYZ offset(offsetX, offsetY, height + 2); Vehicle* vehicle = nullptr; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { vehicle = GetEntity(ride.vehicles[0]); if (vehicle != nullptr) @@ -68,7 +68,7 @@ static void PaintMotionSimulatorVehicle( } } - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -116,7 +116,7 @@ static void PaintMotionSimulator( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, stationColour); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/thrill/RotoDrop.cpp b/src/openrct2/paint/track/thrill/RotoDrop.cpp index 8c0022cf4d..66c95be431 100644 --- a/src/openrct2/paint/track/thrill/RotoDrop.cpp +++ b/src/openrct2/paint/track/thrill/RotoDrop.cpp @@ -48,7 +48,7 @@ static void PaintRotoDropBase( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesMetalB, stationObject); diff --git a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp index 4f696b6d43..a273231ecc 100644 --- a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp @@ -74,7 +74,7 @@ static void PaintSwingingInverterShipStructure( BoundBoxXYZ bb = { { boundBox.offset, height }, { boundBox.length, 127 } }; Vehicle* vehicle = nullptr; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { vehicle = GetEntity(ride.vehicles[0]); if (vehicle != nullptr) @@ -103,7 +103,7 @@ static void PaintSwingingInverterShipStructure( } } - auto vehicleImageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto vehicleImageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { vehicleImageTemplate = stationColour; @@ -134,7 +134,7 @@ static void PaintSwingingInverterShip( uint8_t relativeTrackSequence = kTrackMap1x4[direction][trackSequence]; ImageId imageId; - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); if (relativeTrackSequence != 1 && relativeTrackSequence != 3) { diff --git a/src/openrct2/paint/track/thrill/SwingingShip.cpp b/src/openrct2/paint/track/thrill/SwingingShip.cpp index c80968a325..a390190d43 100644 --- a/src/openrct2/paint/track/thrill/SwingingShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingShip.cpp @@ -66,7 +66,7 @@ static void PaintSwingingShipRiders( if (session.DPI.zoom_level > ZoomLevel{ 1 }) return; - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) return; int32_t peep = 0; @@ -95,7 +95,7 @@ static void PaintSwingingShipStructure( return; Vehicle* vehicle = nullptr; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && !ride.vehicles[0].IsNull()) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && !ride.vehicles[0].IsNull()) { vehicle = GetEntity(ride.vehicles[0]); session.InteractionType = ViewportInteractionItem::Entity; @@ -126,7 +126,7 @@ static void PaintSwingingShipStructure( } auto supportsImageTemplate = session.TrackColours; - auto vehicleImageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto vehicleImageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { vehicleImageTemplate = stationColour; @@ -162,7 +162,7 @@ static void PaintSwingingShip( ImageId imageId; bool hasFence; - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); if (relativeTrackSequence == 1 || relativeTrackSequence == 4) { diff --git a/src/openrct2/paint/track/thrill/TopSpin.cpp b/src/openrct2/paint/track/thrill/TopSpin.cpp index 50f2529295..492455eec0 100644 --- a/src/openrct2/paint/track/thrill/TopSpin.cpp +++ b/src/openrct2/paint/track/thrill/TopSpin.cpp @@ -104,7 +104,7 @@ static void PaintTopSpinSeat( break; } - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -130,7 +130,7 @@ static void PaintTopSpinVehicle( uint8_t seatRotation = 0; uint8_t armRotation = 0; auto* vehicle = GetEntity(ride.vehicles[0]); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::Entity; session.CurrentlyDrawnEntity = vehicle; @@ -150,8 +150,8 @@ static void PaintTopSpinVehicle( CoordsXYZ offset = { al, cl, height }; BoundBoxXYZ bb = { { al + 16, cl + 16, height }, { 24, 24, 90 } }; - auto supportImageTemplate = ImageId(0, ride.track_colour[0].main, ride.track_colour[0].supports); - auto armImageTemplate = ImageId(0, ride.track_colour[0].main, ride.track_colour[0].additional); + auto supportImageTemplate = ImageId(0, ride.trackColours[0].main, ride.trackColours[0].supports); + auto armImageTemplate = ImageId(0, ride.trackColours[0].main, ride.trackColours[0].additional); if (stationColour != TrackStationColour) { supportImageTemplate = stationColour; @@ -193,7 +193,7 @@ static void PaintTopSpin( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, stationColour); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); diff --git a/src/openrct2/paint/track/thrill/Twist.cpp b/src/openrct2/paint/track/thrill/Twist.cpp index ceb2a9df9c..6174183f7d 100644 --- a/src/openrct2/paint/track/thrill/Twist.cpp +++ b/src/openrct2/paint/track/thrill/Twist.cpp @@ -37,7 +37,7 @@ static void PaintTwistStructure( height += 7; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && !ride.vehicles[0].IsNull()) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && !ride.vehicles[0].IsNull()) { vehicle = GetEntity(ride.vehicles[0]); @@ -53,7 +53,7 @@ static void PaintTwistStructure( frameNum = frameNum % 216; } - auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); + auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); if (stationColour != TrackStationColour) { imageTemplate = stationColour; @@ -68,7 +68,7 @@ static void PaintTwistStructure( }; PaintAddImageAsParent(session, imageId, { xOffset, yOffset, height }, bb); - if (session.DPI.zoom_level < ZoomLevel{ 1 } && ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) + if (session.DPI.zoom_level < ZoomLevel{ 1 } && ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { for (int32_t i = 0; i < vehicle->num_peeps; i += 2) { @@ -98,7 +98,7 @@ static void PaintTwist( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, stationColour); - const StationObject* stationObject = ride.GetStationObject(); + const StationObject* stationObject = ride.getStationObject(); TrackPaintUtilPaintFloor(session, edges, stationColour, height, kFloorSpritesCork, stationObject); switch (trackSequence) diff --git a/src/openrct2/paint/track/transport/Chairlift.cpp b/src/openrct2/paint/track/transport/Chairlift.cpp index 24d0f807c6..becd3c5d92 100644 --- a/src/openrct2/paint/track/transport/Chairlift.cpp +++ b/src/openrct2/paint/track/transport/Chairlift.cpp @@ -200,7 +200,7 @@ static void ChairliftPaintStationNeSw( bool isStart = ChairliftPaintUtilIsFirstTrack(ride, trackElement, pos, trackType); bool isEnd = ChairliftPaintUtilIsLastTrack(ride, trackElement, pos, trackType); - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); auto stationColour = GetStationColourScheme(session, trackElement); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, stationColour); @@ -243,7 +243,7 @@ static void ChairliftPaintStationNeSw( imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 30, 2, height + 4 }, { 1, 28, 27 } }); - imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); + imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairliftBullwheelRotation / 16384]); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 19 } }); imageId = session.TrackColours.WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_NE); @@ -253,7 +253,7 @@ static void ChairliftPaintStationNeSw( } else if ((direction == 2 && isStart) || (direction == 0 && isEnd)) { - imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); + imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairliftBullwheelRotation / 16384]); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 19 } }); imageId = session.TrackColours.WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_SW); @@ -291,7 +291,7 @@ static void ChairliftPaintStationSeNw( bool isStart = ChairliftPaintUtilIsFirstTrack(ride, trackElement, pos, trackType); bool isEnd = ChairliftPaintUtilIsLastTrack(ride, trackElement, pos, trackType); - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); auto stationColour = GetStationColourScheme(session, trackElement); WoodenASupportsPaintSetupRotated( @@ -333,7 +333,7 @@ static void ChairliftPaintStationSeNw( bool drawLeftColumn = true; if ((direction == 1 && isStart) || (direction == 3 && isEnd)) { - imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); + imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairliftBullwheelRotation / 16384]); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 19 } }); imageId = session.TrackColours.WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_SE); @@ -346,7 +346,7 @@ static void ChairliftPaintStationSeNw( imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 30, height + 4 }, { 28, 1, 27 } }); - imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); + imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairliftBullwheelRotation / 16384]); auto bb = BoundBoxXYZ{ { 14, 14, height + 4 }, { 4, 4, 19 } }; PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); diff --git a/src/openrct2/paint/track/transport/Monorail.cpp b/src/openrct2/paint/track/transport/Monorail.cpp index 3fd93bff77..1434d5def7 100644 --- a/src/openrct2/paint/track/transport/Monorail.cpp +++ b/src/openrct2/paint/track/transport/Monorail.cpp @@ -455,7 +455,7 @@ static void PaintMonorailStation( ImageId imageId; const StationObject* stationObject = nullptr; - stationObject = ride.GetStationObject(); + stationObject = ride.getStationObject(); if (stationObject == nullptr || !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/paint/track/water/BoatHire.cpp b/src/openrct2/paint/track/water/BoatHire.cpp index a4f6525119..9f83088734 100644 --- a/src/openrct2/paint/track/water/BoatHire.cpp +++ b/src/openrct2/paint/track/water/BoatHire.cpp @@ -74,7 +74,7 @@ static void PaintBoatHireStation( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); TrackPaintUtilDrawStationTunnel(session, direction, height); TrackPaintUtilDrawPier( diff --git a/src/openrct2/paint/track/water/SubmarineRide.cpp b/src/openrct2/paint/track/water/SubmarineRide.cpp index 54472f815b..60b398fcfd 100644 --- a/src/openrct2/paint/track/water/SubmarineRide.cpp +++ b/src/openrct2/paint/track/water/SubmarineRide.cpp @@ -28,7 +28,7 @@ static void SubmarineRidePaintTrackStation( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); int32_t heightLower = height - 16; ImageId imageId; diff --git a/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp b/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp index ed9cf89727..6a2388f624 100644 --- a/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp +++ b/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp @@ -113,7 +113,7 @@ namespace OpenRCT2 if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; @@ -149,7 +149,7 @@ namespace OpenRCT2 if (ride == nullptr) return; - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr) return; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 8c9bae46e0..e601265b2c 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1411,12 +1411,12 @@ namespace OpenRCT2 cs.ReadWrite(ride.subtype); cs.ReadWrite(ride.mode); cs.ReadWrite(ride.status); - cs.ReadWrite(ride.depart_flags); - cs.ReadWrite(ride.lifecycle_flags); + cs.ReadWrite(ride.departFlags); + cs.ReadWrite(ride.lifecycleFlags); // Meta - cs.ReadWrite(ride.custom_name); - cs.ReadWrite(ride.default_name_number); + cs.ReadWrite(ride.customName); + cs.ReadWrite(ride.defaultNameNumber); if (version <= 18) { @@ -1437,16 +1437,16 @@ namespace OpenRCT2 } // Colours - cs.ReadWrite(ride.entrance_style); + cs.ReadWrite(ride.entranceStyle); cs.ReadWrite(ride.vehicleColourSettings); - cs.ReadWriteArray(ride.track_colour, [&cs](TrackColour& tc) { + cs.ReadWriteArray(ride.trackColours, [&cs](TrackColour& tc) { cs.ReadWrite(tc.main); cs.ReadWrite(tc.additional); cs.ReadWrite(tc.supports); return true; }); - cs.ReadWriteArray(ride.vehicle_colours, [&cs](VehicleColour& vc) { + cs.ReadWriteArray(ride.vehicleColours, [&cs](VehicleColour& vc) { cs.ReadWrite(vc.Body); cs.ReadWrite(vc.Trim); cs.ReadWrite(vc.Tertiary); @@ -1454,8 +1454,8 @@ namespace OpenRCT2 }); // Stations - cs.ReadWrite(ride.num_stations); - cs.ReadWriteArray(ride.GetStations(), [&cs](RideStation& station) { + cs.ReadWrite(ride.numStations); + cs.ReadWriteArray(ride.getStations(), [&cs](RideStation& station) { cs.ReadWrite(station.Start); cs.ReadWrite(station.Height); cs.ReadWrite(station.Length); @@ -1471,53 +1471,53 @@ namespace OpenRCT2 return true; }); - cs.ReadWrite(ride.overall_view.x); - cs.ReadWrite(ride.overall_view.y); + cs.ReadWrite(ride.overallView.x); + cs.ReadWrite(ride.overallView.y); // Vehicles - cs.ReadWrite(ride.NumTrains); - cs.ReadWrite(ride.num_cars_per_train); - cs.ReadWrite(ride.ProposedNumTrains); - cs.ReadWrite(ride.proposed_num_cars_per_train); - cs.ReadWrite(ride.max_trains); + cs.ReadWrite(ride.numTrains); + cs.ReadWrite(ride.numCarsPerTrain); + cs.ReadWrite(ride.proposedNumTrains); + cs.ReadWrite(ride.proposedNumCarsPerTrain); + cs.ReadWrite(ride.maxTrains); if (version < 0x5) { uint8_t value; cs.ReadWrite(value); - ride.MinCarsPerTrain = GetMinCarsPerTrain(value); - ride.MaxCarsPerTrain = GetMaxCarsPerTrain(value); + ride.minCarsPerTrain = GetMinCarsPerTrain(value); + ride.maxCarsPerTrain = GetMaxCarsPerTrain(value); } else { - cs.ReadWrite(ride.MinCarsPerTrain); - cs.ReadWrite(ride.MaxCarsPerTrain); + cs.ReadWrite(ride.minCarsPerTrain); + cs.ReadWrite(ride.maxCarsPerTrain); } - cs.ReadWrite(ride.min_waiting_time); - cs.ReadWrite(ride.max_waiting_time); + cs.ReadWrite(ride.minWaitingTime); + cs.ReadWrite(ride.maxWaitingTime); cs.ReadWriteArray(ride.vehicles, [&cs](EntityId& v) { cs.ReadWrite(v); return true; }); // Operation - cs.ReadWrite(ride.operation_option); - cs.ReadWrite(ride.lift_hill_speed); - cs.ReadWrite(ride.num_circuits); + cs.ReadWrite(ride.operationOption); + cs.ReadWrite(ride.liftHillSpeed); + cs.ReadWrite(ride.numCircuits); // Special - cs.ReadWrite(ride.boat_hire_return_direction); - cs.ReadWrite(ride.boat_hire_return_position); - cs.ReadWrite(ride.ChairliftBullwheelLocation[0]); - cs.ReadWrite(ride.ChairliftBullwheelLocation[1]); - cs.ReadWrite(ride.chairlift_bullwheel_rotation); - cs.ReadWrite(ride.slide_in_use); - cs.ReadWrite(ride.slide_peep); - cs.ReadWrite(ride.slide_peep_t_shirt_colour); - cs.ReadWrite(ride.spiral_slide_progress); - cs.ReadWrite(ride.race_winner); - cs.ReadWrite(ride.cable_lift); - cs.ReadWrite(ride.CableLiftLoc); + cs.ReadWrite(ride.boatHireReturnDirection); + cs.ReadWrite(ride.boatHireReturnPosition); + cs.ReadWrite(ride.chairliftBullwheelLocation[0]); + cs.ReadWrite(ride.chairliftBullwheelLocation[1]); + cs.ReadWrite(ride.chairliftBullwheelRotation); + cs.ReadWrite(ride.slideInUse); + cs.ReadWrite(ride.slidePeep); + cs.ReadWrite(ride.slidePeepTShirtColour); + cs.ReadWrite(ride.spiralSlideProgress); + cs.ReadWrite(ride.raceWinner); + cs.ReadWrite(ride.cableLift); + cs.ReadWrite(ride.cableLiftLoc); // Stats if (cs.GetMode() == OrcaStream::Mode::READING) @@ -1542,39 +1542,39 @@ namespace OpenRCT2 } } - cs.ReadWrite(ride.special_track_elements); - cs.ReadWrite(ride.max_speed); - cs.ReadWrite(ride.average_speed); - cs.ReadWrite(ride.current_test_segment); - cs.ReadWrite(ride.average_speed_test_timeout); + cs.ReadWrite(ride.specialTrackElements); + cs.ReadWrite(ride.maxSpeed); + cs.ReadWrite(ride.averageSpeed); + cs.ReadWrite(ride.currentTestSegment); + cs.ReadWrite(ride.averageSpeedTestTimeout); - cs.ReadWrite(ride.max_positive_vertical_g); - cs.ReadWrite(ride.max_negative_vertical_g); - cs.ReadWrite(ride.max_lateral_g); - cs.ReadWrite(ride.previous_vertical_g); - cs.ReadWrite(ride.previous_lateral_g); + cs.ReadWrite(ride.maxPositiveVerticalG); + cs.ReadWrite(ride.maxNegativeVerticalG); + cs.ReadWrite(ride.maxLateralG); + cs.ReadWrite(ride.previousVerticalG); + cs.ReadWrite(ride.previousLateralG); - cs.ReadWrite(ride.testing_flags); - cs.ReadWrite(ride.CurTestTrackLocation); + cs.ReadWrite(ride.testingFlags); + cs.ReadWrite(ride.curTestTrackLocation); - cs.ReadWrite(ride.turn_count_default); - cs.ReadWrite(ride.turn_count_banked); - cs.ReadWrite(ride.turn_count_sloped); + cs.ReadWrite(ride.turnCountDefault); + cs.ReadWrite(ride.turnCountBanked); + cs.ReadWrite(ride.turnCountSloped); cs.ReadWrite(ride.inversions); cs.ReadWrite(ride.dropsPoweredLifts); - cs.ReadWrite(ride.start_drop_height); - cs.ReadWrite(ride.highest_drop_height); - cs.ReadWrite(ride.sheltered_length); - cs.ReadWrite(ride.var_11C); - cs.ReadWrite(ride.num_sheltered_sections); + cs.ReadWrite(ride.startDropHeight); + cs.ReadWrite(ride.highestDropHeight); + cs.ReadWrite(ride.shelteredLength); + cs.ReadWrite(ride.var11C); + cs.ReadWrite(ride.numShelteredSections); if (version > 5) { - cs.ReadWrite(ride.sheltered_eighths); + cs.ReadWrite(ride.shelteredEighths); cs.ReadWrite(ride.holes); } - cs.ReadWrite(ride.current_test_station); - cs.ReadWrite(ride.num_block_brakes); + cs.ReadWrite(ride.currentTestStation); + cs.ReadWrite(ride.numBlockBrakes); cs.ReadWrite(ride.totalAirTime); cs.ReadWrite(ride.ratings.excitement); @@ -1612,76 +1612,76 @@ namespace OpenRCT2 cs.ReadWrite(ride.value); } - cs.ReadWrite(ride.num_riders); - cs.ReadWrite(ride.build_date); + cs.ReadWrite(ride.numRiders); + cs.ReadWrite(ride.buildDate); if (version <= 18) { money16 tempUpkeepCost{}; cs.ReadWrite(tempUpkeepCost); - ride.upkeep_cost = ToMoney64(tempUpkeepCost); + ride.upkeepCost = ToMoney64(tempUpkeepCost); } else { - cs.ReadWrite(ride.upkeep_cost); + cs.ReadWrite(ride.upkeepCost); } - cs.ReadWrite(ride.cur_num_customers); - cs.ReadWrite(ride.num_customers_timeout); + cs.ReadWrite(ride.curNumCustomers); + cs.ReadWrite(ride.numCustomersTimeout); - cs.ReadWriteArray(ride.num_customers, [&cs](uint16_t& v) { + cs.ReadWriteArray(ride.numCustomers, [&cs](uint16_t& v) { cs.ReadWrite(v); return true; }); - cs.ReadWrite(ride.total_customers); - cs.ReadWrite(ride.total_profit); + cs.ReadWrite(ride.totalCustomers); + cs.ReadWrite(ride.totalProfit); cs.ReadWrite(ride.popularity); - cs.ReadWrite(ride.popularity_time_out); - cs.ReadWrite(ride.popularity_next); - cs.ReadWrite(ride.guests_favourite); - cs.ReadWrite(ride.no_primary_items_sold); - cs.ReadWrite(ride.no_secondary_items_sold); - cs.ReadWrite(ride.income_per_hour); + cs.ReadWrite(ride.popularityTimeout); + cs.ReadWrite(ride.popularityNext); + cs.ReadWrite(ride.guestsFavourite); + cs.ReadWrite(ride.numPrimaryItemsSold); + cs.ReadWrite(ride.numSecondaryItemsSold); + cs.ReadWrite(ride.incomePerHour); cs.ReadWrite(ride.profit); cs.ReadWrite(ride.satisfaction); - cs.ReadWrite(ride.satisfaction_time_out); - cs.ReadWrite(ride.satisfaction_next); + cs.ReadWrite(ride.satisfactionTimeout); + cs.ReadWrite(ride.satisfactionNext); // Breakdown - cs.ReadWrite(ride.breakdown_reason_pending); - cs.ReadWrite(ride.mechanic_status); + cs.ReadWrite(ride.breakdownReasonPending); + cs.ReadWrite(ride.mechanicStatus); cs.ReadWrite(ride.mechanic); - cs.ReadWrite(ride.inspection_station); - cs.ReadWrite(ride.broken_vehicle); - cs.ReadWrite(ride.broken_car); - cs.ReadWrite(ride.breakdown_reason); - cs.ReadWrite(ride.reliability_subvalue); - cs.ReadWrite(ride.reliability_percentage); - cs.ReadWrite(ride.unreliability_factor); + cs.ReadWrite(ride.inspectionStation); + cs.ReadWrite(ride.brokenTrain); + cs.ReadWrite(ride.brokenCar); + cs.ReadWrite(ride.breakdownReason); + cs.ReadWrite(ride.reliabilitySubvalue); + cs.ReadWrite(ride.reliabilityPercentage); + cs.ReadWrite(ride.unreliabilityFactor); cs.ReadWrite(ride.downtime); - cs.ReadWrite(ride.inspection_interval); - cs.ReadWrite(ride.last_inspection); + cs.ReadWrite(ride.inspectionInterval); + cs.ReadWrite(ride.lastInspection); - cs.ReadWriteArray(ride.downtime_history, [&cs](uint8_t& v) { + cs.ReadWriteArray(ride.downtimeHistory, [&cs](uint8_t& v) { cs.ReadWrite(v); return true; }); - cs.ReadWrite(ride.breakdown_sound_modifier); - cs.ReadWrite(ride.not_fixed_timeout); - cs.ReadWrite(ride.last_crash_type); - cs.ReadWrite(ride.connected_message_throttle); + cs.ReadWrite(ride.breakdownSoundModifier); + cs.ReadWrite(ride.notFixedTimeout); + cs.ReadWrite(ride.lastCrashType); + cs.ReadWrite(ride.connectedMessageThrottle); - cs.ReadWrite(ride.vehicle_change_timeout); + cs.ReadWrite(ride.vehicleChangeTimeout); - cs.ReadWrite(ride.current_issues); - cs.ReadWrite(ride.last_issue_time); + cs.ReadWrite(ride.currentIssues); + cs.ReadWrite(ride.lastIssueTime); // Music cs.ReadWrite(ride.music); - cs.ReadWrite(ride.music_tune_id); - cs.ReadWrite(ride.music_position); + cs.ReadWrite(ride.musicTuneId); + cs.ReadWrite(ride.musicPosition); return true; }); }); diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index edba14eb18..39e5095936 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -422,7 +422,7 @@ namespace OpenRCT2::PathFinding continue; RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); - if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride != nullptr && ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { *outRideIndex = rideIndex; return PathSearchResult::ShopEntrance; @@ -791,7 +791,7 @@ namespace OpenRCT2::PathFinding * tile. */ rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); - if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride == nullptr || !ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) continue; found = true; @@ -2056,13 +2056,13 @@ namespace OpenRCT2::PathFinding int32_t numEntranceStations = 0; BitSet entranceStations = {}; - for (const auto& station : ride->GetStations()) + for (const auto& station : ride->getStations()) { // Skip if stationNum has no entrance (so presumably an exit only station) if (station.Entrance.IsNull()) continue; - const auto stationIndex = ride->GetStationIndex(&station); + const auto stationIndex = ride->getStationIndex(&station); numEntranceStations++; entranceStations[stationIndex.ToUnderlying()] = true; @@ -2081,7 +2081,7 @@ namespace OpenRCT2::PathFinding if (numEntranceStations == 0) closestStationNum = StationIndex::FromUnderlying(0); - if (numEntranceStations > 1 && (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)) + if (numEntranceStations > 1 && (ride->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)) { closestStationNum = GuestPathfindingSelectRandomStation(peep, numEntranceStations, entranceStations); } @@ -2089,7 +2089,7 @@ namespace OpenRCT2::PathFinding if (numEntranceStations == 0) { // closestStationNum is always 0 here. - const auto& closestStation = ride->GetStation(closestStationNum); + const auto& closestStation = ride->getStation(closestStationNum); auto entranceXY = TileCoordsXY(closestStation.Start); loc.x = entranceXY.x; loc.y = entranceXY.y; @@ -2097,7 +2097,7 @@ namespace OpenRCT2::PathFinding } else { - TileCoordsXYZD entranceXYZD = ride->GetStation(closestStationNum).Entrance; + TileCoordsXYZD entranceXYZD = ride->getStation(closestStationNum).Entrance; loc.x = entranceXYZD.x; loc.y = entranceXYZD.y; loc.z = entranceXYZD.z; diff --git a/src/openrct2/profiling/Profiling.cpp b/src/openrct2/profiling/Profiling.cpp index 63ea4ea107..cafb701446 100644 --- a/src/openrct2/profiling/Profiling.cpp +++ b/src/openrct2/profiling/Profiling.cpp @@ -163,7 +163,7 @@ namespace OpenRCT2::Profiling double avg = 0.0; if (func->GetCallCount() > 0) - avg = func->GetTotalTime() / func->GetCallCount(); + avg = func->getTotalTime() / func->GetCallCount(); out << avg << "\n"; } diff --git a/src/openrct2/profiling/Profiling.h b/src/openrct2/profiling/Profiling.h index 0d079d4712..4d09fac4d7 100644 --- a/src/openrct2/profiling/Profiling.h +++ b/src/openrct2/profiling/Profiling.h @@ -38,7 +38,7 @@ namespace OpenRCT2::Profiling virtual std::vector GetTimeSamples() const = 0; // Returns all time accumulated in microseconds. - virtual double GetTotalTime() const = 0; + virtual double getTotalTime() const = 0; // Returns the min. time in microseconds. virtual double GetMinTime() const = 0; @@ -118,7 +118,7 @@ namespace OpenRCT2::Profiling return { Children.begin(), Children.end() }; } - double GetTotalTime() const override + double getTotalTime() const override { std::scoped_lock lock(Mutex); return TotalTimeUs; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index edde0a0561..2d67970436 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -876,38 +876,38 @@ namespace OpenRCT2::RCT1 // Ride name if (IsUserStringID(src->Name)) { - dst->custom_name = GetUserString(src->Name); + dst->customName = GetUserString(src->Name); } dst->status = static_cast(src->Status); // Flags - dst->lifecycle_flags = src->LifecycleFlags; + dst->lifecycleFlags = src->LifecycleFlags; // These flags were not in the base game if (_gameVersion == FILE_VERSION_RCT1) { - dst->lifecycle_flags &= ~RIDE_LIFECYCLE_MUSIC; - dst->lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE; - dst->lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; + dst->lifecycleFlags &= ~RIDE_LIFECYCLE_MUSIC; + dst->lifecycleFlags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE; + dst->lifecycleFlags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; } if (VehicleTypeIsReversed(src->VehicleType)) { - dst->lifecycle_flags |= RIDE_LIFECYCLE_REVERSED_TRAINS; + dst->lifecycleFlags |= RIDE_LIFECYCLE_REVERSED_TRAINS; } // Station if (src->OverallView.IsNull()) { - dst->overall_view.SetNull(); + dst->overallView.SetNull(); } else { - dst->overall_view = TileCoordsXY{ src->OverallView.x, src->OverallView.y }.ToCoordsXY(); + dst->overallView = TileCoordsXY{ src->OverallView.x, src->OverallView.y }.ToCoordsXY(); } for (StationIndex::UnderlyingType i = 0; i < Limits::kMaxStationsPerRide; i++) { - auto& dstStation = dst->GetStation(StationIndex::FromUnderlying(i)); + auto& dstStation = dst->getStation(StationIndex::FromUnderlying(i)); if (src->StationStarts[i].IsNull()) { dstStation.Start.SetNull(); @@ -944,7 +944,7 @@ namespace OpenRCT2::RCT1 // All other values take 0 as their default. Since they're already memset to that, no need to do it again. for (int32_t i = Limits::kMaxStationsPerRide; i < OpenRCT2::Limits::kMaxStationsPerRide; i++) { - auto& dstStation = dst->GetStation(StationIndex::FromUnderlying(i)); + auto& dstStation = dst->getStation(StationIndex::FromUnderlying(i)); dstStation.Start.SetNull(); dstStation.TrainAtStation = RideStation::kNoTrain; dstStation.Entrance.SetNull(); @@ -952,7 +952,7 @@ namespace OpenRCT2::RCT1 dstStation.LastPeepInQueue = EntityId::GetNull(); } - dst->num_stations = src->NumStations; + dst->numStations = src->NumStations; // Vehicle links (indexes converted later) for (int32_t i = 0; i < Limits::kMaxTrainsPerRide; i++) @@ -964,26 +964,26 @@ namespace OpenRCT2::RCT1 dst->vehicles[i] = EntityId::GetNull(); } - dst->NumTrains = src->NumTrains; - dst->num_cars_per_train = src->NumCarsPerTrain + rideEntry->zero_cars; - dst->ProposedNumTrains = src->NumTrains; - dst->max_trains = src->MaxTrains; - dst->proposed_num_cars_per_train = src->NumCarsPerTrain + rideEntry->zero_cars; - dst->special_track_elements = src->SpecialTrackElements; - dst->num_sheltered_sections = src->NumShelteredSections; - dst->sheltered_length = src->ShelteredLength; + dst->numTrains = src->NumTrains; + dst->numCarsPerTrain = src->NumCarsPerTrain + rideEntry->zero_cars; + dst->proposedNumTrains = src->NumTrains; + dst->maxTrains = src->MaxTrains; + dst->proposedNumCarsPerTrain = src->NumCarsPerTrain + rideEntry->zero_cars; + dst->specialTrackElements = src->SpecialTrackElements; + dst->numShelteredSections = src->NumShelteredSections; + dst->shelteredLength = src->ShelteredLength; // Operation - dst->depart_flags = src->DepartFlags; - dst->min_waiting_time = src->MinWaitingTime; - dst->max_waiting_time = src->MaxWaitingTime; - dst->operation_option = src->OperationOption; - dst->num_circuits = 1; - dst->MinCarsPerTrain = rideEntry->min_cars_in_train; - dst->MaxCarsPerTrain = rideEntry->max_cars_in_train; + dst->departFlags = src->DepartFlags; + dst->minWaitingTime = src->MinWaitingTime; + dst->maxWaitingTime = src->MaxWaitingTime; + dst->operationOption = src->OperationOption; + dst->numCircuits = 1; + dst->minCarsPerTrain = rideEntry->min_cars_in_train; + dst->maxCarsPerTrain = rideEntry->max_cars_in_train; // RCT1 used 5mph / 8 km/h for every lift hill - dst->lift_hill_speed = 5; + dst->liftHillSpeed = 5; dst->music = kObjectEntryIndexNull; if (GetRideTypeDescriptor(dst->type).HasFlag(RtdFlag::allowMusic)) @@ -1003,8 +1003,8 @@ namespace OpenRCT2::RCT1 { if (src->DepartFlags & RCT1_RIDE_DEPART_PLAY_MUSIC) { - dst->depart_flags &= ~RCT1_RIDE_DEPART_PLAY_MUSIC; - dst->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + dst->departFlags &= ~RCT1_RIDE_DEPART_PLAY_MUSIC; + dst->lifecycleFlags |= RIDE_LIFECYCLE_MUSIC; } } } @@ -1027,94 +1027,94 @@ namespace OpenRCT2::RCT1 SetRideColourScheme(dst, src); // Maintenance - dst->build_date = static_cast(src->BuildDate); - dst->inspection_interval = src->InspectionInterval; - dst->last_inspection = src->LastInspection; + dst->buildDate = static_cast(src->BuildDate); + dst->inspectionInterval = src->InspectionInterval; + dst->lastInspection = src->LastInspection; dst->reliability = src->Reliability; - dst->unreliability_factor = src->UnreliabilityFactor; + dst->unreliabilityFactor = src->UnreliabilityFactor; dst->downtime = src->Downtime; - dst->breakdown_reason = src->BreakdownReason; - dst->mechanic_status = src->MechanicStatus; + dst->breakdownReason = src->BreakdownReason; + dst->mechanicStatus = src->MechanicStatus; dst->mechanic = EntityId::FromUnderlying(src->Mechanic); - dst->breakdown_reason_pending = src->BreakdownReasonPending; - dst->inspection_station = StationIndex::FromUnderlying(src->InspectionStation); - dst->broken_car = src->BrokenCar; - dst->broken_vehicle = src->BrokenVehicle; + dst->breakdownReasonPending = src->BreakdownReasonPending; + dst->inspectionStation = StationIndex::FromUnderlying(src->InspectionStation); + dst->brokenCar = src->BrokenCar; + dst->brokenTrain = src->BrokenVehicle; // Measurement data dst->ratings = src->ratings; - dst->max_speed = src->MaxSpeed; - dst->average_speed = src->AverageSpeed; + dst->maxSpeed = src->MaxSpeed; + dst->averageSpeed = src->AverageSpeed; - dst->max_positive_vertical_g = src->MaxPositiveVerticalG; - dst->max_negative_vertical_g = src->MaxNegativeVerticalG; - dst->max_lateral_g = src->MaxLateralG; - dst->previous_lateral_g = src->PreviousLateralG; - dst->previous_vertical_g = src->PreviousVerticalG; - dst->turn_count_banked = src->TurnCountBanked; - dst->turn_count_default = src->TurnCountDefault; - dst->turn_count_sloped = src->TurnCountSloped; + dst->maxPositiveVerticalG = src->MaxPositiveVerticalG; + dst->maxNegativeVerticalG = src->MaxNegativeVerticalG; + dst->maxLateralG = src->MaxLateralG; + dst->previousLateralG = src->PreviousLateralG; + dst->previousVerticalG = src->PreviousVerticalG; + dst->turnCountBanked = src->TurnCountBanked; + dst->turnCountDefault = src->TurnCountDefault; + dst->turnCountSloped = src->TurnCountSloped; dst->dropsPoweredLifts = src->NumDrops; - dst->start_drop_height = src->StartDropHeight / 2; - dst->highest_drop_height = src->HighestDropHeight / 2; + dst->startDropHeight = src->StartDropHeight / 2; + dst->highestDropHeight = src->HighestDropHeight / 2; if (src->Type == RideType::MiniatureGolf) dst->holes = src->NumInversions & kRCT12InversionAndHoleMask; else dst->inversions = src->NumInversions & kRCT12InversionAndHoleMask; - dst->sheltered_eighths = src->NumInversions >> 5; - dst->boat_hire_return_direction = src->BoatHireReturnDirection; - dst->boat_hire_return_position = { src->BoatHireReturnPosition.x, src->BoatHireReturnPosition.y }; - dst->chairlift_bullwheel_rotation = src->ChairliftBullwheelRotation; + dst->shelteredEighths = src->NumInversions >> 5; + dst->boatHireReturnDirection = src->BoatHireReturnDirection; + dst->boatHireReturnPosition = { src->BoatHireReturnPosition.x, src->BoatHireReturnPosition.y }; + dst->chairliftBullwheelRotation = src->ChairliftBullwheelRotation; for (int i = 0; i < 2; i++) { - dst->ChairliftBullwheelLocation[i] = { src->ChairliftBullwheelLocation[i].x, + dst->chairliftBullwheelLocation[i] = { src->ChairliftBullwheelLocation[i].x, src->ChairliftBullwheelLocation[i].y, src->ChairliftBullwheelZ[i] / 2 }; } if (src->CurTestTrackLocation.IsNull()) { - dst->CurTestTrackLocation.SetNull(); + dst->curTestTrackLocation.SetNull(); } else { - dst->CurTestTrackLocation = { src->CurTestTrackLocation.x, src->CurTestTrackLocation.y, + dst->curTestTrackLocation = { src->CurTestTrackLocation.x, src->CurTestTrackLocation.y, src->CurTestTrackZ / 2 }; } - dst->testing_flags = src->TestingFlags; - dst->current_test_segment = src->CurrentTestSegment; - dst->current_test_station = StationIndex::GetNull(); - dst->average_speed_test_timeout = src->AverageSpeedTestTimeout; - dst->slide_in_use = src->SlideInUse; - dst->slide_peep_t_shirt_colour = RCT1::GetColour(src->SlidePeepTshirtColour); - dst->spiral_slide_progress = src->SpiralSlideProgress; - // Doubles as slide_peep - dst->maze_tiles = src->MazeTiles; + dst->testingFlags = src->TestingFlags; + dst->currentTestSegment = src->CurrentTestSegment; + dst->currentTestStation = StationIndex::GetNull(); + dst->averageSpeedTestTimeout = src->AverageSpeedTestTimeout; + dst->slideInUse = src->SlideInUse; + dst->slidePeepTShirtColour = RCT1::GetColour(src->SlidePeepTshirtColour); + dst->spiralSlideProgress = src->SpiralSlideProgress; + // Doubles as slidePeep + dst->mazeTiles = src->MazeTiles; // Finance / customers - dst->upkeep_cost = ToMoney64(src->UpkeepCost); + dst->upkeepCost = ToMoney64(src->UpkeepCost); dst->price[0] = src->Price; dst->price[1] = src->PriceSecondary; - dst->income_per_hour = ToMoney64(src->IncomePerHour); - dst->total_customers = src->TotalCustomers; + dst->incomePerHour = ToMoney64(src->IncomePerHour); + dst->totalCustomers = src->TotalCustomers; dst->profit = ToMoney64(src->Profit); - dst->total_profit = ToMoney64(src->TotalProfit); + dst->totalProfit = ToMoney64(src->TotalProfit); dst->value = ToMoney64(src->Value); for (size_t i = 0; i < std::size(src->NumCustomers); i++) { - dst->num_customers[i] = src->NumCustomers[i]; + dst->numCustomers[i] = src->NumCustomers[i]; } dst->satisfaction = src->Satisfaction; - dst->satisfaction_time_out = src->SatisfactionTimeOut; - dst->satisfaction_next = src->SatisfactionNext; + dst->satisfactionTimeout = src->SatisfactionTimeOut; + dst->satisfactionNext = src->SatisfactionNext; dst->popularity = src->Popularity; - dst->popularity_next = src->PopularityNext; - dst->popularity_time_out = src->PopularityTimeOut; + dst->popularityNext = src->PopularityNext; + dst->popularityTimeout = src->PopularityTimeOut; - dst->num_riders = src->NumRiders; + dst->numRiders = src->NumRiders; - dst->music_tune_id = kTuneIDNull; + dst->musicTuneId = kTuneIDNull; } void SetRideColourScheme(::Ride* dst, RCT1::Ride* src) @@ -1123,49 +1123,49 @@ namespace OpenRCT2::RCT1 dst->vehicleColourSettings = src->vehicleColourSettings; if (_gameVersion == FILE_VERSION_RCT1) { - dst->track_colour[0].main = RCT1::GetColour(src->TrackPrimaryColour); - dst->track_colour[0].additional = RCT1::GetColour(src->TrackSecondaryColour); - dst->track_colour[0].supports = RCT1::GetColour(src->TrackSupportColour); + dst->trackColours[0].main = RCT1::GetColour(src->TrackPrimaryColour); + dst->trackColours[0].additional = RCT1::GetColour(src->TrackSecondaryColour); + dst->trackColours[0].supports = RCT1::GetColour(src->TrackSupportColour); // Balloons were always blue in the original RCT. if (src->Type == RideType::BalloonStall) { - dst->track_colour[0].main = COLOUR_LIGHT_BLUE; + dst->trackColours[0].main = COLOUR_LIGHT_BLUE; } else if (src->Type == RideType::RiverRapids) { - dst->track_colour[0].main = COLOUR_WHITE; + dst->trackColours[0].main = COLOUR_WHITE; } } else { for (int i = 0; i < Limits::kNumColourSchemes; i++) { - dst->track_colour[i].main = RCT1::GetColour(src->TrackColourMain[i]); - dst->track_colour[i].additional = RCT1::GetColour(src->TrackColourAdditional[i]); - dst->track_colour[i].supports = RCT1::GetColour(src->TrackColourSupports[i]); + dst->trackColours[i].main = RCT1::GetColour(src->TrackColourMain[i]); + dst->trackColours[i].additional = RCT1::GetColour(src->TrackColourAdditional[i]); + dst->trackColours[i].supports = RCT1::GetColour(src->TrackColourSupports[i]); } } - dst->entrance_style = kObjectEntryIndexNull; - if (dst->GetRideTypeDescriptor().HasFlag(RtdFlag::hasEntranceAndExit)) + dst->entranceStyle = kObjectEntryIndexNull; + if (dst->getRideTypeDescriptor().HasFlag(RtdFlag::hasEntranceAndExit)) { // Entrance styles were introduced with AA. They correspond directly with those in RCT2. if (_gameVersion == FILE_VERSION_RCT1) { - dst->entrance_style = 0; // plain entrance + dst->entranceStyle = 0; // plain entrance } else { - dst->entrance_style = src->EntranceStyle; + dst->entranceStyle = src->EntranceStyle; } } if (_gameVersion < FILE_VERSION_RCT1_LL && src->Type == RideType::MerryGoRound) { // The merry-go-round in pre-LL versions was always yellow with red - dst->vehicle_colours[0].Body = COLOUR_YELLOW; - dst->vehicle_colours[0].Trim = COLOUR_BRIGHT_RED; + dst->vehicleColours[0].Body = COLOUR_YELLOW; + dst->vehicleColours[0].Trim = COLOUR_BRIGHT_RED; } else { @@ -1175,41 +1175,41 @@ namespace OpenRCT2::RCT1 const auto colourSchemeCopyDescriptor = GetColourSchemeCopyDescriptor(src->VehicleType); if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) { - dst->vehicle_colours[i].Body = RCT1::GetColour(src->VehicleColours[i].Body); + dst->vehicleColours[i].Body = RCT1::GetColour(src->VehicleColours[i].Body); } else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) { - dst->vehicle_colours[i].Body = RCT1::GetColour(src->VehicleColours[i].Trim); + dst->vehicleColours[i].Body = RCT1::GetColour(src->VehicleColours[i].Trim); } else { - dst->vehicle_colours[i].Body = colourSchemeCopyDescriptor.colour1; + dst->vehicleColours[i].Body = colourSchemeCopyDescriptor.colour1; } if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) { - dst->vehicle_colours[i].Trim = RCT1::GetColour(src->VehicleColours[i].Body); + dst->vehicleColours[i].Trim = RCT1::GetColour(src->VehicleColours[i].Body); } else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) { - dst->vehicle_colours[i].Trim = RCT1::GetColour(src->VehicleColours[i].Trim); + dst->vehicleColours[i].Trim = RCT1::GetColour(src->VehicleColours[i].Trim); } else { - dst->vehicle_colours[i].Trim = colourSchemeCopyDescriptor.colour2; + dst->vehicleColours[i].Trim = colourSchemeCopyDescriptor.colour2; } if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) { - dst->vehicle_colours[i].Tertiary = RCT1::GetColour(src->VehicleColours[i].Body); + dst->vehicleColours[i].Tertiary = RCT1::GetColour(src->VehicleColours[i].Body); } else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) { - dst->vehicle_colours[i].Tertiary = RCT1::GetColour(src->VehicleColours[i].Trim); + dst->vehicleColours[i].Tertiary = RCT1::GetColour(src->VehicleColours[i].Trim); } else { - dst->vehicle_colours[i].Tertiary = colourSchemeCopyDescriptor.colour3; + dst->vehicleColours[i].Tertiary = colourSchemeCopyDescriptor.colour3; } } } @@ -1219,9 +1219,9 @@ namespace OpenRCT2::RCT1 if (src->Type == RideType::HedgeMaze) { if (_gameVersion < FILE_VERSION_RCT1_LL || src->TrackColourSupports[0] > 3) - dst->track_colour[0].supports = MAZE_WALL_TYPE_HEDGE; + dst->trackColours[0].supports = MAZE_WALL_TYPE_HEDGE; else - dst->track_colour[0].supports = src->TrackColourSupports[0]; + dst->trackColours[0].supports = src->TrackColourSupports[0]; } } @@ -2628,7 +2628,7 @@ namespace OpenRCT2::RCT1 auto ride = GetRide(rideIndex); if (ride != nullptr) { - ride->num_block_brakes++; + ride->numBlockBrakes++; } } } while (!(tileElement++)->IsLastForTile()); @@ -2644,9 +2644,9 @@ namespace OpenRCT2::RCT1 { for (auto& ride : GetRideManager()) { - if (ride.custom_name.empty()) + if (ride.customName.empty()) { - ride.SetNameToDefault(); + ride.setNameToDefault(); } } } diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index 12a43e2e27..d88449eb7b 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -515,7 +515,7 @@ static void SwapRideEntranceAndExit(RideId rideId) // Now, swap the entrance and exit. if (ride != nullptr) { - auto& station = ride->GetStation(); + auto& station = ride->getStation(); auto entranceCoords = station.Exit; auto exitCoords = station.Entrance; station.Entrance = entranceCoords; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 89844ee812..8fdb2ffbb2 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -230,7 +230,7 @@ namespace OpenRCT2::RCT2 { struct { - uint8_t ReliabilitySubvalue; // 0x196, 0 - 255, acts like the decimals for reliability_percentage + uint8_t ReliabilitySubvalue; // 0x196, 0 - 255, acts like the decimals for reliabilityPercentage uint8_t ReliabilityPercentage; // 0x197, Starts at 100 and decreases from there. }; uint16_t Reliability; // 0x196 diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 805f37d323..428bac0b8a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -730,37 +730,37 @@ namespace OpenRCT2::RCT2 for (uint8_t i = 0; i < Limits::kMaxVehicleColours; i++) { - dst->vehicle_colours[i].Body = src->VehicleColours[i].BodyColour; - dst->vehicle_colours[i].Trim = src->VehicleColours[i].TrimColour; + dst->vehicleColours[i].Body = src->VehicleColours[i].BodyColour; + dst->vehicleColours[i].Trim = src->VehicleColours[i].TrimColour; } // Pad046; dst->status = static_cast(src->Status); - dst->default_name_number = src->NameArgumentsNumber; + dst->defaultNameNumber = src->NameArgumentsNumber; if (IsUserStringID(src->Name)) { - dst->custom_name = GetUserString(src->Name); + dst->customName = GetUserString(src->Name); } else { - dst->default_name_number = src->NameArgumentsNumber; + dst->defaultNameNumber = src->NameArgumentsNumber; } if (src->OverallView.IsNull()) { - dst->overall_view.SetNull(); + dst->overallView.SetNull(); } else { auto tileLoc = TileCoordsXY(src->OverallView.x, src->OverallView.y); - dst->overall_view = tileLoc.ToCoordsXY(); + dst->overallView = tileLoc.ToCoordsXY(); } for (StationIndex::UnderlyingType i = 0; i < Limits::kMaxStationsPerRide; i++) { StationIndex stationIndex = StationIndex::FromUnderlying(i); - auto& destStation = dst->GetStation(stationIndex); + auto& destStation = dst->getStation(stationIndex); if (src->StationStarts[i].IsNull()) { @@ -800,7 +800,7 @@ namespace OpenRCT2::RCT2 for (int32_t i = Limits::kMaxStationsPerRide; i < OpenRCT2::Limits::kMaxStationsPerRide; i++) { StationIndex stationIndex = StationIndex::FromUnderlying(i); - auto& destStation = dst->GetStation(stationIndex); + auto& destStation = dst->getStation(stationIndex); destStation.Start.SetNull(); destStation.TrainAtStation = RideStation::kNoTrain; @@ -818,154 +818,154 @@ namespace OpenRCT2::RCT2 dst->vehicles[i] = EntityId::GetNull(); } - dst->depart_flags = src->DepartFlags; + dst->departFlags = src->DepartFlags; - dst->num_stations = src->NumStations; - dst->NumTrains = src->NumTrains; - dst->num_cars_per_train = src->NumCarsPerTrain; - dst->ProposedNumTrains = src->ProposedNumTrains; - dst->proposed_num_cars_per_train = src->ProposedNumCarsPerTrain; - dst->max_trains = src->MaxTrains; - dst->MinCarsPerTrain = src->GetMinCarsPerTrain(); - dst->MaxCarsPerTrain = src->GetMaxCarsPerTrain(); - dst->min_waiting_time = src->MinWaitingTime; - dst->max_waiting_time = src->MaxWaitingTime; + dst->numStations = src->NumStations; + dst->numTrains = src->NumTrains; + dst->numCarsPerTrain = src->NumCarsPerTrain; + dst->proposedNumTrains = src->ProposedNumTrains; + dst->proposedNumCarsPerTrain = src->ProposedNumCarsPerTrain; + dst->maxTrains = src->MaxTrains; + dst->minCarsPerTrain = src->GetMinCarsPerTrain(); + dst->maxCarsPerTrain = src->GetMaxCarsPerTrain(); + dst->minWaitingTime = src->MinWaitingTime; + dst->maxWaitingTime = src->MaxWaitingTime; - // Includes time_limit, NumLaps, launch_speed, speed, rotations - dst->operation_option = src->OperationOption; + // Includes timeLimit, NumLaps, launchSpeed, speed, rotations + dst->operationOption = src->OperationOption; - dst->boat_hire_return_direction = src->BoatHireReturnDirection; - dst->boat_hire_return_position = { src->BoatHireReturnPosition.x, src->BoatHireReturnPosition.y }; + dst->boatHireReturnDirection = src->BoatHireReturnDirection; + dst->boatHireReturnPosition = { src->BoatHireReturnPosition.x, src->BoatHireReturnPosition.y }; - dst->special_track_elements = src->SpecialTrackElements; + dst->specialTrackElements = src->SpecialTrackElements; // Pad0D6[2]; - dst->max_speed = src->MaxSpeed; - dst->average_speed = src->AverageSpeed; - dst->current_test_segment = src->CurrentTestSegment; - dst->average_speed_test_timeout = src->AverageSpeedTestTimeout; + dst->maxSpeed = src->MaxSpeed; + dst->averageSpeed = src->AverageSpeed; + dst->currentTestSegment = src->CurrentTestSegment; + dst->averageSpeedTestTimeout = src->AverageSpeedTestTimeout; // Pad0E2[0x2]; - dst->max_positive_vertical_g = src->MaxPositiveVerticalG; - dst->max_negative_vertical_g = src->MaxNegativeVerticalG; - dst->max_lateral_g = src->MaxLateralG; - dst->previous_vertical_g = src->PreviousVerticalG; - dst->previous_lateral_g = src->PreviousLateralG; + dst->maxPositiveVerticalG = src->MaxPositiveVerticalG; + dst->maxNegativeVerticalG = src->MaxNegativeVerticalG; + dst->maxLateralG = src->MaxLateralG; + dst->previousVerticalG = src->PreviousVerticalG; + dst->previousLateralG = src->PreviousLateralG; // Pad106[0x2]; - dst->testing_flags = src->TestingFlags; + dst->testingFlags = src->TestingFlags; if (src->CurTestTrackLocation.IsNull()) { - dst->CurTestTrackLocation.SetNull(); + dst->curTestTrackLocation.SetNull(); } else { - dst->CurTestTrackLocation = { src->CurTestTrackLocation.x, src->CurTestTrackLocation.y, src->CurTestTrackZ }; + dst->curTestTrackLocation = { src->CurTestTrackLocation.x, src->CurTestTrackLocation.y, src->CurTestTrackZ }; } - dst->turn_count_default = src->TurnCountDefault; - dst->turn_count_banked = src->TurnCountBanked; - dst->turn_count_sloped = src->TurnCountSloped; + dst->turnCountDefault = src->TurnCountDefault; + dst->turnCountBanked = src->TurnCountBanked; + dst->turnCountSloped = src->TurnCountSloped; if (src->Type == RIDE_TYPE_MINI_GOLF) dst->holes = src->Inversions & kRCT12InversionAndHoleMask; else dst->inversions = src->Inversions & kRCT12InversionAndHoleMask; - dst->sheltered_eighths = src->Inversions >> 5; + dst->shelteredEighths = src->Inversions >> 5; dst->dropsPoweredLifts = src->Drops; - dst->start_drop_height = src->StartDropHeight; - dst->highest_drop_height = src->HighestDropHeight; - dst->sheltered_length = src->ShelteredLength; - dst->var_11C = src->Var11C; - dst->num_sheltered_sections = src->NumShelteredSections; + dst->startDropHeight = src->StartDropHeight; + dst->highestDropHeight = src->HighestDropHeight; + dst->shelteredLength = src->ShelteredLength; + dst->var11C = src->Var11C; + dst->numShelteredSections = src->NumShelteredSections; - dst->cur_num_customers = src->CurNumCustomers; - dst->num_customers_timeout = src->NumCustomersTimeout; + dst->curNumCustomers = src->CurNumCustomers; + dst->numCustomersTimeout = src->NumCustomersTimeout; for (uint8_t i = 0; i < Limits::kCustomerHistorySize; i++) { - dst->num_customers[i] = src->NumCustomers[i]; + dst->numCustomers[i] = src->NumCustomers[i]; } dst->price[0] = src->Price; for (uint8_t i = 0; i < 2; i++) { - dst->ChairliftBullwheelLocation[i] = { src->ChairliftBullwheelLocation[i].x, + dst->chairliftBullwheelLocation[i] = { src->ChairliftBullwheelLocation[i].x, src->ChairliftBullwheelLocation[i].y, src->ChairliftBullwheelZ[i] }; } dst->ratings = src->ratings; dst->value = ToMoney64(src->Value); - dst->chairlift_bullwheel_rotation = src->ChairliftBullwheelRotation; + dst->chairliftBullwheelRotation = src->ChairliftBullwheelRotation; dst->satisfaction = src->Satisfaction; - dst->satisfaction_time_out = src->SatisfactionTimeOut; - dst->satisfaction_next = src->SatisfactionNext; + dst->satisfactionTimeout = src->SatisfactionTimeOut; + dst->satisfactionNext = src->SatisfactionNext; - dst->window_invalidate_flags = src->WindowInvalidateFlags; + dst->windowInvalidateFlags = src->WindowInvalidateFlags; // Pad14E[0x02]; - dst->total_customers = src->TotalCustomers; - dst->total_profit = ToMoney64(src->TotalProfit); + dst->totalCustomers = src->TotalCustomers; + dst->totalProfit = ToMoney64(src->TotalProfit); dst->popularity = src->Popularity; - dst->popularity_time_out = src->PopularityTimeOut; - dst->popularity_next = src->PopularityNext; + dst->popularityTimeout = src->PopularityTimeOut; + dst->popularityNext = src->PopularityNext; ImportNumRiders(dst, rideIndex); - dst->music_tune_id = src->MusicTuneId; - dst->slide_in_use = src->SlideInUse; - // Includes maze_tiles - dst->slide_peep = EntityId::FromUnderlying(src->SlidePeep); + dst->musicTuneId = src->MusicTuneId; + dst->slideInUse = src->SlideInUse; + // Includes mazeTiles + dst->slidePeep = EntityId::FromUnderlying(src->SlidePeep); // Pad160[0xE]; - dst->slide_peep_t_shirt_colour = src->SlidePeepTShirtColour; + dst->slidePeepTShirtColour = src->SlidePeepTShirtColour; // Pad16F[0x7]; - dst->spiral_slide_progress = src->SpiralSlideProgress; + dst->spiralSlideProgress = src->SpiralSlideProgress; // Pad177[0x9]; - dst->build_date = static_cast(src->BuildDate); - dst->upkeep_cost = ToMoney64(src->UpkeepCost); - dst->race_winner = EntityId::FromUnderlying(src->RaceWinner); + dst->buildDate = static_cast(src->BuildDate); + dst->upkeepCost = ToMoney64(src->UpkeepCost); + dst->raceWinner = EntityId::FromUnderlying(src->RaceWinner); // Pad186[0x02]; - dst->music_position = src->MusicPosition; + dst->musicPosition = src->MusicPosition; - dst->breakdown_reason_pending = src->BreakdownReasonPending; - dst->mechanic_status = src->MechanicStatus; + dst->breakdownReasonPending = src->BreakdownReasonPending; + dst->mechanicStatus = src->MechanicStatus; dst->mechanic = EntityId::FromUnderlying(src->Mechanic); - dst->inspection_station = StationIndex::FromUnderlying(src->InspectionStation); - dst->broken_vehicle = src->BrokenVehicle; - dst->broken_car = src->BrokenCar; - dst->breakdown_reason = src->BreakdownReason; + dst->inspectionStation = StationIndex::FromUnderlying(src->InspectionStation); + dst->brokenTrain = src->BrokenVehicle; + dst->brokenCar = src->BrokenCar; + dst->breakdownReason = src->BreakdownReason; dst->price[1] = src->PriceSecondary; dst->reliability = src->Reliability; - dst->unreliability_factor = src->UnreliabilityFactor; + dst->unreliabilityFactor = src->UnreliabilityFactor; dst->downtime = src->Downtime; - dst->inspection_interval = src->InspectionInterval; - dst->last_inspection = src->LastInspection; + dst->inspectionInterval = src->InspectionInterval; + dst->lastInspection = src->LastInspection; for (uint8_t i = 0; i < Limits::kDowntimeHistorySize; i++) { - dst->downtime_history[i] = src->DowntimeHistory[i]; + dst->downtimeHistory[i] = src->DowntimeHistory[i]; } - dst->no_primary_items_sold = src->NoPrimaryItemsSold; - dst->no_secondary_items_sold = src->NoSecondaryItemsSold; + dst->numPrimaryItemsSold = src->NoPrimaryItemsSold; + dst->numSecondaryItemsSold = src->NoSecondaryItemsSold; - dst->breakdown_sound_modifier = src->BreakdownSoundModifier; - dst->not_fixed_timeout = src->NotFixedTimeout; - dst->last_crash_type = src->LastCrashType; - dst->connected_message_throttle = src->ConnectedMessageThrottle; + dst->breakdownSoundModifier = src->BreakdownSoundModifier; + dst->notFixedTimeout = src->NotFixedTimeout; + dst->lastCrashType = src->LastCrashType; + dst->connectedMessageThrottle = src->ConnectedMessageThrottle; - dst->income_per_hour = ToMoney64(src->IncomePerHour); + dst->incomePerHour = ToMoney64(src->IncomePerHour); dst->profit = ToMoney64(src->Profit); for (uint8_t i = 0; i < Limits::kNumColourSchemes; i++) { - dst->track_colour[i].main = src->TrackColourMain[i]; - dst->track_colour[i].additional = src->TrackColourAdditional[i]; - dst->track_colour[i].supports = src->TrackColourSupports[i]; + dst->trackColours[i].main = src->TrackColourMain[i]; + dst->trackColours[i].additional = src->TrackColourAdditional[i]; + dst->trackColours[i].supports = src->TrackColourSupports[i]; } // This stall was not colourable in RCT2. if (dst->type == RIDE_TYPE_FOOD_STALL) @@ -973,7 +973,7 @@ namespace OpenRCT2::RCT2 auto object = ObjectEntryGetObject(ObjectType::ride, dst->subtype); if (object != nullptr && object->GetIdentifier() == "rct2.ride.icecr1") { - dst->track_colour[0].main = COLOUR_LIGHT_BLUE; + dst->trackColours[0].main = COLOUR_LIGHT_BLUE; } } @@ -990,25 +990,25 @@ namespace OpenRCT2::RCT2 { entranceStyle = src->EntranceStyle; } - dst->entrance_style = entranceStyle; + dst->entranceStyle = entranceStyle; - dst->vehicle_change_timeout = src->VehicleChangeTimeout; - dst->num_block_brakes = src->NumBlockBrakes; - dst->lift_hill_speed = src->LiftHillSpeed; - dst->guests_favourite = src->GuestsFavourite; - dst->lifecycle_flags = src->LifecycleFlags; + dst->vehicleChangeTimeout = src->VehicleChangeTimeout; + dst->numBlockBrakes = src->NumBlockBrakes; + dst->liftHillSpeed = src->LiftHillSpeed; + dst->guestsFavourite = src->GuestsFavourite; + dst->lifecycleFlags = src->LifecycleFlags; for (uint8_t i = 0; i < Limits::kMaxTrainsPerRide; i++) { - dst->vehicle_colours[i].Tertiary = src->VehicleColoursExtended[i]; + dst->vehicleColours[i].Tertiary = src->VehicleColoursExtended[i]; } dst->totalAirTime = src->TotalAirTime; - dst->current_test_station = StationIndex::FromUnderlying(src->CurrentTestStation); - dst->num_circuits = src->NumCircuits; - dst->CableLiftLoc = { src->CableLiftX, src->CableLiftY, src->CableLiftZ * kCoordsZStep }; + dst->currentTestStation = StationIndex::FromUnderlying(src->CurrentTestStation); + dst->numCircuits = src->NumCircuits; + dst->cableLiftLoc = { src->CableLiftX, src->CableLiftY, src->CableLiftZ * kCoordsZStep }; // Pad1FD; - dst->cable_lift = EntityId::FromUnderlying(src->CableLift); + dst->cableLift = EntityId::FromUnderlying(src->CableLift); // Pad208[0x58]; } @@ -1198,7 +1198,7 @@ namespace OpenRCT2::RCT2 } } } - dst->num_riders = numRiders; + dst->numRiders = numRiders; } void ImportTileElements(GameState_t& gameState) diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 19fc2634aa..4654c5c939 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -31,7 +31,7 @@ Vehicle* CableLiftSegmentCreate( current->ride_subtype = kObjectEntryIndexNull; if (head) { - ride.cable_lift = current->Id; + ride.cableLift = current->Id; } current->SubType = head ? Vehicle::Type::Head : Vehicle::Type::Tail; current->var_44 = var_44; @@ -69,7 +69,7 @@ Vehicle* CableLiftSegmentCreate( z = z * kCoordsZStep; current->TrackLocation = { x, y, z }; - z += ride.GetRideTypeDescriptor().Heights.VehicleZOffset; + z += ride.getRideTypeDescriptor().Heights.VehicleZOffset; current->MoveTo({ 16, 16, z }); current->SetTrackType(TrackElemType::CableLiftHill); diff --git a/src/openrct2/ride/MazeCost.cpp b/src/openrct2/ride/MazeCost.cpp index d7ae0c4cd9..ed2863aa08 100644 --- a/src/openrct2/ride/MazeCost.cpp +++ b/src/openrct2/ride/MazeCost.cpp @@ -23,11 +23,11 @@ namespace OpenRCT2 money64 MazeCalculateCost(money64 constructionCost, const Ride& ride, const CoordsXYZ& loc) { const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); - money64 price = (ride.GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.priceModifier) >> 16; + money64 price = (ride.getRideTypeDescriptor().BuildCosts.TrackPrice * ted.priceModifier) >> 16; auto surfaceElement = MapGetSurfaceElementAt(loc); auto heightDifference = (loc.z - surfaceElement->GetBaseZ()) / kCoordsZPerTinyZ; - money64 supportCost = heightDifference * ride.GetRideTypeDescriptor().BuildCosts.SupportPrice; + money64 supportCost = heightDifference * ride.getRideTypeDescriptor().BuildCosts.SupportPrice; return constructionCost + price + supportCost; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 0309ed29cb..0262c56f2f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -173,7 +173,7 @@ static void RideReset(Ride& ride) { ride.id = RideId::GetNull(); ride.type = kRideTypeNull; - ride.custom_name = {}; + ride.customName = {}; ride.measurement = {}; } @@ -249,7 +249,7 @@ std::string_view GetRideEntryName(ObjectEntryIndex index) return {}; } -const RideObjectEntry* Ride::GetRideEntry() const +const RideObjectEntry* Ride::getRideEntry() const { return GetRideEntryByIndex(subtype); } @@ -259,10 +259,10 @@ int32_t RideGetCount() return static_cast(GetRideManager().size()); } -size_t Ride::GetNumPrices() const +size_t Ride::getNumPrices() const { size_t result = 0; - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::cashMachine || rtd.specialType == RtdSpecialType::firstAid) { result = 0; @@ -275,10 +275,10 @@ size_t Ride::GetNumPrices() const { result = 1; - auto rideEntry = GetRideEntry(); + auto rideEntry = getRideEntry(); if (rideEntry != nullptr) { - if (lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) + if (lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) { result++; } @@ -291,12 +291,12 @@ size_t Ride::GetNumPrices() const return result; } -int32_t Ride::GetAge() const +int32_t Ride::getAge() const { - return GetDate().GetMonthsElapsed() - build_date; + return GetDate().GetMonthsElapsed() - buildDate; } -int32_t Ride::GetTotalQueueLength() const +int32_t Ride::getTotalQueueLength() const { int32_t queueLength = 0; for (const auto& station : stations) @@ -305,7 +305,7 @@ int32_t Ride::GetTotalQueueLength() const return queueLength; } -int32_t Ride::GetMaxQueueTime() const +int32_t Ride::getMaxQueueTime() const { uint8_t queueTime = 0; for (const auto& station : stations) @@ -314,11 +314,11 @@ int32_t Ride::GetMaxQueueTime() const return static_cast(queueTime); } -Guest* Ride::GetQueueHeadGuest(StationIndex stationIndex) const +Guest* Ride::getQueueHeadGuest(StationIndex stationIndex) const { Guest* peep; Guest* result = nullptr; - auto spriteIndex = GetStation(stationIndex).LastPeepInQueue; + auto spriteIndex = getStation(stationIndex).LastPeepInQueue; while ((peep = TryGetEntity(spriteIndex)) != nullptr) { spriteIndex = peep->GuestNextInQueue; @@ -327,11 +327,11 @@ Guest* Ride::GetQueueHeadGuest(StationIndex stationIndex) const return result; } -void Ride::UpdateQueueLength(StationIndex stationIndex) +void Ride::updateQueueLength(StationIndex stationIndex) { uint16_t count = 0; Guest* peep; - auto& station = GetStation(stationIndex); + auto& station = getStation(stationIndex); auto spriteIndex = station.LastPeepInQueue; while ((peep = TryGetEntity(spriteIndex)) != nullptr) { @@ -341,22 +341,22 @@ void Ride::UpdateQueueLength(StationIndex stationIndex) station.QueueLength = count; } -void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Guest* peep) +void Ride::queueInsertGuestAtFront(StationIndex stationIndex, Guest* peep) { assert(stationIndex.ToUnderlying() < OpenRCT2::Limits::kMaxStationsPerRide); assert(peep != nullptr); peep->GuestNextInQueue = EntityId::GetNull(); - auto* queueHeadGuest = GetQueueHeadGuest(peep->CurrentRideStation); + auto* queueHeadGuest = getQueueHeadGuest(peep->CurrentRideStation); if (queueHeadGuest == nullptr) { - GetStation(peep->CurrentRideStation).LastPeepInQueue = peep->Id; + getStation(peep->CurrentRideStation).LastPeepInQueue = peep->Id; } else { queueHeadGuest->GuestNextInQueue = peep->Id; } - UpdateQueueLength(peep->CurrentRideStation); + updateQueueLength(peep->CurrentRideStation); } /** @@ -366,7 +366,7 @@ void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Guest* peep) void RideUpdateFavouritedStat() { for (auto& ride : GetRideManager()) - ride.guests_favourite = 0; + ride.guestsFavourite = 0; for (auto peep : EntityList()) { @@ -375,8 +375,8 @@ void RideUpdateFavouritedStat() auto ride = GetRide(peep->FavouriteRide); if (ride != nullptr) { - ride->guests_favourite++; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + ride->guestsFavourite++; + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; } } } @@ -389,10 +389,10 @@ void RideUpdateFavouritedStat() * * rct2: 0x006AC3AB */ -money64 Ride::CalculateIncomePerHour() const +money64 Ride::calculateIncomePerHour() const { // Get entry by ride to provide better reporting - const auto* entry = GetRideEntry(); + const auto* entry = getRideEntry(); if (entry == nullptr) { return 0; @@ -406,8 +406,7 @@ money64 Ride::CalculateIncomePerHour() const priceMinusCost -= GetShopItemDescriptor(currentShopItem).Cost; } - currentShopItem = (lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? GetRideTypeDescriptor().PhotoItem - : entry->shop_item[1]; + currentShopItem = (lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? getRideTypeDescriptor().PhotoItem : entry->shop_item[1]; if (currentShopItem != ShopItem::None) { @@ -415,14 +414,14 @@ money64 Ride::CalculateIncomePerHour() const if (GetShopItemDescriptor(currentShopItem).IsPhoto()) { - const int32_t rideTicketsSold = total_customers - no_secondary_items_sold; + const int32_t rideTicketsSold = totalCustomers - numSecondaryItemsSold; // Use the ratio between photo sold and total admissions to approximate the photo income(as not every guest will buy // one). // TODO: use data from the last 5 minutes instead of all-time values for a more accurate calculation if (rideTicketsSold > 0) { - priceMinusCost += ((static_cast(no_secondary_items_sold) * shopItemProfit) / rideTicketsSold); + priceMinusCost += ((static_cast(numSecondaryItemsSold) * shopItemProfit) / rideTicketsSold); } } else @@ -755,12 +754,12 @@ bool TrackBlockGetPrevious(const CoordsXYE& trackPos, TrackBeginEnd* outTrackBeg * bx result y * esi input / output map element */ -bool Ride::FindTrackGap(const CoordsXYE& input, CoordsXYE* output) const +bool Ride::findTrackGap(const CoordsXYE& input, CoordsXYE* output) const { if (input.element == nullptr || input.element->GetType() != TileElementType::Track) return false; - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) return false; @@ -803,24 +802,24 @@ bool Ride::FindTrackGap(const CoordsXYE& input, CoordsXYE* output) const return false; } -void Ride::FormatStatusTo(Formatter& ft) const +void Ride::formatStatusTo(Formatter& ft) const { - if (lifecycle_flags & RIDE_LIFECYCLE_CRASHED) + if (lifecycleFlags & RIDE_LIFECYCLE_CRASHED) { ft.Add(STR_CRASHED); } - else if (lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + else if (lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { ft.Add(STR_BROKEN_DOWN); } else if (status == RideStatus::closed) { - if (!GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (!getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { - if (num_riders != 0) + if (numRiders != 0) { - ft.Add(num_riders == 1 ? STR_CLOSED_WITH_PERSON : STR_CLOSED_WITH_PEOPLE); - ft.Add(num_riders); + ft.Add(numRiders == 1 ? STR_CLOSED_WITH_PERSON : STR_CLOSED_WITH_PEOPLE); + ft.Add(numRiders); } else { @@ -840,9 +839,9 @@ void Ride::FormatStatusTo(Formatter& ft) const { ft.Add(STR_TEST_RUN); } - else if (mode == RideMode::race && !(lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && !race_winner.IsNull()) + else if (mode == RideMode::race && !(lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && !raceWinner.IsNull()) { - auto peep = GetEntity(race_winner); + auto peep = GetEntity(raceWinner); if (peep != nullptr) { ft.Add(STR_RACE_WON_BY); @@ -854,10 +853,10 @@ void Ride::FormatStatusTo(Formatter& ft) const ft.Add(kStringIdNone); } } - else if (!GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + else if (!getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) { - ft.Add(num_riders == 1 ? STR_PERSON_ON_RIDE : STR_PEOPLE_ON_RIDE); - ft.Add(num_riders); + ft.Add(numRiders == 1 ? STR_PERSON_ON_RIDE : STR_PEOPLE_ON_RIDE); + ft.Add(numRiders); } else { @@ -865,25 +864,25 @@ void Ride::FormatStatusTo(Formatter& ft) const } } -int32_t Ride::GetTotalLength() const +int32_t Ride::getTotalLength() const { int32_t i, totalLength = 0; - for (i = 0; i < num_stations; i++) + for (i = 0; i < numStations; i++) totalLength += stations[i].SegmentLength; return totalLength; } -int32_t Ride::GetTotalTime() const +int32_t Ride::getTotalTime() const { int32_t i, totalTime = 0; - for (i = 0; i < num_stations; i++) + for (i = 0; i < numStations; i++) totalTime += stations[i].SegmentTime; return totalTime; } -bool Ride::CanHaveMultipleCircuits() const +bool Ride::canHaveMultipleCircuits() const { - if (!(GetRideTypeDescriptor().HasFlag(RtdFlag::allowMultipleCircuits))) + if (!(getRideTypeDescriptor().HasFlag(RtdFlag::allowMultipleCircuits))) return false; // Only allow circuit or launch modes @@ -894,15 +893,15 @@ bool Ride::CanHaveMultipleCircuits() const } // Must have no more than one vehicle and one station - if (NumTrains > 1 || num_stations > 1) + if (numTrains > 1 || numStations > 1) return false; return true; } -bool Ride::SupportsStatus(RideStatus s) const +bool Ride::supportsStatus(RideStatus s) const { - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); switch (s) { @@ -941,7 +940,7 @@ void ResetAllRideBuildDates() { for (auto& ride : GetRideManager()) { - ride.build_date -= GetDate().GetMonthsElapsed(); + ride.buildDate -= GetDate().GetMonthsElapsed(); } } @@ -957,7 +956,7 @@ void ResetAllRideBuildDates() * * rct2: 0x006ABE4C */ -void Ride::UpdateAll() +void Ride::updateAll() { PROFILED_FUNCTION(); @@ -970,7 +969,7 @@ void Ride::UpdateAll() case EditorStep::LandscapeEditor: case EditorStep::InventionsListSetUp: for (auto& ride : GetRideManager()) - ride.Delete(); + ride.remove(); break; case EditorStep::OptionsSelection: case EditorStep::ObjectiveSelection: @@ -987,14 +986,14 @@ void Ride::UpdateAll() // Update rides for (auto& ride : GetRideManager()) - ride.Update(); + ride.update(); OpenRCT2::RideAudio::UpdateMusicChannels(); } -std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) const +std::unique_ptr Ride::saveToTrackDesign(TrackDesignState& tds) const { - if (!(lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (!(lifecycleFlags & RIDE_LIFECYCLE_TESTED)) { ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return nullptr; @@ -1021,12 +1020,12 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons return td; } -RideStation& Ride::GetStation(StationIndex stationIndex) +RideStation& Ride::getStation(StationIndex stationIndex) { return stations[stationIndex.ToUnderlying()]; } -StationIndex::UnderlyingType Ride::GetStationNumber(StationIndex in) const +StationIndex::UnderlyingType Ride::getStationNumber(StationIndex in) const { StationIndex::UnderlyingType nullStationsSeen{ 0 }; for (size_t i = 0; i < in.ToUnderlying(); i++) @@ -1040,22 +1039,22 @@ StationIndex::UnderlyingType Ride::GetStationNumber(StationIndex in) const return in.ToUnderlying() - nullStationsSeen + 1; } -const RideStation& Ride::GetStation(StationIndex stationIndex) const +const RideStation& Ride::getStation(StationIndex stationIndex) const { return stations[stationIndex.ToUnderlying()]; } -std::span Ride::GetStations() +std::span Ride::getStations() { return stations; } -std::span Ride::GetStations() const +std::span Ride::getStations() const { return stations; } -StationIndex Ride::GetStationIndex(const RideStation* station) const +StationIndex Ride::getStationIndex(const RideStation* station) const { auto distance = std::distance(stations.data(), station); Guard::Assert(distance >= 0 && distance < int32_t(std::size(stations))); @@ -1066,42 +1065,42 @@ StationIndex Ride::GetStationIndex(const RideStation* station) const * * rct2: 0x006ABE73 */ -void Ride::Update() +void Ride::update() { - if (vehicle_change_timeout != 0) - vehicle_change_timeout--; + if (vehicleChangeTimeout != 0) + vehicleChangeTimeout--; RideMusicUpdate(*this); // Update stations - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++) RideUpdateStation(*this, StationIndex::FromUnderlying(i)); // Update financial statistics - num_customers_timeout++; + numCustomersTimeout++; - if (num_customers_timeout >= 960) + if (numCustomersTimeout >= 960) { // This is meant to update about every 30 seconds - num_customers_timeout = 0; + numCustomersTimeout = 0; // Shift number of customers history, start of the array is the most recent one for (int32_t i = OpenRCT2::Limits::kCustomerHistorySize - 1; i > 0; i--) { - num_customers[i] = num_customers[i - 1]; + numCustomers[i] = numCustomers[i - 1]; } - num_customers[0] = cur_num_customers; + numCustomers[0] = curNumCustomers; - cur_num_customers = 0; - window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + curNumCustomers = 0; + windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; - income_per_hour = CalculateIncomePerHour(); - window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; + incomePerHour = calculateIncomePerHour(); + windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; - if (upkeep_cost != kMoney64Undefined) - profit = income_per_hour - (upkeep_cost * 16); + if (upkeepCost != kMoney64Undefined) + profit = incomePerHour - (upkeepCost * 16); } // Ride specific updates @@ -1111,7 +1110,7 @@ void Ride::Update() RideBreakdownUpdate(*this); // Various things include news messages - if (lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION)) + if (lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION)) { // Breakdown updates originally were performed when (id == (gCurrentTicks / 2) & 0xFF) // with the increased MAX_RIDES the update is tied to the first byte of the id this allows @@ -1124,7 +1123,7 @@ void Ride::Update() RideInspectionUpdate(*this); // If ride is simulating but crashed, reset the vehicles - if (status == RideStatus::simulating && (lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (status == RideStatus::simulating && (lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { if (mode == RideMode::continuousCircuitBlockSectioned || mode == RideMode::poweredLaunchBlockSectioned) { @@ -1145,23 +1144,23 @@ void Ride::Update() * * rct2: 0x006AC489 */ -void UpdateChairlift(Ride& ride) +void updateChairlift(Ride& ride) { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) return; - if ((ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) - && ride.breakdown_reason_pending == 0) + if ((ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + && ride.breakdownReasonPending == 0) return; - uint16_t old_chairlift_bullwheel_rotation = ride.chairlift_bullwheel_rotation >> 14; - ride.chairlift_bullwheel_rotation += ride.speed * 2048; - if (old_chairlift_bullwheel_rotation == ride.speed / 8) + uint16_t oldChairliftBullwheelRotation = ride.chairliftBullwheelRotation >> 14; + ride.chairliftBullwheelRotation += ride.speed * 2048; + if (oldChairliftBullwheelRotation == ride.speed / 8) return; - auto bullwheelLoc = ride.ChairliftBullwheelLocation[0].ToCoordsXYZ(); + auto bullwheelLoc = ride.chairliftBullwheelLocation[0].ToCoordsXYZ(); MapInvalidateTileZoom1({ bullwheelLoc, bullwheelLoc.z, bullwheelLoc.z + (4 * kCoordsZStep) }); - bullwheelLoc = ride.ChairliftBullwheelLocation[1].ToCoordsXYZ(); + bullwheelLoc = ride.chairliftBullwheelLocation[1].ToCoordsXYZ(); MapInvalidateTileZoom1({ bullwheelLoc, bullwheelLoc.z, bullwheelLoc.z + (4 * kCoordsZStep) }); } @@ -1171,16 +1170,16 @@ void UpdateChairlift(Ride& ride) * edi: ride (in code as bytes offset from start of rides list) * bl: happiness */ -void Ride::UpdateSatisfaction(const uint8_t happiness) +void Ride::updateSatisfaction(const uint8_t happiness) { - satisfaction_next += happiness; - satisfaction_time_out++; - if (satisfaction_time_out >= 20) + satisfactionNext += happiness; + satisfactionTimeout++; + if (satisfactionTimeout >= 20) { - satisfaction = satisfaction_next >> 2; - satisfaction_next = 0; - satisfaction_time_out = 0; - window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + satisfaction = satisfactionNext >> 2; + satisfactionNext = 0; + satisfactionTimeout = 0; + windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; } } @@ -1192,17 +1191,17 @@ void Ride::UpdateSatisfaction(const uint8_t happiness) * bl : pop_amount * pop_amount can be zero if peep visited but did not purchase. */ -void Ride::UpdatePopularity(const uint8_t pop_amount) +void Ride::updatePopularity(const uint8_t pop_amount) { - popularity_next += pop_amount; - popularity_time_out++; - if (popularity_time_out < 25) + popularityNext += pop_amount; + popularityTimeout++; + if (popularityTimeout < 25) return; - popularity = popularity_next; - popularity_next = 0; - popularity_time_out = 0; - window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER; + popularity = popularityNext; + popularityNext = 0; + popularityTimeout = 0; + windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_CUSTOMER; } /** rct2: 0x0098DDB8, 0x0098DDBA */ @@ -1238,19 +1237,19 @@ static constexpr CoordsXY ride_spiral_slide_main_tile_offset[][4] = { * rct2: 0x006AC545 */ -void UpdateSpiralSlide(Ride& ride) +void updateSpiralSlide(Ride& ride) { if (GetGameState().CurrentTicks & 3) return; - if (ride.slide_in_use == 0) + if (ride.slideInUse == 0) return; - ride.spiral_slide_progress++; - if (ride.spiral_slide_progress >= 48) + ride.spiralSlideProgress++; + if (ride.spiralSlideProgress >= 48) { - ride.slide_in_use--; + ride.slideInUse--; - auto* peep = GetEntity(ride.slide_peep); + auto* peep = GetEntity(ride.slidePeep); if (peep != nullptr) { auto destination = peep->GetDestination(); @@ -1305,57 +1304,57 @@ static void RideInspectionUpdate(Ride& ride) if (gLegacyScene == LegacyScene::trackDesigner) return; - ride.last_inspection++; - if (ride.last_inspection == 0) - ride.last_inspection--; + ride.lastInspection++; + if (ride.lastInspection == 0) + ride.lastInspection--; - int32_t inspectionIntervalMinutes = RideInspectionInterval[ride.inspection_interval]; + int32_t inspectionIntervalMinutes = RideInspectionInterval[ride.inspectionInterval]; // An inspection interval of 0 minutes means the ride is set to never be inspected. if (inspectionIntervalMinutes == 0) { - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; return; } - if (ride.GetRideTypeDescriptor().AvailableBreakdowns == 0) + if (ride.getRideTypeDescriptor().AvailableBreakdowns == 0) return; - if (inspectionIntervalMinutes > ride.last_inspection) + if (inspectionIntervalMinutes > ride.lastInspection) return; - if (ride.lifecycle_flags + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION | RIDE_LIFECYCLE_CRASHED)) return; // Inspect the first station that has an exit - ride.lifecycle_flags |= RIDE_LIFECYCLE_DUE_INSPECTION; - ride.mechanic_status = RIDE_MECHANIC_STATUS_CALLING; + ride.lifecycleFlags |= RIDE_LIFECYCLE_DUE_INSPECTION; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; auto stationIndex = RideGetFirstValidStationExit(ride); - ride.inspection_station = (!stationIndex.IsNull()) ? stationIndex : StationIndex::FromUnderlying(0); + ride.inspectionStation = (!stationIndex.IsNull()) ? stationIndex : StationIndex::FromUnderlying(0); } -static int32_t GetAgePenalty(const Ride& ride) +static int32_t getAgePenalty(const Ride& ride) { - auto years = DateGetYear(ride.GetAge()); + auto years = DateGetYear(ride.getAge()); switch (years) { case 0: return 0; case 1: - return ride.unreliability_factor / 8; + return ride.unreliabilityFactor / 8; case 2: - return ride.unreliability_factor / 4; + return ride.unreliabilityFactor / 4; case 3: case 4: - return ride.unreliability_factor / 2; + return ride.unreliabilityFactor / 2; case 5: case 6: case 7: - return ride.unreliability_factor; + return ride.unreliabilityFactor; default: - return ride.unreliability_factor * 2; + return ride.unreliabilityFactor * 2; } } @@ -1373,8 +1372,8 @@ static void RideBreakdownUpdate(Ride& ride) if (gLegacyScene == LegacyScene::trackDesigner) return; - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) - ride.downtime_history[0]++; + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + ride.downtimeHistory[0]++; if (!(currentTicks & 8191)) { @@ -1382,35 +1381,35 @@ static void RideBreakdownUpdate(Ride& ride) for (int32_t i = 0; i < OpenRCT2::Limits::kDowntimeHistorySize; i++) { - totalDowntime += ride.downtime_history[i]; + totalDowntime += ride.downtimeHistory[i]; } ride.downtime = std::min(totalDowntime / 2, 100); for (int32_t i = OpenRCT2::Limits::kDowntimeHistorySize - 1; i > 0; i--) { - ride.downtime_history[i] = ride.downtime_history[i - 1]; + ride.downtimeHistory[i] = ride.downtimeHistory[i - 1]; } - ride.downtime_history[0] = 0; + ride.downtimeHistory[0] = 0; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; } - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) return; if (ride.status == RideStatus::closed || ride.status == RideStatus::simulating) return; - if (!ride.CanBreakDown()) + if (!ride.canBreakDown()) { ride.reliability = kRideInitialReliability; return; } // Calculate breakdown probability? - int32_t unreliabilityAccumulator = ride.unreliability_factor + GetAgePenalty(ride); + int32_t unreliabilityAccumulator = ride.unreliabilityFactor + getAgePenalty(ride); ride.reliability = static_cast(std::max(0, (ride.reliability - unreliabilityAccumulator))); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; // Random probability of a breakdown. Roughly this is 1 in // @@ -1437,10 +1436,10 @@ static int32_t RideGetNewBreakdownProblem(const Ride& ride) // Brake failure is more likely when it's raining or heavily snowing (HeavySnow and Blizzard) _breakdownProblemProbabilities[BREAKDOWN_BRAKES_FAILURE] = (ClimateIsRaining() || ClimateIsSnowingHeavily()) ? 20 : 3; - if (!ride.CanBreakDown()) + if (!ride.canBreakDown()) return -1; - int32_t availableBreakdownProblems = ride.GetRideTypeDescriptor().AvailableBreakdowns; + int32_t availableBreakdownProblems = ride.getRideTypeDescriptor().AvailableBreakdowns; // Calculate the total probability range for all possible breakdown problems int32_t totalProbability = 0; @@ -1473,45 +1472,45 @@ static int32_t RideGetNewBreakdownProblem(const Ride& ride) // Brakes failure can not happen if block brakes are used (so long as there is more than one vehicle) // However if this is the case, brake failure should be taken out the equation, otherwise block brake // rides have a lower probability to break down due to a random implementation reason. - if (ride.IsBlockSectioned()) - if (ride.NumTrains != 1) + if (ride.isBlockSectioned()) + if (ride.numTrains != 1) return -1; // If brakes failure is disabled, also take it out of the equation (see above comment why) if (GetGameState().Cheats.disableBrakesFailure) return -1; - auto monthsOld = ride.GetAge(); - if (monthsOld < 16 || ride.reliability_percentage > 50) + auto monthsOld = ride.getAge(); + if (monthsOld < 16 || ride.reliabilityPercentage > 50) return -1; return BREAKDOWN_BRAKES_FAILURE; } -bool Ride::CanBreakDown() const +bool Ride::canBreakDown() const { - if (GetRideTypeDescriptor().AvailableBreakdowns == 0) + if (getRideTypeDescriptor().AvailableBreakdowns == 0) { return false; } - const auto* entry = GetRideEntry(); + const auto* entry = getRideEntry(); return entry != nullptr && !(entry->flags & RIDE_ENTRY_FLAG_CANNOT_BREAK_DOWN); } static void ChooseRandomTrainToBreakdownSafe(Ride& ride) { // Prevent integer division by zero in case of hacked ride. - if (ride.NumTrains == 0) + if (ride.numTrains == 0) return; - ride.broken_vehicle = ScenarioRand() % ride.NumTrains; + ride.brokenTrain = ScenarioRand() % ride.numTrains; // Prevent crash caused by accessing SPRITE_INDEX_NULL on hacked rides. // This should probably be cleaned up on import instead. - while (ride.vehicles[ride.broken_vehicle].IsNull() && ride.broken_vehicle != 0) + while (ride.vehicles[ride.brokenTrain].IsNull() && ride.brokenTrain != 0) { - --ride.broken_vehicle; + --ride.brokenTrain; } } @@ -1524,15 +1523,15 @@ void RidePrepareBreakdown(Ride& ride, int32_t breakdownReason) StationIndex i; Vehicle* vehicle; - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) return; - ride.lifecycle_flags |= RIDE_LIFECYCLE_BREAKDOWN_PENDING; + ride.lifecycleFlags |= RIDE_LIFECYCLE_BREAKDOWN_PENDING; - ride.breakdown_reason_pending = breakdownReason; - ride.breakdown_sound_modifier = 0; - ride.not_fixed_timeout = 0; - ride.inspection_station = StationIndex::FromUnderlying(0); // ensure set to something. + ride.breakdownReasonPending = breakdownReason; + ride.breakdownSoundModifier = 0; + ride.notFixedTimeout = 0; + ride.inspectionStation = StationIndex::FromUnderlying(0); // ensure set to something. switch (breakdownReason) { @@ -1542,7 +1541,7 @@ void RidePrepareBreakdown(Ride& ride, int32_t breakdownReason) i = RideGetFirstValidStationExit(ride); if (!i.IsNull()) { - ride.inspection_station = i; + ride.inspectionStation = i; } break; @@ -1552,15 +1551,15 @@ void RidePrepareBreakdown(Ride& ride, int32_t breakdownReason) case BREAKDOWN_DOORS_STUCK_OPEN: // Choose a random train and car ChooseRandomTrainToBreakdownSafe(ride); - if (ride.num_cars_per_train != 0) + if (ride.numCarsPerTrain != 0) { - ride.broken_car = ScenarioRand() % ride.num_cars_per_train; + ride.brokenCar = ScenarioRand() % ride.numCarsPerTrain; // Set flag on broken car - vehicle = GetEntity(ride.vehicles[ride.broken_vehicle]); + vehicle = GetEntity(ride.vehicles[ride.brokenTrain]); if (vehicle != nullptr) { - vehicle = vehicle->GetCar(ride.broken_car); + vehicle = vehicle->GetCar(ride.brokenCar); } if (vehicle != nullptr) { @@ -1571,10 +1570,10 @@ void RidePrepareBreakdown(Ride& ride, int32_t breakdownReason) case BREAKDOWN_VEHICLE_MALFUNCTION: // Choose a random train ChooseRandomTrainToBreakdownSafe(ride); - ride.broken_car = 0; + ride.brokenCar = 0; // Set flag on broken train, first car - vehicle = GetEntity(ride.vehicles[ride.broken_vehicle]); + vehicle = GetEntity(ride.vehicles[ride.brokenTrain]); if (vehicle != nullptr) { vehicle->SetFlag(VehicleFlags::TrainIsBroken); @@ -1586,7 +1585,7 @@ void RidePrepareBreakdown(Ride& ride, int32_t breakdownReason) i = RideGetFirstValidStationExit(ride); if (!i.IsNull()) { - ride.inspection_station = i; + ride.inspectionStation = i; } break; } @@ -1601,7 +1600,7 @@ void RideBreakdownAddNewsItem(const Ride& ride) if (Config::Get().notifications.RideBrokenDown) { Formatter ft; - ride.FormatNameTo(ft); + ride.formatNameTo(ft); News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_BROKEN_DOWN, ride.id.ToUnderlying(), ft); } } @@ -1613,28 +1612,28 @@ void RideBreakdownAddNewsItem(const Ride& ride) static void RideBreakdownStatusUpdate(Ride& ride) { // Warn player if ride hasn't been fixed for ages - if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - ride.not_fixed_timeout++; + ride.notFixedTimeout++; // When there has been a full 255 timeout ticks this // will force timeout ticks to keep issuing news every // 16 ticks. Note there is no reason to do this. - if (ride.not_fixed_timeout == 0) - ride.not_fixed_timeout -= 16; + if (ride.notFixedTimeout == 0) + ride.notFixedTimeout -= 16; - if (!(ride.not_fixed_timeout & 15) && ride.mechanic_status != RIDE_MECHANIC_STATUS_FIXING - && ride.mechanic_status != RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) + if (!(ride.notFixedTimeout & 15) && ride.mechanicStatus != RIDE_MECHANIC_STATUS_FIXING + && ride.mechanicStatus != RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { if (Config::Get().notifications.RideWarnings) { Formatter ft; - ride.FormatNameTo(ft); + ride.formatNameTo(ft); News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_STILL_NOT_FIXED, ride.id.ToUnderlying(), ft); } } } - RideMechanicStatusUpdate(ride, ride.mechanic_status); + RideMechanicStatusUpdate(ride, ride.mechanicStatus); } /** @@ -1646,31 +1645,31 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) // Turn a pending breakdown into a breakdown. if ((mechanicStatus == RIDE_MECHANIC_STATUS_UNDEFINED || mechanicStatus == RIDE_MECHANIC_STATUS_CALLING || mechanicStatus == RIDE_MECHANIC_STATUS_HEADING) - && (ride.lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING) && !(ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + && (ride.lifecycleFlags & RIDE_LIFECYCLE_BREAKDOWN_PENDING) && !(ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { - auto breakdownReason = ride.breakdown_reason_pending; + auto breakdownReason = ride.breakdownReasonPending; if (breakdownReason == BREAKDOWN_SAFETY_CUT_OUT || breakdownReason == BREAKDOWN_BRAKES_FAILURE || breakdownReason == BREAKDOWN_CONTROL_FAILURE) { - ride.lifecycle_flags |= RIDE_LIFECYCLE_BROKEN_DOWN; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_LIST + ride.lifecycleFlags |= RIDE_LIFECYCLE_BROKEN_DOWN; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAIN; - ride.breakdown_reason = breakdownReason; + ride.breakdownReason = breakdownReason; RideBreakdownAddNewsItem(ride); } } switch (mechanicStatus) { case RIDE_MECHANIC_STATUS_UNDEFINED: - if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - ride.mechanic_status = RIDE_MECHANIC_STATUS_CALLING; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; } break; case RIDE_MECHANIC_STATUS_CALLING: - if (ride.GetRideTypeDescriptor().AvailableBreakdowns == 0) + if (ride.getRideTypeDescriptor().AvailableBreakdowns == 0) { - ride.lifecycle_flags &= ~( + ride.lifecycleFlags &= ~( RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION); break; } @@ -1680,13 +1679,13 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) case RIDE_MECHANIC_STATUS_HEADING: { auto mechanic = RideGetMechanic(ride); - bool rideNeedsRepair = (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)); + bool rideNeedsRepair = (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)); if (mechanic == nullptr || (mechanic->State != PeepState::HeadingToInspection && mechanic->State != PeepState::Answering) || mechanic->CurrentRide != ride.id) { - ride.mechanic_status = RIDE_MECHANIC_STATUS_CALLING; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; RideMechanicStatusUpdate(ride, RIDE_MECHANIC_STATUS_CALLING); } // if the ride is broken down, but a mechanic was heading for an inspection, update orders to fix @@ -1705,8 +1704,8 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) || (mechanic->State != PeepState::HeadingToInspection && mechanic->State != PeepState::Fixing && mechanic->State != PeepState::Inspecting && mechanic->State != PeepState::Answering)) { - ride.mechanic_status = RIDE_MECHANIC_STATUS_CALLING; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; RideMechanicStatusUpdate(ride, RIDE_MECHANIC_STATUS_CALLING); } break; @@ -1722,11 +1721,11 @@ static void RideCallMechanic(Ride& ride, Peep* mechanic, int32_t forInspection) { mechanic->SetState(forInspection ? PeepState::HeadingToInspection : PeepState::Answering); mechanic->SubState = 0; - ride.mechanic_status = RIDE_MECHANIC_STATUS_HEADING; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.mechanicStatus = RIDE_MECHANIC_STATUS_HEADING; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; ride.mechanic = mechanic->Id; mechanic->CurrentRide = ride.id; - mechanic->CurrentRideStation = ride.inspection_station; + mechanic->CurrentRideStation = ride.inspectionStation; } /** @@ -1735,7 +1734,7 @@ static void RideCallMechanic(Ride& ride, Peep* mechanic, int32_t forInspection) */ static void RideCallClosestMechanic(Ride& ride) { - auto forInspection = (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) == 0; + auto forInspection = (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) == 0; auto mechanic = RideFindClosestMechanic(ride, forInspection); if (mechanic != nullptr) RideCallMechanic(ride, mechanic, forInspection); @@ -1744,7 +1743,7 @@ static void RideCallClosestMechanic(Ride& ride) Staff* RideFindClosestMechanic(const Ride& ride, int32_t forInspection) { // Get either exit position or entrance position if there is no exit - auto& station = ride.GetStation(ride.inspection_station); + auto& station = ride.getStation(ride.inspectionStation); TileCoordsXYZD location = station.Exit; if (location.IsNull()) { @@ -1831,10 +1830,10 @@ Staff* RideGetMechanic(const Ride& ride) Staff* RideGetAssignedMechanic(const Ride& ride) { - if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - if (ride.mechanic_status == RIDE_MECHANIC_STATUS_HEADING || ride.mechanic_status == RIDE_MECHANIC_STATUS_FIXING - || ride.mechanic_status == RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) + if (ride.mechanicStatus == RIDE_MECHANIC_STATUS_HEADING || ride.mechanicStatus == RIDE_MECHANIC_STATUS_FIXING + || ride.mechanicStatus == RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { return RideGetMechanic(ride); } @@ -1856,10 +1855,10 @@ static int32_t RideMusicSampleRate(const Ride& ride) int32_t sampleRate = 22050; // Alter sample rate for a power cut effect - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) { - sampleRate = ride.breakdown_sound_modifier * 70; - if (ride.breakdown_reason_pending != BREAKDOWN_CONTROL_FAILURE) + sampleRate = ride.breakdownSoundModifier * 70; + if (ride.breakdownReasonPending != BREAKDOWN_CONTROL_FAILURE) sampleRate *= -1; sampleRate += 22050; } @@ -1874,26 +1873,26 @@ static int32_t RideMusicSampleRate(const Ride& ride) static bool RideMusicBreakdownEffect(Ride& ride) { // Oscillate parameters for a power cut effect when breaking down - if (ride.lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) + if (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) { - if (ride.breakdown_reason_pending == BREAKDOWN_CONTROL_FAILURE) + if (ride.breakdownReasonPending == BREAKDOWN_CONTROL_FAILURE) { if (!(GetGameState().CurrentTicks & 7)) - if (ride.breakdown_sound_modifier != 255) - ride.breakdown_sound_modifier++; + if (ride.breakdownSoundModifier != 255) + ride.breakdownSoundModifier++; } else { - if ((ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) || ride.breakdown_reason_pending == BREAKDOWN_BRAKES_FAILURE - || ride.breakdown_reason_pending == BREAKDOWN_CONTROL_FAILURE) + if ((ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) || ride.breakdownReasonPending == BREAKDOWN_BRAKES_FAILURE + || ride.breakdownReasonPending == BREAKDOWN_CONTROL_FAILURE) { - if (ride.breakdown_sound_modifier != 255) - ride.breakdown_sound_modifier++; + if (ride.breakdownSoundModifier != 255) + ride.breakdownSoundModifier++; } - if (ride.breakdown_sound_modifier == 255) + if (ride.breakdownSoundModifier == 255) { - ride.music_tune_id = kTuneIDNull; + ride.musicTuneId = kTuneIDNull; return true; } } @@ -1910,8 +1909,8 @@ void CircusMusicUpdate(Ride& ride) Vehicle* vehicle = GetEntity(ride.vehicles[0]); if (vehicle == nullptr || vehicle->status != Vehicle::Status::DoingCircusShow) { - ride.music_position = 0; - ride.music_tune_id = kTuneIDNull; + ride.musicPosition = 0; + ride.musicTuneId = kTuneIDNull; return; } @@ -1920,7 +1919,7 @@ void CircusMusicUpdate(Ride& ride) return; } - CoordsXYZ rideCoords = ride.GetStation().GetStart().ToTileCentre(); + CoordsXYZ rideCoords = ride.getStation().GetStart().ToTileCentre(); const auto sampleRate = RideMusicSampleRate(ride); @@ -1933,9 +1932,9 @@ void CircusMusicUpdate(Ride& ride) */ void DefaultMusicUpdate(Ride& ride) { - if (ride.status != RideStatus::open || !(ride.lifecycle_flags & RIDE_LIFECYCLE_MUSIC)) + if (ride.status != RideStatus::open || !(ride.lifecycleFlags & RIDE_LIFECYCLE_MUSIC)) { - ride.music_tune_id = kTuneIDNull; + ride.musicTuneId = kTuneIDNull; return; } @@ -1945,20 +1944,20 @@ void DefaultMusicUpdate(Ride& ride) } // Select random tune from available tunes for a music style (of course only merry-go-rounds have more than one tune) - if (ride.music_tune_id == kTuneIDNull) + if (ride.musicTuneId == kTuneIDNull) { auto& objManager = GetContext()->GetObjectManager(); auto musicObj = objManager.GetLoadedObject(ride.music); if (musicObj != nullptr) { auto numTracks = musicObj->GetTrackCount(); - ride.music_tune_id = static_cast(UtilRand() % numTracks); - ride.music_position = 0; + ride.musicTuneId = static_cast(UtilRand() % numTracks); + ride.musicPosition = 0; } return; } - CoordsXYZ rideCoords = ride.GetStation().GetStart().ToTileCentre(); + CoordsXYZ rideCoords = ride.getStation().GetStart().ToTileCentre(); int32_t sampleRate = RideMusicSampleRate(ride); @@ -1967,7 +1966,7 @@ void DefaultMusicUpdate(Ride& ride) static void RideMusicUpdate(Ride& ride) { - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (!rtd.HasFlag(RtdFlag::hasMusicByDefault) && !rtd.HasFlag(RtdFlag::allowMusic)) return; @@ -2070,7 +2069,7 @@ void RideMeasurementsUpdate() for (auto& ride : GetRideManager()) { auto measurement = ride.measurement.get(); - if (measurement != nullptr && (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) && ride.status != RideStatus::simulating) + if (measurement != nullptr && (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) && ride.status != RideStatus::simulating) { if (measurement->flags & RIDE_MEASUREMENT_FLAG_RUNNING) { @@ -2079,7 +2078,7 @@ void RideMeasurementsUpdate() else { // For each vehicle - for (int32_t j = 0; j < ride.NumTrains; j++) + for (int32_t j = 0; j < ride.numTrains; j++) { auto vehicleSpriteIdx = ride.vehicles[j]; auto vehicle = GetEntity(vehicleSpriteIdx); @@ -2131,9 +2130,9 @@ static void RideFreeOldMeasurements() } while (numRideMeasurements > kMaxRideMeasurements); } -std::pair Ride::GetMeasurement() +std::pair Ride::getMeasurement() { - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); // Check if ride type supports data logging if (!rtd.HasFlag(RtdFlag::hasDataLogging)) @@ -2172,8 +2171,8 @@ std::pair Ride::GetMeasurement() VehicleColour RideGetVehicleColour(const Ride& ride, int32_t vehicleIndex) { // Prevent indexing array out of bounds - vehicleIndex = std::min(vehicleIndex, static_cast(std::size(ride.vehicle_colours))); - return ride.vehicle_colours[vehicleIndex]; + vehicleIndex = std::min(vehicleIndex, static_cast(std::size(ride.vehicleColours))); + return ride.vehicleColours[vehicleIndex]; } static bool RideTypeVehicleColourExists(ObjectEntryIndex subType, const VehicleColour& vehicleColour) @@ -2182,7 +2181,7 @@ static bool RideTypeVehicleColourExists(ObjectEntryIndex subType, const VehicleC { if (ride.subtype != subType) continue; - if (ride.vehicle_colours[0].Body != vehicleColour.Body) + if (ride.vehicleColours[0].Body != vehicleColour.Body) continue; return true; } @@ -2236,7 +2235,7 @@ void RideSetVehicleColoursToRandomPreset(Ride& ride, uint8_t preset_index) assert(preset_index < presetList->count); ride.vehicleColourSettings = VehicleColourSettings::same; - ride.vehicle_colours[0] = presetList->list[preset_index]; + ride.vehicleColours[0] = presetList->list[preset_index]; } else { @@ -2244,7 +2243,7 @@ void RideSetVehicleColoursToRandomPreset(Ride& ride, uint8_t preset_index) for (uint32_t i = 0; i < presetList->count; i++) { const auto index = i % 32u; - ride.vehicle_colours[i] = presetList->list[index]; + ride.vehicleColours[i] = presetList->list[index]; } } } @@ -2261,13 +2260,13 @@ void RideCheckAllReachable() { for (auto& ride : GetRideManager()) { - if (ride.connected_message_throttle != 0) - ride.connected_message_throttle--; + if (ride.connectedMessageThrottle != 0) + ride.connectedMessageThrottle--; - if (ride.status != RideStatus::open || ride.connected_message_throttle != 0) + if (ride.status != RideStatus::open || ride.connectedMessageThrottle != 0) continue; - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) RideShopConnected(ride); else RideEntranceExitConnected(ride); @@ -2292,7 +2291,7 @@ static bool RideEntranceExitIsReachable(const TileCoordsXYZD& coordinates) static void RideEntranceExitConnected(Ride& ride) { - for (auto& station : ride.GetStations()) + for (auto& station : ride.getStations()) { auto station_start = station.Start; auto entrance = station.Entrance; @@ -2305,31 +2304,31 @@ static void RideEntranceExitConnected(Ride& ride) { // name of ride is parameter of the format string Formatter ft; - ride.FormatNameTo(ft); + ride.formatNameTo(ft); if (Config::Get().notifications.RideWarnings) { News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, ride.id.ToUnderlying(), ft); } - ride.connected_message_throttle = 3; + ride.connectedMessageThrottle = 3; } if (!exit.IsNull() && !RideEntranceExitIsReachable(exit)) { // name of ride is parameter of the format string Formatter ft; - ride.FormatNameTo(ft); + ride.formatNameTo(ft); if (Config::Get().notifications.RideWarnings) { News::AddItemToQueue(News::ItemType::Ride, STR_EXIT_NOT_CONNECTED, ride.id.ToUnderlying(), ft); } - ride.connected_message_throttle = 3; + ride.connectedMessageThrottle = 3; } } } static void RideShopConnected(const Ride& ride) { - auto shopLoc = TileCoordsXY(ride.GetStation().Start); + auto shopLoc = TileCoordsXY(ride.getStation().Start); if (shopLoc.IsNull()) return; @@ -2386,11 +2385,11 @@ static void RideShopConnected(const Ride& ride) if (Config::Get().notifications.RideWarnings) { Formatter ft; - ride2->FormatNameTo(ft); + ride2->formatNameTo(ft); News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, ride2->id.ToUnderlying(), ft); } - ride2->connected_message_throttle = 3; + ride2->connectedMessageThrottle = 3; } #pragma endregion @@ -2405,8 +2404,8 @@ static void RideTrackSetMapTooltip(const TrackElement& trackElement) { auto ft = Formatter(); ft.Add(STR_RIDE_MAP_TIP); - ride->FormatNameTo(ft); - ride->FormatStatusTo(ft); + ride->formatNameTo(ft); + ride->formatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.PutExtra(INTENT_EXTRA_FORMATTER, &ft); ContextBroadcastIntent(&intent); @@ -2422,8 +2421,8 @@ static void RideQueueBannerSetMapTooltip(const PathElement& pathElement) auto ft = Formatter(); ft.Add(STR_RIDE_MAP_TIP); - ride->FormatNameTo(ft); - ride->FormatStatusTo(ft); + ride->formatNameTo(ft); + ride->formatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.PutExtra(INTENT_EXTRA_FORMATTER, &ft); ContextBroadcastIntent(&intent); @@ -2437,15 +2436,15 @@ static void RideStationSetMapTooltip(const TrackElement& trackElement) return; const auto stationIndex = trackElement.GetStationIndex(); - const auto stationNumber = ride->GetStationNumber(stationIndex); + const auto stationNumber = ride->getStationNumber(stationIndex); auto ft = Formatter(); ft.Add(STR_RIDE_MAP_TIP); - ft.Add(ride->num_stations <= 1 ? STR_RIDE_STATION : STR_RIDE_STATION_X); - ride->FormatNameTo(ft); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).capitalised); + ft.Add(ride->numStations <= 1 ? STR_RIDE_STATION : STR_RIDE_STATION_X); + ride->formatNameTo(ft); + ft.Add(GetRideComponentName(ride->getRideTypeDescriptor().NameConvention.station).capitalised); ft.Add(stationNumber); - ride->FormatStatusTo(ft); + ride->formatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.PutExtra(INTENT_EXTRA_FORMATTER, &ft); ContextBroadcastIntent(&intent); @@ -2463,20 +2462,20 @@ static void RideEntranceSetMapTooltip(const EntranceElement& entranceElement) // Get the queue length int32_t queueLength = 0; const auto stationIndex = entranceElement.GetStationIndex(); - if (!ride->GetStation(stationIndex).Entrance.IsNull()) + if (!ride->getStation(stationIndex).Entrance.IsNull()) { - queueLength = ride->GetStation(stationIndex).QueueLength; + queueLength = ride->getStation(stationIndex).QueueLength; } auto ft = Formatter(); ft.Add(STR_RIDE_MAP_TIP); - ft.Add(ride->num_stations <= 1 ? STR_RIDE_ENTRANCE : STR_RIDE_STATION_X_ENTRANCE); - ride->FormatNameTo(ft); + ft.Add(ride->numStations <= 1 ? STR_RIDE_ENTRANCE : STR_RIDE_STATION_X_ENTRANCE); + ride->formatNameTo(ft); // String IDs have an extra pop16 for some reason ft.Increment(sizeof(uint16_t)); - const auto stationNumber = ride->GetStationNumber(stationIndex); + const auto stationNumber = ride->getStationNumber(stationIndex); ft.Add(stationNumber); switch (queueLength) @@ -2500,14 +2499,14 @@ static void RideEntranceSetMapTooltip(const EntranceElement& entranceElement) else { auto ft = Formatter(); - ft.Add(ride->num_stations <= 1 ? STR_RIDE_EXIT : STR_RIDE_STATION_X_EXIT); - ride->FormatNameTo(ft); + ft.Add(ride->numStations <= 1 ? STR_RIDE_EXIT : STR_RIDE_STATION_X_EXIT); + ride->formatNameTo(ft); // String IDs have an extra pop16 for some reason ft.Increment(sizeof(uint16_t)); const auto stationIndex = entranceElement.GetStationIndex(); - const auto stationNumber = ride->GetStationNumber(stationIndex); + const auto stationNumber = ride->getStationNumber(stationIndex); ft.Add(stationNumber); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.PutExtra(INTENT_EXTRA_FORMATTER, &ft); @@ -2548,7 +2547,7 @@ void RideSetMapTooltip(const TileElement& tileElement) static ResultWithMessage RideModeCheckValidStationNumbers(const Ride& ride) { uint16_t numStations = 0; - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { if (!station.Start.IsNull()) { @@ -2576,7 +2575,7 @@ static ResultWithMessage RideModeCheckValidStationNumbers(const Ride& ride) } } - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (rtd.HasFlag(RtdFlag::hasOneStation) && numStations > 1) return { false, STR_UNABLE_TO_OPERATE_WITH_MORE_THAN_ONE_STATION_IN_THIS_MODE }; @@ -2593,7 +2592,7 @@ static StationIndexWithMessage RideModeCheckStationPresent(const Ride& ride) if (stationIndex.IsNull()) { - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (!rtd.HasFlag(RtdFlag::hasTrack)) return { StationIndex::GetNull(), STR_NOT_YET_CONSTRUCTED }; @@ -2616,12 +2615,12 @@ static ResultWithMessage RideCheckForEntranceExit(RideId rideIndex) if (ride == nullptr) return { false }; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) return { true }; uint8_t entrance = 0; uint8_t exit = 0; - for (const auto& station : ride->GetStations()) + for (const auto& station : ride->getStations()) { if (station.Start.IsNull()) continue; @@ -2662,7 +2661,7 @@ static ResultWithMessage RideCheckForEntranceExit(RideId rideIndex) * Calls FootpathChainRideQueue for all entrances of the ride * rct2: 0x006B5952 */ -void Ride::ChainQueues() const +void Ride::chainQueues() const { for (const auto& station : stations) { @@ -2684,7 +2683,7 @@ void Ride::ChainQueues() const continue; int32_t direction = tileElement->GetDirection(); - FootpathChainRideQueue(id, GetStationIndex(&station), mapLocation, tileElement, DirectionReverse(direction)); + FootpathChainRideQueue(id, getStationIndex(&station), mapLocation, tileElement, DirectionReverse(direction)); } while (!(tileElement++)->IsLastForTile()); } } @@ -2761,7 +2760,7 @@ static bool RideCheckTrackContainsInversions(const CoordsXYE& input, CoordsXYE* auto ride = GetRide(rideIndex); if (ride != nullptr) { - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) return true; } @@ -2823,7 +2822,7 @@ static bool RideCheckTrackContainsBanked(const CoordsXYE& input, CoordsXYE* outp if (ride == nullptr) return false; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) return true; @@ -2947,7 +2946,7 @@ static bool RideCheckStartAndEndIsStation(const CoordsXYE& input) { return false; } - ride->ChairliftBullwheelLocation[0] = TileCoordsXYZ{ CoordsXYZ{ trackBack.x, trackBack.y, trackBack.element->GetBaseZ() } }; + ride->chairliftBullwheelLocation[0] = TileCoordsXYZ{ CoordsXYZ{ trackBack.x, trackBack.y, trackBack.element->GetBaseZ() } }; // Check front of the track TrackGetFront(input, &trackFront); @@ -2957,7 +2956,7 @@ static bool RideCheckStartAndEndIsStation(const CoordsXYE& input) { return false; } - ride->ChairliftBullwheelLocation[1] = TileCoordsXYZ{ CoordsXYZ{ trackFront.x, trackFront.y, + ride->chairliftBullwheelLocation[1] = TileCoordsXYZ{ CoordsXYZ{ trackFront.x, trackFront.y, trackFront.element->GetBaseZ() } }; return true; } @@ -2992,8 +2991,8 @@ static void RideSetBoatHireReturnPoint(Ride& ride, const CoordsXYE& startElement trackType = returnPos.element->AsTrack()->GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); int32_t elementReturnDirection = ted.coordinates.rotationBegin; - ride.boat_hire_return_direction = returnPos.element->GetDirectionWithOffset(elementReturnDirection); - ride.boat_hire_return_position = TileCoordsXY{ returnPos }; + ride.boatHireReturnDirection = returnPos.element->GetDirectionWithOffset(elementReturnDirection); + ride.boatHireReturnPosition = TileCoordsXY{ returnPos }; } /** @@ -3007,7 +3006,7 @@ static void RideSetMazeEntranceExitPoints(Ride& ride) // Create a list of all the entrance and exit positions TileCoordsXYZD* position = positions; - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { if (!station.Entrance.IsNull()) { @@ -3161,13 +3160,13 @@ static void RideSetStartFinishPoints(RideId rideIndex, const CoordsXYE& startEle if (ride == nullptr) return; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) RideSetMazeEntranceExitPoints(*ride); else if (ride->type == RIDE_TYPE_BOAT_HIRE) RideSetBoatHireReturnPoint(*ride, startElement); - if (ride->IsBlockSectioned() && !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (ride->isBlockSectioned() && !(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) { RideOpenBlockBrakes(startElement); } @@ -3216,7 +3215,7 @@ static Vehicle* VehicleCreateCar( if (trackElement == nullptr) return nullptr; - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) return nullptr; @@ -3275,7 +3274,7 @@ static Vehicle* VehicleCreateCar( vehicle->peep[i] = EntityId::GetNull(); } - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (carEntry.flags & CAR_ENTRY_FLAG_DODGEM_CAR_PLACEMENT) { // Loc6DDCA4: @@ -3400,9 +3399,9 @@ static Vehicle* VehicleCreateCar( } vehicle->SetState(Vehicle::Status::MovingToEndOfStation); - if (ride.HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) + if (ride.hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) { - vehicle->SubType = carIndex == (ride.num_cars_per_train - 1) ? Vehicle::Type::Head : Vehicle::Type::Tail; + vehicle->SubType = carIndex == (ride.numCarsPerTrain - 1) ? Vehicle::Type::Head : Vehicle::Type::Tail; vehicle->SetFlag(VehicleFlags::CarIsReversed); } } @@ -3422,13 +3421,13 @@ static TrainReference VehicleCreateTrain( Ride& ride, const CoordsXYZ& trainPos, int32_t vehicleIndex, int32_t* remainingDistance, TrackElement* trackElement) { TrainReference train = { nullptr, nullptr }; - bool isReversed = ride.HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS); + bool isReversed = ride.hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS); - for (int32_t carIndex = 0; carIndex < ride.num_cars_per_train; carIndex++) + for (int32_t carIndex = 0; carIndex < ride.numCarsPerTrain; carIndex++) { - auto carSpawnIndex = (isReversed) ? (ride.num_cars_per_train - 1) - carIndex : carIndex; + auto carSpawnIndex = (isReversed) ? (ride.numCarsPerTrain - 1) - carIndex : carIndex; - auto vehicle = RideEntryGetVehicleAtPosition(ride.subtype, ride.num_cars_per_train, carSpawnIndex); + auto vehicle = RideEntryGetVehicleAtPosition(ride.subtype, ride.numCarsPerTrain, carSpawnIndex); auto car = VehicleCreateCar(ride, vehicle, carSpawnIndex, vehicleIndex, trainPos, remainingDistance, trackElement); if (car == nullptr) break; @@ -3457,9 +3456,9 @@ static bool VehicleCreateTrains(Ride& ride, const CoordsXYZ& trainsPos, TrackEle int32_t remainingDistance = 0; bool allTrainsCreated = true; - for (int32_t vehicleIndex = 0; vehicleIndex < ride.NumTrains; vehicleIndex++) + for (int32_t vehicleIndex = 0; vehicleIndex < ride.numTrains; vehicleIndex++) { - if (ride.IsBlockSectioned()) + if (ride.isBlockSectioned()) { remainingDistance = 0; } @@ -3505,7 +3504,7 @@ static bool VehicleCreateTrains(Ride& ride, const CoordsXYZ& trainsPos, TrackEle * * rct2: 0x006DDE9E */ -static void RideCreateVehiclesFindFirstBlock(const Ride& ride, CoordsXYE* outXYElement) +static void RidecreateVehiclesFindFirstBlock(const Ride& ride, CoordsXYE* outXYElement) { Vehicle* vehicle = GetEntity(ride.vehicles[0]); if (vehicle == nullptr) @@ -3577,16 +3576,16 @@ static void RideCreateVehiclesFindFirstBlock(const Ride& ride, CoordsXYE* outXYE * Create and place the rides vehicles * rct2: 0x006DD84C */ -ResultWithMessage Ride::CreateVehicles(const CoordsXYE& element, bool isApplying) +ResultWithMessage Ride::createVehicles(const CoordsXYE& element, bool isApplying) { - UpdateMaxVehicles(); + updateMaxVehicles(); if (subtype == kObjectEntryIndexNull) { return { true }; } // Check if there are enough free sprite slots for all the vehicles - int32_t totalCars = NumTrains * num_cars_per_train; + int32_t totalCars = numTrains * numCarsPerTrain; if (totalCars > count_free_misc_sprite_slots()) { return { false, STR_UNABLE_TO_CREATE_ENOUGH_VEHICLES }; @@ -3613,34 +3612,34 @@ ResultWithMessage Ride::CreateVehicles(const CoordsXYE& element, bool isApplying if (!VehicleCreateTrains(*this, vehiclePos, trackElement)) { - // This flag is needed for Ride::RemoveVehicles() - lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK; - RemoveVehicles(); + // This flag is needed for Ride::removeVehicles() + lifecycleFlags |= RIDE_LIFECYCLE_ON_TRACK; + removeVehicles(); return { false, STR_UNABLE_TO_CREATE_ENOUGH_VEHICLES }; } // return true; // Initialise station departs // 006DDDD0: - lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK; + lifecycleFlags |= RIDE_LIFECYCLE_ON_TRACK; for (int32_t i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++) { stations[i].Depart = (stations[i].Depart & kStationDepartFlag) | 1; } // - if (type != RIDE_TYPE_SPACE_RINGS && !GetRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) + if (type != RIDE_TYPE_SPACE_RINGS && !getRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) { - if (IsBlockSectioned()) + if (isBlockSectioned()) { CoordsXYE firstBlock{}; - RideCreateVehiclesFindFirstBlock(*this, &firstBlock); - MoveTrainsToBlockBrakes( + RidecreateVehiclesFindFirstBlock(*this, &firstBlock); + moveTrainsToBlockBrakes( { firstBlock.x, firstBlock.y, firstBlock.element->GetBaseZ() }, *firstBlock.element->AsTrack()); } else { - for (int32_t i = 0; i < NumTrains; i++) + for (int32_t i = 0; i < numTrains; i++) { Vehicle* vehicle = GetEntity(vehicles[i]); if (vehicle == nullptr) @@ -3669,22 +3668,22 @@ ResultWithMessage Ride::CreateVehicles(const CoordsXYE& element, bool isApplying * preceding that block. * rct2: 0x006DDF9C */ -void Ride::MoveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackElement& firstBlock) +void Ride::moveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackElement& firstBlock) { // If the ride has a cable lift, we don't want to fetch the cable lift element and the block preceding it TrackElement* cableLiftTileElement = nullptr; TrackElement* cableLiftPreviousBlock = nullptr; - if (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) + if (lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) { - cableLiftTileElement = MapGetTrackElementAt(CableLiftLoc); + cableLiftTileElement = MapGetTrackElementAt(cableLiftLoc); if (cableLiftTileElement != nullptr) { - CoordsXYZ location = CableLiftLoc; + CoordsXYZ location = cableLiftLoc; cableLiftPreviousBlock = TrackGetPreviousBlock(location, reinterpret_cast(cableLiftTileElement)); } } - for (int32_t i = 0; i < NumTrains; i++) + for (int32_t i = 0; i < numTrains; i++) { auto train = GetEntity(vehicles[i]); if (train == nullptr) @@ -3758,7 +3757,7 @@ void Ride::MoveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackEle static bool RideGetStationTile(const Ride& ride, CoordsXYE* output) { - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { CoordsXYZ trackStart = station.GetStart(); if (trackStart.IsNull()) @@ -3804,8 +3803,8 @@ static ResultWithMessage RideInitialiseCableLiftTrack(const Ride& ride, bool isA } // Spawn new cable lift tiles - auto cableLiftTileElement = MapGetTrackElementAt(ride.CableLiftLoc); - CoordsXYE cableLiftCoords = { ride.CableLiftLoc, reinterpret_cast(cableLiftTileElement) }; + auto cableLiftTileElement = MapGetTrackElementAt(ride.cableLiftLoc); + CoordsXYE cableLiftCoords = { ride.cableLiftLoc, reinterpret_cast(cableLiftTileElement) }; if (cableLiftTileElement == nullptr) return { false }; @@ -3857,7 +3856,7 @@ static ResultWithMessage RideCreateCableLift(RideId rideIndex, bool isApplying) return { false, STR_CABLE_LIFT_UNABLE_TO_WORK_IN_THIS_OPERATING_MODE }; } - if (ride->num_circuits > 1) + if (ride->numCircuits > 1) { return { false, STR_MULTICIRCUIT_NOT_POSSIBLE_WITH_CABLE_LIFT_HILL }; } @@ -3878,7 +3877,7 @@ static ResultWithMessage RideCreateCableLift(RideId rideIndex, bool isApplying) return { true }; } - auto cableLiftLoc = ride->CableLiftLoc; + auto cableLiftLoc = ride->cableLiftLoc; auto tileElement = MapGetTrackElementAt(cableLiftLoc); int32_t direction = tileElement->GetDirection(); @@ -3912,7 +3911,7 @@ static ResultWithMessage RideCreateCableLift(RideId rideIndex, bool isApplying) head->prev_vehicle_on_ride = tail->Id; tail->next_vehicle_on_ride = head->Id; - ride->lifecycle_flags |= RIDE_LIFECYCLE_CABLE_LIFT; + ride->lifecycleFlags |= RIDE_LIFECYCLE_CABLE_LIFT; head->CableLiftUpdateTrackMotion(); return { true }; } @@ -3922,7 +3921,7 @@ static ResultWithMessage RideCreateCableLift(RideId rideIndex, bool isApplying) * This will also move the screen to the first station missing the entrance or exit. * rct2: 0x006B51C0 */ -void Ride::ConstructMissingEntranceOrExit() const +void Ride::constructMissingEntranceOrExit() const { auto* w = WindowGetMain(); if (w == nullptr) @@ -3955,7 +3954,7 @@ void Ride::ConstructMissingEntranceOrExit() const return; } - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) { auto location = incompleteStation->GetStart(); @@ -3963,7 +3962,7 @@ void Ride::ConstructMissingEntranceOrExit() const CoordsXYE trackElement; RideTryGetOriginElement(*this, &trackElement); - FindTrackGap(trackElement, &trackElement); + findTrackGap(trackElement, &trackElement); int32_t ok = RideModify(trackElement); if (ok == 0) { @@ -3998,9 +3997,9 @@ static void RideScrollToTrackError(const CoordsXYE& trackElement) * * rct2: 0x006B4F6B */ -TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const +TrackElement* Ride::getOriginElement(StationIndex stationIndex) const { - auto stationLoc = GetStation(stationIndex).Start; + auto stationLoc = getStation(stationIndex).Start; TileElement* tileElement = MapGetFirstElementAt(stationLoc); if (tileElement == nullptr) return nullptr; @@ -4021,7 +4020,7 @@ TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const return nullptr; } -ResultWithMessage Ride::Test(bool isApplying) +ResultWithMessage Ride::test(bool isApplying) { if (type == kRideTypeNull) { @@ -4033,7 +4032,7 @@ ResultWithMessage Ride::Test(bool isApplying) windowMgr->CloseByNumber(WindowClass::RideConstruction, id.ToUnderlying()); StationIndex stationIndex = {}; - auto message = ChangeStatusDoStationChecks(stationIndex); + auto message = changeStatusDoStationChecks(stationIndex); if (!message.Successful) { return message; @@ -4042,33 +4041,33 @@ ResultWithMessage Ride::Test(bool isApplying) auto entranceExitCheck = RideCheckForEntranceExit(id); if (!entranceExitCheck.Successful) { - ConstructMissingEntranceOrExit(); + constructMissingEntranceOrExit(); return { false, entranceExitCheck.Message }; } CoordsXYE trackElement = {}; - message = ChangeStatusGetStartElement(stationIndex, trackElement); + message = changeStatusGetStartElement(stationIndex, trackElement); if (!message.Successful) { return message; } - message = ChangeStatusCheckCompleteCircuit(trackElement); + message = changeStatusCheckCompleteCircuit(trackElement); if (!message.Successful) { return message; } - message = ChangeStatusCheckTrackValidity(trackElement); + message = changeStatusCheckTrackValidity(trackElement); if (!message.Successful) { return message; } - return ChangeStatusCreateVehicles(isApplying, trackElement); + return changeStatusCreateVehicles(isApplying, trackElement); } -ResultWithMessage Ride::Simulate(bool isApplying) +ResultWithMessage Ride::simulate(bool isApplying) { CoordsXYE trackElement, problematicTrackElement = {}; if (type == kRideTypeNull) @@ -4078,38 +4077,38 @@ ResultWithMessage Ride::Simulate(bool isApplying) } StationIndex stationIndex = {}; - auto message = ChangeStatusDoStationChecks(stationIndex); + auto message = changeStatusDoStationChecks(stationIndex); if (!message.Successful) { return message; } - message = ChangeStatusGetStartElement(stationIndex, trackElement); + message = changeStatusGetStartElement(stationIndex, trackElement); if (!message.Successful) { return message; } - if (IsBlockSectioned() && FindTrackGap(trackElement, &problematicTrackElement)) + if (isBlockSectioned() && findTrackGap(trackElement, &problematicTrackElement)) { RideScrollToTrackError(problematicTrackElement); return { false, STR_TRACK_IS_NOT_A_COMPLETE_CIRCUIT }; } - message = ChangeStatusCheckTrackValidity(trackElement); + message = changeStatusCheckTrackValidity(trackElement); if (!message.Successful) { return message; } - return ChangeStatusCreateVehicles(isApplying, trackElement); + return changeStatusCreateVehicles(isApplying, trackElement); } /** * * rct2: 0x006B4EEA */ -ResultWithMessage Ride::Open(bool isApplying) +ResultWithMessage Ride::open(bool isApplying) { // Check to see if construction tool is in use. If it is close the construction window // to set the track to its final state and clean up ghosts. @@ -4122,7 +4121,7 @@ ResultWithMessage Ride::Open(bool isApplying) } StationIndex stationIndex = {}; - auto message = ChangeStatusDoStationChecks(stationIndex); + auto message = changeStatusDoStationChecks(stationIndex); if (!message.Successful) { return message; @@ -4131,36 +4130,36 @@ ResultWithMessage Ride::Open(bool isApplying) auto entranceExitCheck = RideCheckForEntranceExit(id); if (!entranceExitCheck.Successful) { - ConstructMissingEntranceOrExit(); + constructMissingEntranceOrExit(); return { false, entranceExitCheck.Message }; } if (isApplying) { - ChainQueues(); - lifecycle_flags |= RIDE_LIFECYCLE_EVER_BEEN_OPENED; + chainQueues(); + lifecycleFlags |= RIDE_LIFECYCLE_EVER_BEEN_OPENED; } CoordsXYE trackElement = {}; - message = ChangeStatusGetStartElement(stationIndex, trackElement); + message = changeStatusGetStartElement(stationIndex, trackElement); if (!message.Successful) { return message; } - message = ChangeStatusCheckCompleteCircuit(trackElement); + message = changeStatusCheckCompleteCircuit(trackElement); if (!message.Successful) { return message; } - message = ChangeStatusCheckTrackValidity(trackElement); + message = changeStatusCheckTrackValidity(trackElement); if (!message.Successful) { return message; } - return ChangeStatusCreateVehicles(isApplying, trackElement); + return changeStatusCreateVehicles(isApplying, trackElement); } /** @@ -4212,7 +4211,7 @@ void RideGetStartOfTrack(CoordsXYE* output) * * rct2: 0x00696707 */ -void Ride::StopGuestsQueuing() +void Ride::stopGuestsQueuing() { for (auto peep : EntityList()) { @@ -4226,9 +4225,9 @@ void Ride::StopGuestsQueuing() } } -RideMode Ride::GetDefaultMode() const +RideMode Ride::getDefaultMode() const { - return GetRideTypeDescriptor().DefaultMode; + return getRideTypeDescriptor().DefaultMode; } static bool RideTypeWithTrackColoursExists(ride_type_t rideType, const TrackColour& colours) @@ -4237,11 +4236,11 @@ static bool RideTypeWithTrackColoursExists(ride_type_t rideType, const TrackColo { if (ride.type != rideType) continue; - if (ride.track_colour[0].main != colours.main) + if (ride.trackColours[0].main != colours.main) continue; - if (ride.track_colour[0].additional != colours.additional) + if (ride.trackColours[0].additional != colours.additional) continue; - if (ride.track_colour[0].supports != colours.supports) + if (ride.trackColours[0].supports != colours.supports) continue; return true; @@ -4249,7 +4248,7 @@ static bool RideTypeWithTrackColoursExists(ride_type_t rideType, const TrackColo return false; } -bool Ride::NameExists(std::string_view name, RideId excludeRideId) +bool Ride::nameExists(std::string_view name, RideId excludeRideId) { char buffer[256]{}; for (auto& ride : GetRideManager()) @@ -4257,7 +4256,7 @@ bool Ride::NameExists(std::string_view name, RideId excludeRideId) if (ride.id != excludeRideId) { Formatter ft; - ride.FormatNameTo(ft); + ride.formatNameTo(ft); FormatStringLegacy(buffer, 256, STR_STRINGID, ft.Data()); if (name == buffer && RideHasAnyTrackElements(ride)) { @@ -4301,12 +4300,12 @@ int32_t RideGetRandomColourPresetIndex(ride_type_t rideType) * * Based on rct2: 0x006B4776 */ -void Ride::SetColourPreset(uint8_t index) +void Ride::setColourPreset(uint8_t index) { - const TrackColourPresetList* colourPresets = &GetRideTypeDescriptor().ColourPresets; + const TrackColourPresetList* colourPresets = &getRideTypeDescriptor().ColourPresets; TrackColour colours = { COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK }; // Stalls save their default colour in the vehicle settings (since they share a common ride type) - if (!IsRide()) + if (!isRide()) { const auto* rideEntry = GetRideEntryByIndex(subtype); if (rideEntry != nullptr && rideEntry->vehicle_preset_list->count > 0) @@ -4319,11 +4318,11 @@ void Ride::SetColourPreset(uint8_t index) { colours = colourPresets->list[index]; } - for (size_t i = 0; i < std::size(track_colour); i++) + for (size_t i = 0; i < std::size(trackColours); i++) { - track_colour[i].main = colours.main; - track_colour[i].additional = colours.additional; - track_colour[i].supports = colours.supports; + trackColours[i].main = colours.main; + trackColours[i].additional = colours.additional; + trackColours[i].supports = colours.supports; } vehicleColourSettings = VehicleColourSettings::same; } @@ -4341,20 +4340,20 @@ money64 RideGetCommonPrice(const Ride& forRide) return kMoney64Undefined; } -void Ride::SetNameToDefault() +void Ride::setNameToDefault() { char rideNameBuffer[256]{}; // Increment default name number until we find a unique name - custom_name = {}; - default_name_number = 0; + customName = {}; + defaultNameNumber = 0; do { - default_name_number++; + defaultNameNumber++; Formatter ft; - FormatNameTo(ft); + formatNameTo(ft); FormatStringLegacy(rideNameBuffer, 256, STR_STRINGID, ft.Data()); - } while (Ride::NameExists(rideNameBuffer, id)); + } while (Ride::nameExists(rideNameBuffer, id)); } /** @@ -4391,13 +4390,13 @@ void IncrementTurnCount1Element(Ride& ride, uint8_t type) switch (type) { case 0: - turn_count = &ride.turn_count_default; + turn_count = &ride.turnCountDefault; break; case 1: - turn_count = &ride.turn_count_banked; + turn_count = &ride.turnCountBanked; break; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return; @@ -4416,13 +4415,13 @@ void IncrementTurnCount2Elements(Ride& ride, uint8_t type) switch (type) { case 0: - turn_count = &ride.turn_count_default; + turn_count = &ride.turnCountDefault; break; case 1: - turn_count = &ride.turn_count_banked; + turn_count = &ride.turnCountBanked; break; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return; @@ -4441,13 +4440,13 @@ void IncrementTurnCount3Elements(Ride& ride, uint8_t type) switch (type) { case 0: - turn_count = &ride.turn_count_default; + turn_count = &ride.turnCountDefault; break; case 1: - turn_count = &ride.turn_count_banked; + turn_count = &ride.turnCountBanked; break; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return; @@ -4471,7 +4470,7 @@ void IncrementTurnCount4PlusElements(Ride& ride, uint8_t type) IncrementTurnCount3Elements(ride, type); return; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return; @@ -4490,13 +4489,13 @@ int32_t GetTurnCount1Element(const Ride& ride, uint8_t type) switch (type) { case 0: - turn_count = &ride.turn_count_default; + turn_count = &ride.turnCountDefault; break; case 1: - turn_count = &ride.turn_count_banked; + turn_count = &ride.turnCountBanked; break; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return 0; @@ -4511,13 +4510,13 @@ int32_t GetTurnCount2Elements(const Ride& ride, uint8_t type) switch (type) { case 0: - turn_count = &ride.turn_count_default; + turn_count = &ride.turnCountDefault; break; case 1: - turn_count = &ride.turn_count_banked; + turn_count = &ride.turnCountBanked; break; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return 0; @@ -4532,13 +4531,13 @@ int32_t GetTurnCount3Elements(const Ride& ride, uint8_t type) switch (type) { case 0: - turn_count = &ride.turn_count_default; + turn_count = &ride.turnCountDefault; break; case 1: - turn_count = &ride.turn_count_banked; + turn_count = &ride.turnCountBanked; break; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return 0; @@ -4556,7 +4555,7 @@ int32_t GetTurnCount4PlusElements(const Ride& ride, uint8_t type) case 1: return 0; case 2: - turn_count = &ride.turn_count_sloped; + turn_count = &ride.turnCountSloped; break; default: return 0; @@ -4565,49 +4564,49 @@ int32_t GetTurnCount4PlusElements(const Ride& ride, uint8_t type) return ((*turn_count) & kTurnMask4PlusElements) >> 11; } -bool Ride::HasSpinningTunnel() const +bool Ride::hasSpinningTunnel() const { - return special_track_elements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; + return specialTrackElements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; } -bool Ride::HasWaterSplash() const +bool Ride::hasWaterSplash() const { - return special_track_elements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; + return specialTrackElements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; } -bool Ride::HasRapids() const +bool Ride::hasRapids() const { - return special_track_elements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; + return specialTrackElements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; } -bool Ride::HasLogReverser() const +bool Ride::hasLogReverser() const { - return special_track_elements & RIDE_ELEMENT_REVERSER_OR_WATERFALL; + return specialTrackElements & RIDE_ELEMENT_REVERSER_OR_WATERFALL; } -bool Ride::HasWaterfall() const +bool Ride::hasWaterfall() const { - return special_track_elements & RIDE_ELEMENT_REVERSER_OR_WATERFALL; + return specialTrackElements & RIDE_ELEMENT_REVERSER_OR_WATERFALL; } -bool Ride::HasWhirlpool() const +bool Ride::hasWhirlpool() const { - return special_track_elements & RIDE_ELEMENT_WHIRLPOOL; + return specialTrackElements & RIDE_ELEMENT_WHIRLPOOL; } uint8_t RideGetHelixSections(const Ride& ride) { // Helix sections stored in the low 5 bits. - return ride.special_track_elements & 0x1F; + return ride.specialTrackElements & 0x1F; } -bool Ride::IsPoweredLaunched() const +bool Ride::isPoweredLaunched() const { return mode == RideMode::poweredLaunchPasstrough || mode == RideMode::poweredLaunch || mode == RideMode::poweredLaunchBlockSectioned; } -bool Ride::IsBlockSectioned() const +bool Ride::isBlockSectioned() const { return mode == RideMode::continuousCircuitBlockSectioned || mode == RideMode::poweredLaunchBlockSectioned; } @@ -4640,11 +4639,11 @@ void InvalidateTestResults(Ride& ride) { ride.measurement = {}; ride.ratings.setNull(); - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_TESTED; - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_TESTED; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { - for (int32_t i = 0; i < ride.NumTrains; i++) + for (int32_t i = 0; i < ride.numTrains; i++) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle != nullptr) @@ -4667,14 +4666,14 @@ void InvalidateTestResults(Ride& ride) */ void RideFixBreakdown(Ride& ride, int32_t reliabilityIncreaseFactor) { - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_BREAKDOWN_PENDING; - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_BROKEN_DOWN; - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_BREAKDOWN_PENDING; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_BROKEN_DOWN; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { - for (int32_t i = 0; i < ride.NumTrains; i++) + for (int32_t i = 0; i < ride.numTrains; i++) { for (Vehicle* vehicle = GetEntity(ride.vehicles[i]); vehicle != nullptr; vehicle = GetEntity(vehicle->next_vehicle_on_train)) @@ -4686,7 +4685,7 @@ void RideFixBreakdown(Ride& ride, int32_t reliabilityIncreaseFactor) } } - uint8_t unreliability = 100 - ride.reliability_percentage; + uint8_t unreliability = 100 - ride.reliabilityPercentage; ride.reliability += reliabilityIncreaseFactor * (unreliability / 2); } @@ -4696,7 +4695,7 @@ void RideFixBreakdown(Ride& ride, int32_t reliabilityIncreaseFactor) */ void RideUpdateVehicleColours(const Ride& ride) { - if (ride.type == RIDE_TYPE_SPACE_RINGS || ride.GetRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) + if (ride.type == RIDE_TYPE_SPACE_RINGS || ride.getRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) { GfxInvalidateScreen(); } @@ -4712,20 +4711,20 @@ void RideUpdateVehicleColours(const Ride& ride) switch (ride.vehicleColourSettings) { case VehicleColourSettings::same: - colours = ride.vehicle_colours[0]; + colours = ride.vehicleColours[0]; break; case VehicleColourSettings::perTrain: - colours = ride.vehicle_colours[i]; + colours = ride.vehicleColours[i]; break; case VehicleColourSettings::perCar: if (vehicle->HasFlag(VehicleFlags::CarIsReversed)) { - colours = ride.vehicle_colours[std::min( - (ride.num_cars_per_train - 1) - carIndex, OpenRCT2::Limits::kMaxCarsPerTrain - 1)]; + colours = ride.vehicleColours[std::min( + (ride.numCarsPerTrain - 1) - carIndex, OpenRCT2::Limits::kMaxCarsPerTrain - 1)]; } else { - colours = ride.vehicle_colours[std::min(carIndex, OpenRCT2::Limits::kMaxCarsPerTrain - 1)]; + colours = ride.vehicleColours[std::min(carIndex, OpenRCT2::Limits::kMaxCarsPerTrain - 1)]; } break; } @@ -4963,7 +4962,7 @@ OpenRCT2::BitSet RideEntryGetSupportedTrackPieces( static std::optional RideGetSmallestStationLength(const Ride& ride) { std::optional result; - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { if (!station.Start.IsNull()) { @@ -4987,7 +4986,7 @@ static int32_t RideGetTrackLength(const Ride& ride) CoordsXYZ trackStart; bool foundTrack = false; - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { trackStart = station.GetStart(); if (trackStart.IsNull()) @@ -5058,7 +5057,7 @@ static int32_t RideGetTrackLength(const Ride& ride) * * rct2: 0x006DD57D */ -void Ride::UpdateMaxVehicles() +void Ride::updateMaxVehicles() { if (subtype == kObjectEntryIndexNull) return; @@ -5069,15 +5068,15 @@ void Ride::UpdateMaxVehicles() return; } - uint8_t numCarsPerTrain, numTrains; + uint8_t newNumCarsPerTrain; int32_t maxNumTrains; - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rideEntry->cars_per_flat_ride == kNoFlatRideCars) { - num_cars_per_train = std::max(rideEntry->min_cars_in_train, num_cars_per_train); - MinCarsPerTrain = rideEntry->min_cars_in_train; - MaxCarsPerTrain = rideEntry->max_cars_in_train; + newNumCarsPerTrain = std::max(rideEntry->min_cars_in_train, numCarsPerTrain); + minCarsPerTrain = rideEntry->min_cars_in_train; + maxCarsPerTrain = rideEntry->max_cars_in_train; // Calculate maximum train length based on smallest station length auto stationNumTiles = RideGetSmallestStationLength(*this); @@ -5086,7 +5085,7 @@ void Ride::UpdateMaxVehicles() auto stationLength = (stationNumTiles.value() * 0x44180) - 0x16B2A; int32_t maxMass = rtd.MaxMass << 8; - int32_t maxCarsPerTrain = 1; + int32_t newMaxCarsPerTrain = 1; for (int32_t numCars = rideEntry->max_cars_in_train; numCars > 0; numCars--) { int32_t trainLength = 0; @@ -5100,24 +5099,24 @@ void Ride::UpdateMaxVehicles() if (trainLength <= stationLength && totalMass <= maxMass) { - maxCarsPerTrain = numCars; + newMaxCarsPerTrain = numCars; break; } } - int32_t newCarsPerTrain = std::max(proposed_num_cars_per_train, rideEntry->min_cars_in_train); - maxCarsPerTrain = std::max(maxCarsPerTrain, static_cast(rideEntry->min_cars_in_train)); + int32_t newCarsPerTrain = std::max(proposedNumCarsPerTrain, rideEntry->min_cars_in_train); + newMaxCarsPerTrain = std::max(newMaxCarsPerTrain, static_cast(rideEntry->min_cars_in_train)); if (!GetGameState().Cheats.disableTrainLengthLimit) { - newCarsPerTrain = std::min(maxCarsPerTrain, newCarsPerTrain); + newCarsPerTrain = std::min(newMaxCarsPerTrain, newCarsPerTrain); } - MaxCarsPerTrain = maxCarsPerTrain; - MinCarsPerTrain = rideEntry->min_cars_in_train; + maxCarsPerTrain = newMaxCarsPerTrain; + minCarsPerTrain = rideEntry->min_cars_in_train; switch (mode) { case RideMode::continuousCircuitBlockSectioned: case RideMode::poweredLaunchBlockSectioned: - maxNumTrains = std::clamp(num_stations + num_block_brakes - 1, 1, OpenRCT2::Limits::kMaxTrainsPerRide); + maxNumTrains = std::clamp(numStations + numBlockBrakes - 1, 1, OpenRCT2::Limits::kMaxTrainsPerRide); break; case RideMode::reverseInclineLaunchedShuttle: case RideMode::poweredLaunchPasstrough: @@ -5182,16 +5181,16 @@ void Ride::UpdateMaxVehicles() } break; } - max_trains = maxNumTrains; + maxTrains = maxNumTrains; - numCarsPerTrain = std::min(proposed_num_cars_per_train, static_cast(newCarsPerTrain)); + newNumCarsPerTrain = std::min(proposedNumCarsPerTrain, static_cast(newCarsPerTrain)); } else { - max_trains = rideEntry->cars_per_flat_ride; - MinCarsPerTrain = rideEntry->min_cars_in_train; - MaxCarsPerTrain = rideEntry->max_cars_in_train; - numCarsPerTrain = rideEntry->max_cars_in_train; + maxTrains = rideEntry->cars_per_flat_ride; + minCarsPerTrain = rideEntry->min_cars_in_train; + maxCarsPerTrain = rideEntry->max_cars_in_train; + newNumCarsPerTrain = rideEntry->max_cars_in_train; maxNumTrains = rideEntry->cars_per_flat_ride; } @@ -5199,56 +5198,56 @@ void Ride::UpdateMaxVehicles() { maxNumTrains = OpenRCT2::Limits::kMaxTrainsPerRide; } - numTrains = std::min(ProposedNumTrains, static_cast(maxNumTrains)); + auto newNumTrains = std::min(proposedNumTrains, static_cast(maxNumTrains)); // Refresh new current num vehicles / num cars per vehicle - if (numTrains != NumTrains || numCarsPerTrain != num_cars_per_train) + if (newNumTrains != numTrains || newNumCarsPerTrain != numCarsPerTrain) { - num_cars_per_train = numCarsPerTrain; - NumTrains = numTrains; + numCarsPerTrain = newNumCarsPerTrain; + numTrains = newNumTrains; auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByNumber(WindowClass::Ride, id.ToUnderlying()); } } -void Ride::UpdateNumberOfCircuits() +void Ride::updateNumberOfCircuits() { - if (!CanHaveMultipleCircuits()) + if (!canHaveMultipleCircuits()) { - num_circuits = 1; + numCircuits = 1; } } -void Ride::SetRideEntry(ObjectEntryIndex entryIndex) +void Ride::setRideEntry(ObjectEntryIndex entryIndex) { auto colour = RideGetUnusedPresetVehicleColour(entryIndex); auto rideSetVehicleAction = RideSetVehicleAction(id, RideSetVehicleType::RideEntry, entryIndex, colour); GameActions::Execute(&rideSetVehicleAction); } -void Ride::SetNumTrains(int32_t numTrains) +void Ride::setNumTrains(int32_t newNumTrains) { - auto rideSetVehicleAction = RideSetVehicleAction(id, RideSetVehicleType::NumTrains, numTrains); + auto rideSetVehicleAction = RideSetVehicleAction(id, RideSetVehicleType::NumTrains, newNumTrains); GameActions::Execute(&rideSetVehicleAction); } -void Ride::SetNumCarsPerVehicle(int32_t numCarsPerVehicle) +void Ride::setNumCarsPerTrain(int32_t numCarsPerVehicle) { auto rideSetVehicleAction = RideSetVehicleAction(id, RideSetVehicleType::NumCarsPerTrain, numCarsPerVehicle); GameActions::Execute(&rideSetVehicleAction); } -void Ride::SetReversedTrains(bool reverseTrains) +void Ride::setReversedTrains(bool reverseTrains) { auto rideSetVehicleAction = RideSetVehicleAction(id, RideSetVehicleType::TrainsReversed, reverseTrains); GameActions::Execute(&rideSetVehicleAction); } -void Ride::SetToDefaultInspectionInterval() +void Ride::setToDefaultInspectionInterval() { uint8_t defaultInspectionInterval = Config::Get().general.DefaultInspectionInterval; - if (inspection_interval != defaultInspectionInterval) + if (inspectionInterval != defaultInspectionInterval) { if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) { @@ -5261,7 +5260,7 @@ void Ride::SetToDefaultInspectionInterval() * * rct2: 0x006B752C */ -void Ride::Crash(uint8_t vehicleIndex) +void Ride::crash(uint8_t vehicleIndex) { Vehicle* vehicle = GetEntity(vehicles[vehicleIndex]); @@ -5282,7 +5281,7 @@ void Ride::Crash(uint8_t vehicleIndex) if (Config::Get().notifications.RideCrashed) { Formatter ft; - FormatNameTo(ft); + formatNameTo(ft); News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_HAS_CRASHED, id.ToUnderlying(), ft); } } @@ -5300,7 +5299,7 @@ uint32_t RideCustomersInLast5Minutes(const Ride& ride) for (int32_t i = 0; i < OpenRCT2::Limits::kCustomerHistorySize; i++) { - sum += ride.num_customers[i]; + sum += ride.numCustomers[i]; } return sum; @@ -5308,11 +5307,11 @@ uint32_t RideCustomersInLast5Minutes(const Ride& ride) Vehicle* RideGetBrokenVehicle(const Ride& ride) { - auto vehicleIndex = ride.vehicles[ride.broken_vehicle]; + auto vehicleIndex = ride.vehicles[ride.brokenTrain]; Vehicle* vehicle = GetEntity(vehicleIndex); if (vehicle != nullptr) { - return vehicle->GetCar(ride.broken_car); + return vehicle->GetCar(ride.brokenCar); } return nullptr; } @@ -5321,34 +5320,34 @@ Vehicle* RideGetBrokenVehicle(const Ride& ride) * * rct2: 0x006D235B */ -void Ride::Delete() +void Ride::remove() { RideDelete(id); } -void Ride::Renew() +void Ride::renew() { // Set build date to current date (so the ride is brand new) - build_date = GetDate().GetMonthsElapsed(); + buildDate = GetDate().GetMonthsElapsed(); reliability = kRideInitialReliability; } -RideClassification Ride::GetClassification() const +RideClassification Ride::getClassification() const { - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); return rtd.Classification; } -bool Ride::IsRide() const +bool Ride::isRide() const { - return GetClassification() == RideClassification::ride; + return getClassification() == RideClassification::ride; } money64 RideGetPrice(const Ride& ride) { if (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) return 0; - if (ride.IsRide()) + if (ride.isRide()) { if (!Park::RidePricesUnlocked()) { @@ -5413,7 +5412,7 @@ static bool CheckForAdjacentStation(const CoordsXYZ& stationCoords, uint8_t dire { auto rideIndex = stationElement->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); - if (ride != nullptr && (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)) + if (ride != nullptr && (ride->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)) { found = true; } @@ -5431,7 +5430,7 @@ bool RideHasAdjacentStation(const Ride& ride) /* Loop through all of the ride stations, checking for an * adjacent station on either side. */ - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { auto stationStart = station.GetStart(); if (!stationStart.IsNull()) @@ -5459,7 +5458,7 @@ bool RideHasAdjacentStation(const Ride& ride) bool RideHasStationShelter(const Ride& ride) { - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); return stationObj != nullptr && (stationObj->Flags & STATION_OBJECT_FLAGS::HAS_SHELTER); } @@ -5548,13 +5547,13 @@ ObjectEntryIndex RideGetEntryIndex(ride_type_t rideType, ObjectEntryIndex rideSu return subType; } -const StationObject* Ride::GetStationObject() const +const StationObject* Ride::getStationObject() const { auto& objManager = GetContext()->GetObjectManager(); - return objManager.GetLoadedObject(entrance_style); + return objManager.GetLoadedObject(entranceStyle); } -const MusicObject* Ride::GetMusicObject() const +const MusicObject* Ride::getMusicObject() const { auto& objManager = GetContext()->GetObjectManager(); return objManager.GetLoadedObject(music); @@ -5572,9 +5571,9 @@ void DetermineRideEntranceAndExitLocations() for (auto& ride : GetRideManager()) { - for (auto& station : ride.GetStations()) + for (auto& station : ride.getStations()) { - auto stationIndex = ride.GetStationIndex(&station); + auto stationIndex = ride.getStationIndex(&station); TileCoordsXYZD entranceLoc = station.Entrance; TileCoordsXYZD exitLoc = station.Exit; bool fixEntrance = false; @@ -5727,65 +5726,65 @@ void RideClearLeftoverEntrances(const Ride& ride) } } -std::string Ride::GetName() const +std::string Ride::getName() const { Formatter ft; - FormatNameTo(ft); + formatNameTo(ft); return FormatStringIDLegacy(STR_STRINGID, reinterpret_cast(ft.Data())); } -void Ride::FormatNameTo(Formatter& ft) const +void Ride::formatNameTo(Formatter& ft) const { - if (!custom_name.empty()) + if (!customName.empty()) { - auto str = custom_name.c_str(); + auto str = customName.c_str(); ft.Add(STR_STRING); ft.Add(str); } else { - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); auto rideTypeName = rtd.Naming.Name; if (rtd.HasFlag(RtdFlag::listVehiclesSeparately)) { - auto rideEntry = GetRideEntry(); + auto rideEntry = getRideEntry(); if (rideEntry != nullptr) { rideTypeName = rideEntry->naming.Name; } } - ft.Add(1).Add(rideTypeName).Add(default_name_number); + ft.Add(1).Add(rideTypeName).Add(defaultNameNumber); } } -uint64_t Ride::GetAvailableModes() const +uint64_t Ride::getAvailableModes() const { if (GetGameState().Cheats.showAllOperatingModes) return kAllRideModesAvailable; - return GetRideTypeDescriptor().RideModes; + return getRideTypeDescriptor().RideModes; } -const RideTypeDescriptor& Ride::GetRideTypeDescriptor() const +const RideTypeDescriptor& Ride::getRideTypeDescriptor() const { return ::GetRideTypeDescriptor(type); } -uint8_t Ride::GetNumShelteredSections() const +uint8_t Ride::getNumShelteredSections() const { - return num_sheltered_sections & ShelteredSectionsBits::kNumShelteredSectionsMask; + return numShelteredSections & ShelteredSectionsBits::kNumShelteredSectionsMask; } -void Ride::IncreaseNumShelteredSections() +void Ride::increaseNumShelteredSections() { - auto newNumShelteredSections = GetNumShelteredSections(); + auto newNumShelteredSections = getNumShelteredSections(); if (newNumShelteredSections != 0x1F) newNumShelteredSections++; - num_sheltered_sections &= ~ShelteredSectionsBits::kNumShelteredSectionsMask; - num_sheltered_sections |= newNumShelteredSections; + numShelteredSections &= ~ShelteredSectionsBits::kNumShelteredSectionsMask; + numShelteredSections |= newNumShelteredSections; } -void Ride::UpdateRideTypeForAllPieces() +void Ride::updateRideTypeForAllPieces() { auto& gameState = GetGameState(); for (int32_t y = 0; y < gameState.MapSize.y; y++) @@ -5812,22 +5811,22 @@ void Ride::UpdateRideTypeForAllPieces() } } -bool Ride::HasLifecycleFlag(uint32_t flag) const +bool Ride::hasLifecycleFlag(uint32_t flag) const { - return (lifecycle_flags & flag) != 0; + return (lifecycleFlags & flag) != 0; } -void Ride::SetLifecycleFlag(uint32_t flag, bool on) +void Ride::setLifecycleFlag(uint32_t flag, bool on) { if (on) - lifecycle_flags |= flag; + lifecycleFlags |= flag; else - lifecycle_flags &= ~flag; + lifecycleFlags &= ~flag; } -bool Ride::HasRecolourableShopItems() const +bool Ride::hasRecolourableShopItems() const { - const auto rideEntry = GetRideEntry(); + const auto rideEntry = getRideEntry(); if (rideEntry == nullptr) return false; @@ -5842,9 +5841,9 @@ bool Ride::HasRecolourableShopItems() const return false; } -bool Ride::HasStation() const +bool Ride::hasStation() const { - return num_stations != 0; + return numStations != 0; } std::vector GetTracklessRides() @@ -5882,7 +5881,7 @@ std::vector GetTracklessRides() return result; } -ResultWithMessage Ride::ChangeStatusDoStationChecks(StationIndex& stationIndex) +ResultWithMessage Ride::changeStatusDoStationChecks(StationIndex& stationIndex) { auto stationIndexCheck = RideModeCheckStationPresent(*this); stationIndex = stationIndexCheck.StationIndex; @@ -5896,16 +5895,16 @@ ResultWithMessage Ride::ChangeStatusDoStationChecks(StationIndex& stationIndex) return { true }; } -ResultWithMessage Ride::ChangeStatusGetStartElement(StationIndex stationIndex, CoordsXYE& trackElement) +ResultWithMessage Ride::changeStatusGetStartElement(StationIndex stationIndex, CoordsXYE& trackElement) { - auto startLoc = GetStation(stationIndex).Start; + auto startLoc = getStation(stationIndex).Start; trackElement.x = startLoc.x; trackElement.y = startLoc.y; - trackElement.element = reinterpret_cast(GetOriginElement(stationIndex)); + trackElement.element = reinterpret_cast(getOriginElement(stationIndex)); if (trackElement.element == nullptr) { // Maze is strange, station start is 0... investigation required - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) return { false }; } @@ -5913,12 +5912,12 @@ ResultWithMessage Ride::ChangeStatusGetStartElement(StationIndex stationIndex, C return { true }; } -ResultWithMessage Ride::ChangeStatusCheckCompleteCircuit(const CoordsXYE& trackElement) +ResultWithMessage Ride::changeStatusCheckCompleteCircuit(const CoordsXYE& trackElement) { CoordsXYE problematicTrackElement = {}; - if (mode == RideMode::race || mode == RideMode::continuousCircuit || IsBlockSectioned()) + if (mode == RideMode::race || mode == RideMode::continuousCircuit || isBlockSectioned()) { - if (FindTrackGap(trackElement, &problematicTrackElement)) + if (findTrackGap(trackElement, &problematicTrackElement)) { RideScrollToTrackError(problematicTrackElement); return { false, STR_TRACK_IS_NOT_A_COMPLETE_CIRCUIT }; @@ -5928,11 +5927,11 @@ ResultWithMessage Ride::ChangeStatusCheckCompleteCircuit(const CoordsXYE& trackE return { true }; } -ResultWithMessage Ride::ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement) +ResultWithMessage Ride::changeStatusCheckTrackValidity(const CoordsXYE& trackElement) { CoordsXYE problematicTrackElement = {}; - if (IsBlockSectioned()) + if (isBlockSectioned()) { auto blockBrakeCheck = RideCheckBlockBrakes(trackElement, &problematicTrackElement); if (!blockBrakeCheck.Successful) @@ -5969,7 +5968,7 @@ ResultWithMessage Ride::ChangeStatusCheckTrackValidity(const CoordsXYE& trackEle if (mode == RideMode::stationToStation) { - if (!FindTrackGap(trackElement, &problematicTrackElement)) + if (!findTrackGap(trackElement, &problematicTrackElement)) { return { false, STR_RIDE_MUST_START_AND_END_WITH_STATIONS }; } @@ -5990,23 +5989,23 @@ ResultWithMessage Ride::ChangeStatusCheckTrackValidity(const CoordsXYE& trackEle return { true }; } -ResultWithMessage Ride::ChangeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement) +ResultWithMessage Ride::changeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement) { if (isApplying) RideSetStartFinishPoints(id, trackElement); - const auto& rtd = GetRideTypeDescriptor(); - if (!rtd.HasFlag(RtdFlag::noVehicles) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + const auto& rtd = getRideTypeDescriptor(); + if (!rtd.HasFlag(RtdFlag::noVehicles) && !(lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) { - const auto createVehicleResult = CreateVehicles(trackElement, isApplying); + const auto createVehicleResult = createVehicles(trackElement, isApplying); if (!createVehicleResult.Successful) { return { false, createVehicleResult.Message }; } } - if (rtd.HasFlag(RtdFlag::allowCableLiftHill) && (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) - && !(lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT)) + if (rtd.HasFlag(RtdFlag::allowCableLiftHill) && (lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) + && !(lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT)) { const auto createCableLiftResult = RideCreateCableLift(id, isApplying); if (!createCableLiftResult.Successful) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 39f4f2b88f..10774c3888 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -134,288 +134,288 @@ struct Ride ObjectEntryIndex subtype{ kObjectEntryIndexNull }; RideMode mode{}; VehicleColourSettings vehicleColourSettings{}; - VehicleColour vehicle_colours[OpenRCT2::Limits::kMaxVehicleColours]{}; + VehicleColour vehicleColours[OpenRCT2::Limits::kMaxVehicleColours]{}; // 0 = closed, 1 = open, 2 = test RideStatus status{}; - std::string custom_name; - uint16_t default_name_number{}; - CoordsXY overall_view; + std::string customName; + uint16_t defaultNameNumber{}; + CoordsXY overallView; EntityId vehicles[OpenRCT2::Limits::kMaxTrainsPerRide + 1]{}; // Points to the first car in the train - uint8_t depart_flags{}; - uint8_t num_stations{}; - uint8_t NumTrains{}; - uint8_t num_cars_per_train{}; - uint8_t ProposedNumTrains{}; - uint8_t proposed_num_cars_per_train{}; - uint8_t max_trains{}; - uint8_t MinCarsPerTrain{}; - uint8_t MaxCarsPerTrain{}; - uint8_t min_waiting_time{}; - uint8_t max_waiting_time{}; + uint8_t departFlags{}; + uint8_t numStations{}; + uint8_t numTrains{}; + uint8_t numCarsPerTrain{}; + uint8_t proposedNumTrains{}; + uint8_t proposedNumCarsPerTrain{}; + uint8_t maxTrains{}; + uint8_t minCarsPerTrain{}; + uint8_t maxCarsPerTrain{}; + uint8_t minWaitingTime{}; + uint8_t maxWaitingTime{}; union { - uint8_t operation_option; - uint8_t time_limit; - uint8_t NumLaps; - uint8_t launch_speed; + uint8_t operationOption; + uint8_t timeLimit; + uint8_t numLaps; + uint8_t launchSpeed; uint8_t speed; uint8_t rotations{}; }; - uint8_t boat_hire_return_direction{}; - TileCoordsXY boat_hire_return_position; + uint8_t boatHireReturnDirection{}; + TileCoordsXY boatHireReturnPosition; // bits 0 through 4 are the number of helix sections // bit 5: spinning tunnel, water splash, or rapids // bit 6: log reverser, waterfall // bit 7: whirlpool - uint8_t special_track_elements{}; + uint8_t specialTrackElements{}; // Use ToHumanReadableSpeed if converting to display - int32_t max_speed{}; - int32_t average_speed{}; - uint8_t current_test_segment{}; - uint8_t average_speed_test_timeout{}; - fixed16_2dp max_positive_vertical_g{}; - fixed16_2dp max_negative_vertical_g{}; - fixed16_2dp max_lateral_g{}; - fixed16_2dp previous_vertical_g{}; - fixed16_2dp previous_lateral_g{}; - uint32_t testing_flags{}; + int32_t maxSpeed{}; + int32_t averageSpeed{}; + uint8_t currentTestSegment{}; + uint8_t averageSpeedTestTimeout{}; + fixed16_2dp maxPositiveVerticalG{}; + fixed16_2dp maxNegativeVerticalG{}; + fixed16_2dp maxLateralG{}; + fixed16_2dp previousVerticalG{}; + fixed16_2dp previousLateralG{}; + uint32_t testingFlags{}; // x y z map location of the current track piece during a test // this is to prevent counting special tracks multiple times - TileCoordsXYZ CurTestTrackLocation; + TileCoordsXYZ curTestTrackLocation; // Next 3 variables are related (XXXX XYYY ZZZa aaaa) - uint16_t turn_count_default{}; // X = current turn count - uint16_t turn_count_banked{}; - uint16_t turn_count_sloped{}; // X = number turns > 3 elements + uint16_t turnCountDefault{}; // X = current turn count + uint16_t turnCountBanked{}; + uint16_t turnCountSloped{}; // X = number turns > 3 elements // Y is number of powered lifts, X is drops uint8_t dropsPoweredLifts{}; // (YYXX XXXX) - uint8_t start_drop_height{}; - uint8_t highest_drop_height{}; - int32_t sheltered_length{}; + uint8_t startDropHeight{}; + uint8_t highestDropHeight{}; + int32_t shelteredLength{}; // Unused always 0? Should affect nausea - uint16_t var_11C{}; - uint8_t num_sheltered_sections{}; // (?abY YYYY) + uint16_t var11C{}; + uint8_t numShelteredSections{}; // (?abY YYYY) // Customer counter in the current 960 game tick (about 30 seconds) interval - uint16_t cur_num_customers{}; + uint16_t curNumCustomers{}; // Counts ticks to update customer intervals, resets each 960 game ticks. - uint16_t num_customers_timeout{}; + uint16_t numCustomersTimeout{}; // Customer count in the last 10 * 960 game ticks (sliding window) - uint16_t num_customers[OpenRCT2::Limits::kCustomerHistorySize]{}; + uint16_t numCustomers[OpenRCT2::Limits::kCustomerHistorySize]{}; money64 price[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]{}; - TileCoordsXYZ ChairliftBullwheelLocation[2]; + TileCoordsXYZ chairliftBullwheelLocation[2]; RatingTuple ratings{}; money64 value{}; - uint16_t chairlift_bullwheel_rotation{}; + uint16_t chairliftBullwheelRotation{}; uint8_t satisfaction{}; - uint8_t satisfaction_time_out{}; - uint8_t satisfaction_next{}; + uint8_t satisfactionTimeout{}; + uint8_t satisfactionNext{}; // Various flags stating whether a window needs to be refreshed - uint8_t window_invalidate_flags{}; - uint32_t total_customers{}; - money64 total_profit{}; + uint8_t windowInvalidateFlags{}; + uint32_t totalCustomers{}; + money64 totalProfit{}; uint8_t popularity{}; - uint8_t popularity_time_out{}; // Updated every purchase and ?possibly by time? - uint8_t popularity_next{}; // When timeout reached this will be the next popularity - uint16_t num_riders{}; - uint8_t music_tune_id{}; - uint8_t slide_in_use{}; + uint8_t popularityTimeout{}; // Updated every purchase and ?possibly by time? + uint8_t popularityNext{}; // When timeout reached this will be the next popularity + uint16_t numRiders{}; + uint8_t musicTuneId{}; + uint8_t slideInUse{}; union { - EntityId slide_peep; - uint16_t maze_tiles{}; + EntityId slidePeep; + uint16_t mazeTiles{}; }; - uint8_t slide_peep_t_shirt_colour{}; - uint8_t spiral_slide_progress{}; - int32_t build_date{}; - money64 upkeep_cost{}; - EntityId race_winner{}; - uint32_t music_position{}; - uint8_t breakdown_reason_pending{}; - uint8_t mechanic_status{}; + uint8_t slidePeepTShirtColour{}; + uint8_t spiralSlideProgress{}; + int32_t buildDate{}; + money64 upkeepCost{}; + EntityId raceWinner{}; + uint32_t musicPosition{}; + uint8_t breakdownReasonPending{}; + uint8_t mechanicStatus{}; EntityId mechanic{ EntityId::GetNull() }; - StationIndex inspection_station{ StationIndex::GetNull() }; - uint8_t broken_vehicle{}; - uint8_t broken_car{}; - uint8_t breakdown_reason{}; + StationIndex inspectionStation{ StationIndex::GetNull() }; + uint8_t brokenTrain{}; + uint8_t brokenCar{}; + uint8_t breakdownReason{}; union { struct { - uint8_t reliability_subvalue; // 0 - 255, acts like the decimals for reliability_percentage - uint8_t reliability_percentage; // Starts at 100 and decreases from there. + uint8_t reliabilitySubvalue; // 0 - 255, acts like the decimals for reliabilityPercentage + uint8_t reliabilityPercentage; // Starts at 100 and decreases from there. }; uint16_t reliability{}; }; // Small constant used to increase the unreliability as the game continues, // making breakdowns more and more likely. - uint8_t unreliability_factor{}; + uint8_t unreliabilityFactor{}; // Range from [0, 100] uint8_t downtime{}; - uint8_t inspection_interval{}; - uint8_t last_inspection{}; - uint8_t downtime_history[OpenRCT2::Limits::kDowntimeHistorySize]{}; - uint32_t no_primary_items_sold{}; - uint32_t no_secondary_items_sold{}; - uint8_t breakdown_sound_modifier{}; + uint8_t inspectionInterval{}; + uint8_t lastInspection{}; + uint8_t downtimeHistory[OpenRCT2::Limits::kDowntimeHistorySize]{}; + uint32_t numPrimaryItemsSold{}; + uint32_t numSecondaryItemsSold{}; + uint8_t breakdownSoundModifier{}; // Used to oscillate the sound when ride breaks down. // 0 = no change, 255 = max change - uint8_t not_fixed_timeout{}; - uint8_t last_crash_type{}; - uint8_t connected_message_throttle{}; - money64 income_per_hour{}; + uint8_t notFixedTimeout{}; + uint8_t lastCrashType{}; + uint8_t connectedMessageThrottle{}; + money64 incomePerHour{}; money64 profit{}; - TrackColour track_colour[kNumRideColourSchemes]{}; + TrackColour trackColours[kNumRideColourSchemes]{}; ObjectEntryIndex music{ kObjectEntryIndexNull }; - ObjectEntryIndex entrance_style{ kObjectEntryIndexNull }; - uint16_t vehicle_change_timeout{}; - uint8_t num_block_brakes{}; - uint8_t lift_hill_speed{}; - uint32_t guests_favourite{}; - uint32_t lifecycle_flags{}; + ObjectEntryIndex entranceStyle{ kObjectEntryIndexNull }; + uint16_t vehicleChangeTimeout{}; + uint8_t numBlockBrakes{}; + uint8_t liftHillSpeed{}; + uint32_t guestsFavourite{}; + uint32_t lifecycleFlags{}; uint16_t totalAirTime{}; - StationIndex current_test_station{ StationIndex::GetNull() }; - uint8_t num_circuits{}; - CoordsXYZ CableLiftLoc{}; - EntityId cable_lift{ EntityId::GetNull() }; + StationIndex currentTestStation{ StationIndex::GetNull() }; + uint8_t numCircuits{}; + CoordsXYZ cableLiftLoc{}; + EntityId cableLift{ EntityId::GetNull() }; // These two fields are used to warn users about issues. // Such issue can be hacked rides with incompatible options set. // They don't require export/import. - uint8_t current_issues{}; - uint32_t last_issue_time{}; + uint8_t currentIssues{}; + uint32_t lastIssueTime{}; // TO-DO: those friend functions are temporary, find a way to not access the private fields - friend void UpdateSpiralSlide(Ride& ride); - friend void UpdateChairlift(Ride& ride); + friend void updateSpiralSlide(Ride& ride); + friend void updateChairlift(Ride& ride); private: std::array stations{}; public: - RideStation& GetStation(StationIndex stationIndex = StationIndex::FromUnderlying(0)); - const RideStation& GetStation(StationIndex stationIndex = StationIndex::FromUnderlying(0)) const; - std::span GetStations(); - std::span GetStations() const; - StationIndex GetStationIndex(const RideStation* station) const; + RideStation& getStation(StationIndex stationIndex = StationIndex::FromUnderlying(0)); + const RideStation& getStation(StationIndex stationIndex = StationIndex::FromUnderlying(0)) const; + std::span getStations(); + std::span getStations() const; + StationIndex getStationIndex(const RideStation* station) const; // Returns the logical station number from the given station. Index 0 = station 1, index 1 = station 2. It accounts for gaps // in the station array. e.g. if only slot 0 and 2 are in use, index 2 returns 2 instead of 3. - StationIndex::UnderlyingType GetStationNumber(StationIndex in) const; + StationIndex::UnderlyingType getStationNumber(StationIndex in) const; public: uint16_t inversions{}; uint16_t holes{}; - uint8_t sheltered_eighths{}; + uint8_t shelteredEighths{}; std::unique_ptr measurement; private: - void Update(); - void UpdateQueueLength(StationIndex stationIndex); - ResultWithMessage CreateVehicles(const CoordsXYE& element, bool isApplying); - void MoveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackElement& firstBlock); - money64 CalculateIncomePerHour() const; - void ChainQueues() const; - void ConstructMissingEntranceOrExit() const; + void update(); + void updateQueueLength(StationIndex stationIndex); + ResultWithMessage createVehicles(const CoordsXYE& element, bool isApplying); + void moveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackElement& firstBlock); + money64 calculateIncomePerHour() const; + void chainQueues() const; + void constructMissingEntranceOrExit() const; - ResultWithMessage ChangeStatusDoStationChecks(StationIndex& stationIndex); - ResultWithMessage ChangeStatusGetStartElement(StationIndex stationIndex, CoordsXYE& trackElement); - ResultWithMessage ChangeStatusCheckCompleteCircuit(const CoordsXYE& trackElement); - ResultWithMessage ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement); - ResultWithMessage ChangeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement); + ResultWithMessage changeStatusDoStationChecks(StationIndex& stationIndex); + ResultWithMessage changeStatusGetStartElement(StationIndex stationIndex, CoordsXYE& trackElement); + ResultWithMessage changeStatusCheckCompleteCircuit(const CoordsXYE& trackElement); + ResultWithMessage changeStatusCheckTrackValidity(const CoordsXYE& trackElement); + ResultWithMessage changeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement); public: - bool CanBreakDown() const; - RideClassification GetClassification() const; - bool IsRide() const; - void Renew(); - void Delete(); - void Crash(uint8_t vehicleIndex); - void SetToDefaultInspectionInterval(); - void SetRideEntry(ObjectEntryIndex entryIndex); + bool canBreakDown() const; + RideClassification getClassification() const; + bool isRide() const; + void renew(); + void remove(); + void crash(uint8_t vehicleIndex); + void setToDefaultInspectionInterval(); + void setRideEntry(ObjectEntryIndex entryIndex); - void SetNumTrains(int32_t numTrains); - void SetNumCarsPerVehicle(int32_t numCarsPerVehicle); - void SetReversedTrains(bool reversedTrains); - void UpdateMaxVehicles(); - void UpdateNumberOfCircuits(); + void setNumTrains(int32_t newNumTrains); + void setNumCarsPerTrain(int32_t numCarsPerVehicle); + void setReversedTrains(bool reversedTrains); + void updateMaxVehicles(); + void updateNumberOfCircuits(); - bool HasSpinningTunnel() const; - bool HasWaterSplash() const; - bool HasRapids() const; - bool HasLogReverser() const; - bool HasWaterfall() const; - bool HasWhirlpool() const; + bool hasSpinningTunnel() const; + bool hasWaterSplash() const; + bool hasRapids() const; + bool hasLogReverser() const; + bool hasWaterfall() const; + bool hasWhirlpool() const; - bool IsPoweredLaunched() const; - bool IsBlockSectioned() const; - bool CanHaveMultipleCircuits() const; - bool SupportsStatus(RideStatus s) const; + bool isPoweredLaunched() const; + bool isBlockSectioned() const; + bool canHaveMultipleCircuits() const; + bool supportsStatus(RideStatus s) const; - void StopGuestsQueuing(); - void ValidateStations(); + void stopGuestsQueuing(); + void validateStations(); - ResultWithMessage Open(bool isApplying); - ResultWithMessage Test(bool isApplying); - ResultWithMessage Simulate(bool isApplying); + ResultWithMessage open(bool isApplying); + ResultWithMessage test(bool isApplying); + ResultWithMessage simulate(bool isApplying); - RideMode GetDefaultMode() const; + RideMode getDefaultMode() const; - void SetColourPreset(uint8_t index); + void setColourPreset(uint8_t index); - const RideObjectEntry* GetRideEntry() const; + const RideObjectEntry* getRideEntry() const; - size_t GetNumPrices() const; - int32_t GetAge() const; - int32_t GetTotalQueueLength() const; - int32_t GetMaxQueueTime() const; + size_t getNumPrices() const; + int32_t getAge() const; + int32_t getTotalQueueLength() const; + int32_t getMaxQueueTime() const; - void QueueInsertGuestAtFront(StationIndex stationIndex, Guest* peep); - Guest* GetQueueHeadGuest(StationIndex stationIndex) const; + void queueInsertGuestAtFront(StationIndex stationIndex, Guest* peep); + Guest* getQueueHeadGuest(StationIndex stationIndex) const; - void SetNameToDefault(); - std::string GetName() const; - void FormatNameTo(Formatter&) const; - void FormatStatusTo(Formatter&) const; + void setNameToDefault(); + std::string getName() const; + void formatNameTo(Formatter&) const; + void formatStatusTo(Formatter&) const; - static void UpdateAll(); - static bool NameExists(std::string_view name, RideId excludeRideId = RideId::GetNull()); + static void updateAll(); + static bool nameExists(std::string_view name, RideId excludeRideId = RideId::GetNull()); - [[nodiscard]] std::unique_ptr SaveToTrackDesign(TrackDesignState& tds) const; + [[nodiscard]] std::unique_ptr saveToTrackDesign(TrackDesignState& tds) const; - uint64_t GetAvailableModes() const; - const RideTypeDescriptor& GetRideTypeDescriptor() const; - TrackElement* GetOriginElement(StationIndex stationIndex) const; + uint64_t getAvailableModes() const; + const RideTypeDescriptor& getRideTypeDescriptor() const; + TrackElement* getOriginElement(StationIndex stationIndex) const; - std::pair GetMeasurement(); + std::pair getMeasurement(); - uint8_t GetNumShelteredSections() const; - void IncreaseNumShelteredSections(); + uint8_t getNumShelteredSections() const; + void increaseNumShelteredSections(); - void RemoveVehicles(); + void removeVehicles(); /** * Updates all pieces of the ride to match the internal ride type. (Track pieces can have different ride types from the ride * they belong to, to enable “merging”.) */ - void UpdateRideTypeForAllPieces(); + void updateRideTypeForAllPieces(); - void UpdateSatisfaction(const uint8_t happiness); - void UpdatePopularity(const uint8_t pop_amount); - void RemovePeeps(); + void updateSatisfaction(const uint8_t happiness); + void updatePopularity(const uint8_t pop_amount); + void removePeeps(); - int32_t GetTotalLength() const; - int32_t GetTotalTime() const; + int32_t getTotalLength() const; + int32_t getTotalTime() const; - const StationObject* GetStationObject() const; - const MusicObject* GetMusicObject() const; + const StationObject* getStationObject() const; + const MusicObject* getMusicObject() const; - bool HasLifecycleFlag(uint32_t flag) const; - void SetLifecycleFlag(uint32_t flag, bool on); + bool hasLifecycleFlag(uint32_t flag) const; + void setLifecycleFlag(uint32_t flag, bool on); - bool HasRecolourableShopItems() const; - bool HasStation() const; + bool hasRecolourableShopItems() const; + bool hasStation() const; - bool FindTrackGap(const CoordsXYE& input, CoordsXYE* output) const; + bool findTrackGap(const CoordsXYE& input, CoordsXYE* output) const; uint8_t getNumDrops() const; void setNumDrops(uint8_t newValue); @@ -423,8 +423,8 @@ public: uint8_t getNumPoweredLifts() const; void setPoweredLifts(uint8_t newValue); }; -void UpdateSpiralSlide(Ride& ride); -void UpdateChairlift(Ride& ride); +void updateSpiralSlide(Ride& ride); +void updateChairlift(Ride& ride); #pragma pack(push, 1) @@ -446,7 +446,7 @@ static_assert(sizeof(TrackBeginEnd) == 36); #pragma pack(pop) -// Constants used by the lifecycle_flags property at 0x1D0 +// Constants used by the lifecycleFlags property at 0x1D0 enum { RIDE_LIFECYCLE_ON_TRACK = 1 << 0, @@ -787,7 +787,7 @@ enum RIDE_INSPECTION_NEVER }; -// Flags used by ride->window_invalidate_flags +// Flags used by ride->windowInvalidateFlags enum { RIDE_INVALIDATE_RIDE_CUSTOMER = 1, @@ -806,7 +806,7 @@ enum RIDE_MEASUREMENT_FLAG_G_FORCES = 1 << 2 }; -// Constants for ride->special_track_elements +// Constants for ride->specialTrackElements enum { RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS = 1 << 5, diff --git a/src/openrct2/ride/RideAudio.cpp b/src/openrct2/ride/RideAudio.cpp index a1838c4afc..0edfc3bd84 100644 --- a/src/openrct2/ride/RideAudio.cpp +++ b/src/openrct2/ride/RideAudio.cpp @@ -208,7 +208,7 @@ namespace OpenRCT2::RideAudio { // Create new music channel auto ride = GetRide(instance.RideId); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); rtd.StartRideMusic(instance); } @@ -280,9 +280,9 @@ namespace OpenRCT2::RideAudio if (musicObj != nullptr) { auto numTracks = musicObj->GetTrackCount(); - if (ride.music_tune_id < numTracks) + if (ride.musicTuneId < numTracks) { - auto track = musicObj->GetTrack(ride.music_tune_id); + auto track = musicObj->GetTrack(ride.musicTuneId); return { track->BytesPerTick, track->Size }; } } @@ -291,22 +291,22 @@ namespace OpenRCT2::RideAudio static std::pair RideMusicGetTrackOffsetLength(const Ride& ride) { - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); return rtd.MusicTrackOffsetLength(ride); } static void RideUpdateMusicPosition(Ride& ride) { auto [trackOffset, trackLength] = RideMusicGetTrackOffsetLength(ride); - auto position = ride.music_position + trackOffset; + auto position = ride.musicPosition + trackOffset; if (position < trackLength) { - ride.music_position = position; + ride.musicPosition = position; } else { - ride.music_tune_id = kTuneIDNull; - ride.music_position = 0; + ride.musicTuneId = kTuneIDNull; + ride.musicPosition = 0; } } @@ -319,25 +319,25 @@ namespace OpenRCT2::RideAudio { auto& instance = _musicInstances.emplace_back(); instance.RideId = ride.id; - instance.TrackIndex = ride.music_tune_id; + instance.TrackIndex = ride.musicTuneId; instance.Offset = offset; instance.Volume = volume; instance.Pan = pan; instance.Frequency = sampleRate; } - ride.music_position = static_cast(offset); + ride.musicPosition = static_cast(offset); } else { - ride.music_tune_id = kTuneIDNull; - ride.music_position = 0; + ride.musicTuneId = kTuneIDNull; + ride.musicPosition = 0; } } static void RideUpdateMusicPosition(Ride& ride, int16_t volume, int16_t pan, uint16_t sampleRate) { auto foundChannel = std::find_if(_musicChannels.begin(), _musicChannels.end(), [&ride](const auto& channel) { - return channel.RideId == ride.id && channel.TrackIndex == ride.music_tune_id; + return channel.RideId == ride.id && channel.TrackIndex == ride.musicTuneId; }); auto [trackOffset, trackLength] = RideMusicGetTrackOffsetLength(ride); @@ -352,14 +352,14 @@ namespace OpenRCT2::RideAudio else { // We had a real music channel, but it isn't playing anymore, so stop the track - ride.music_position = 0; - ride.music_tune_id = kTuneIDNull; + ride.musicPosition = 0; + ride.musicTuneId = kTuneIDNull; } } else { // We do not have a real music channel, so simulate the playing of the music track - auto newOffset = ride.music_position + trackOffset; + auto newOffset = ride.musicPosition + trackOffset; RideUpdateMusicPosition(ride, newOffset, trackLength, volume, pan, sampleRate); } } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 9a6b5645d4..02a8ae56fe 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -93,22 +93,22 @@ using namespace OpenRCT2::TrackMetaData; static int32_t ride_check_if_construction_allowed(Ride& ride) { Formatter ft; - const auto* rideEntry = ride.GetRideEntry(); + const auto* rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) { ContextShowError(STR_INVALID_RIDE_TYPE, STR_CANT_EDIT_INVALID_RIDE_TYPE, ft); return 0; } - if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - ride.FormatNameTo(ft); + ride.formatNameTo(ft); ContextShowError(STR_CANT_START_CONSTRUCTION_ON, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING, ft); return 0; } if (ride.status != RideStatus::closed && ride.status != RideStatus::simulating) { - ride.FormatNameTo(ft); + ride.formatNameTo(ft); ContextShowError(STR_CANT_START_CONSTRUCTION_ON, STR_MUST_BE_CLOSED_FIRST, ft); return 0; } @@ -134,7 +134,7 @@ void RideConstructionStart(Ride& ride) CoordsXYE trackElement; if (RideTryGetOriginElement(ride, &trackElement)) { - ride.FindTrackGap(trackElement, &trackElement); + ride.findTrackGap(trackElement, &trackElement); WindowBase* w = WindowGetMain(); if (w != nullptr && RideModify(trackElement)) @@ -152,10 +152,10 @@ void RideConstructionStart(Ride& ride) */ static void ride_remove_cable_lift(Ride& ride) { - if (ride.lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT) { - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_CABLE_LIFT; - auto spriteIndex = ride.cable_lift; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_CABLE_LIFT; + auto spriteIndex = ride.cableLift; do { Vehicle* vehicle = GetEntity(spriteIndex); @@ -174,12 +174,12 @@ static void ride_remove_cable_lift(Ride& ride) * * rct2: 0x006DD506 */ -void Ride::RemoveVehicles() +void Ride::removeVehicles() { - if (lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK) { - lifecycle_flags &= ~RIDE_LIFECYCLE_ON_TRACK; - lifecycle_flags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE); + lifecycleFlags &= ~RIDE_LIFECYCLE_ON_TRACK; + lifecycleFlags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE); for (size_t i = 0; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++) { @@ -222,8 +222,8 @@ void RideClearForConstruction(Ride& ride) { ride.measurement = {}; - ride.lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride.lifecycleFlags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; // Open circuit rides will go directly into building mode (creating ghosts) where it would normally clear the stats, // however this causes desyncs since it's directly run from the window and other clients would not get it. @@ -234,7 +234,7 @@ void RideClearForConstruction(Ride& ride) } ride_remove_cable_lift(ride); - ride.RemoveVehicles(); + ride.removeVehicles(); RideClearBlockedTiles(ride); auto* windowMgr = Ui::GetWindowManager(); @@ -247,7 +247,7 @@ void RideClearForConstruction(Ride& ride) * * rct2: 0x006664DF */ -void Ride::RemovePeeps() +void Ride::removePeeps() { // Find first station auto stationIndex = RideGetFirstValidStationStart(*this); @@ -256,7 +256,7 @@ void Ride::RemovePeeps() auto exitPosition = CoordsXYZD{ 0, 0, 0, INVALID_DIRECTION }; if (!stationIndex.IsNull()) { - auto location = GetStation(stationIndex).Exit.ToCoordsXYZD(); + auto location = getStation(stationIndex).Exit.ToCoordsXYZD(); if (!location.IsNull()) { auto direction = DirectionReverse(location.direction); @@ -335,9 +335,9 @@ void Ride::RemovePeeps() peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_STATS; } } - num_riders = 0; - slide_in_use = 0; - window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN; + numRiders = 0; + slideInUse = 0; + windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN; } void RideClearBlockedTiles(const Ride& ride) @@ -545,9 +545,9 @@ static void ride_construction_reset_current_piece() if (ride == nullptr) return; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); - if (rtd.HasFlag(RtdFlag::hasTrack) || ride->num_stations == 0) + if (rtd.HasFlag(RtdFlag::hasTrack) || ride->numStations == 0) { _currentlySelectedTrack = rtd.StartTrackPiece; _currentTrackPitchEnd = TrackPitch::None; @@ -579,7 +579,7 @@ void RideConstructionSetDefaultNextPiece() if (ride == nullptr) return; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); int32_t z, direction; OpenRCT2::TrackElemType trackType; @@ -602,7 +602,7 @@ void RideConstructionSetDefaultNextPiece() tileElement = trackBeginEnd.begin_element; trackType = tileElement->AsTrack()->GetTrackType(); - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { ride_construction_reset_current_piece(); return; @@ -962,14 +962,14 @@ bool RideModify(const CoordsXYE& input) return false; } - auto rideEntry = ride->GetRideEntry(); + auto rideEntry = ride->getRideEntry(); if (rideEntry == nullptr || !ride_check_if_construction_allowed(*ride)) return false; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE && !GetGameState().Cheats.makeAllDestructible) + if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE && !GetGameState().Cheats.makeAllDestructible) { Formatter ft; - ride->FormatNameTo(ft); + ride->formatNameTo(ft); ContextShowError( STR_CANT_START_CONSTRUCTION_ON, STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE, ft); return false; @@ -988,16 +988,16 @@ bool RideModify(const CoordsXYE& input) ride_create_or_find_construction_window(rideIndex); - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { return ride_modify_maze(tileElement); } - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::cannotHaveGaps)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::cannotHaveGaps)) { CoordsXYE endOfTrackElement{}; - if (ride->FindTrackGap(tileElement, &endOfTrackElement)) + if (ride->findTrackGap(tileElement, &endOfTrackElement)) tileElement = endOfTrackElement; } @@ -1020,7 +1020,7 @@ bool RideModify(const CoordsXYE& input) _rideConstructionNextArrowPulse = 0; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) { WindowRideConstructionUpdateActiveElements(); return true; @@ -1068,20 +1068,20 @@ int32_t RideInitialiseConstructionWindow(Ride& ride) return 0; RideClearForConstruction(ride); - ride.RemovePeeps(); + ride.removePeeps(); w = ride_create_or_find_construction_window(ride.id); ToolSet(*w, WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT, Tool::crosshair); InputSetFlag(INPUT_FLAG_6, true); - _currentlySelectedTrack = ride.GetRideTypeDescriptor().StartTrackPiece; + _currentlySelectedTrack = ride.getRideTypeDescriptor().StartTrackPiece; _currentTrackPitchEnd = TrackPitch::None; _currentTrackRollEnd = TrackRoll::None; _currentTrackHasLiftHill = false; _currentTrackAlternative.clearAll(); - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::startConstructionInverted)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::startConstructionInverted)) _currentTrackAlternative.set(AlternativeTrackFlag::inverted); _previousTrackRollEnd = TrackRoll::None; @@ -1173,9 +1173,9 @@ money64 SetOperatingSettingNested(RideId rideId, RideSetSetting setting, uint8_t * * rct2: 0x006CB945 */ -void Ride::ValidateStations() +void Ride::validateStations() { - const auto& rtd = GetRideTypeDescriptor(); + const auto& rtd = getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) { // find the stations of the ride to begin stepping over track elements from @@ -1228,12 +1228,12 @@ void Ride::ValidateStations() break; } // update the StationIndex, get the TrackElement's rotation - tileElement->AsTrack()->SetStationIndex(GetStationIndex(&station)); + tileElement->AsTrack()->SetStationIndex(getStationIndex(&station)); direction = tileElement->GetDirection(); // In the future this could look at the TED and see if the station has a sequence longer than 1 // tower ride, flat ride, shop - if (GetRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation)) + if (getRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation)) { // if the track has multiple sequences, stop looking for the next one. specialTrack = true; @@ -1279,7 +1279,7 @@ void Ride::ValidateStations() break; } - tileElement->AsTrack()->SetStationIndex(GetStationIndex(&station)); + tileElement->AsTrack()->SetStationIndex(getStationIndex(&station)); } } } @@ -1381,7 +1381,7 @@ void Ride::ValidateStations() stationId = trackElement->AsTrack()->GetStationIndex(); } - auto& station = GetStation(stationId); + auto& station = getStation(stationId); if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) { // if the location is already set for this station, big problem! @@ -1473,10 +1473,10 @@ bool RideSelectForwardsFromBack() */ ResultWithMessage RideAreAllPossibleEntrancesAndExitsBuilt(const Ride& ride) { - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) return { true }; - for (auto& station : ride.GetStations()) + for (auto& station : ride.getStations()) { if (station.Start.IsNull()) { diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 3ed8be4322..58769b7d58 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -256,7 +256,7 @@ static bool ShouldSkipRatingCalculation(const Ride& ride) } // Skip rides that have a fixed rating. - if (ride.lifecycle_flags & RIDE_LIFECYCLE_FIXED_RATINGS) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_FIXED_RATINGS) { return true; } @@ -374,7 +374,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state) if (tileElement->AsTrack()->GetRideIndex() != ride->id) { // Only check that the track belongs to the same ride if ride does not have buildable track - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) continue; } @@ -385,7 +385,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state) { auto entranceIndex = tileElement->AsTrack()->GetStationIndex(); state.StationFlags &= ~RIDE_RATING_STATION_FLAG_NO_ENTRANCE; - if (ride->GetStation(entranceIndex).Entrance.IsNull()) + if (ride->getStation(entranceIndex).Entrance.IsNull()) { state.StationFlags |= RIDE_RATING_STATION_FLAG_NO_ENTRANCE; } @@ -482,7 +482,7 @@ static void ride_ratings_update_state_5(RideRatingUpdateState& state) if (tileElement->AsTrack()->GetRideIndex() != ride->id) { // Only check that the track belongs to the same ride if ride does not have buildable track - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) continue; } @@ -527,14 +527,14 @@ static void ride_ratings_begin_proximity_loop(RideRatingUpdateState& state) return; } - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { state.State = RIDE_RATINGS_STATE_CALCULATE; return; } - for (auto& station : ride->GetStations()) + for (auto& station : ride->getStations()) { if (!station.Start.IsNull()) { @@ -875,30 +875,30 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til static void RideRatingsCalculate(RideRatingUpdateState& state, Ride& ride) { - const auto& rrd = ride.GetRideTypeDescriptor().RatingsData; + const auto& rrd = ride.getRideTypeDescriptor().RatingsData; switch (rrd.Type) { case RatingsCalculationType::Normal: - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_TESTED)) return; break; case RatingsCalculationType::FlatRide: - ride.lifecycle_flags |= RIDE_LIFECYCLE_TESTED; - ride.lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS; + ride.lifecycleFlags |= RIDE_LIFECYCLE_TESTED; + ride.lifecycleFlags |= RIDE_LIFECYCLE_NO_RAW_STATS; break; case RatingsCalculationType::Stall: - ride.upkeep_cost = RideComputeUpkeep(state, ride); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; + ride.upkeepCost = RideComputeUpkeep(state, ride); + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; // Exit ratings return; } - ride.unreliability_factor = rrd.Unreliability; + ride.unreliabilityFactor = rrd.Unreliability; SetUnreliabilityFactor(ride); const auto shelteredEighths = GetNumOfShelteredEighths(ride); - ride.sheltered_eighths = (rrd.RideShelter == -1) ? shelteredEighths.TotalShelteredEighths : rrd.RideShelter; + ride.shelteredEighths = (rrd.RideShelter == -1) ? shelteredEighths.TotalShelteredEighths : rrd.RideShelter; RatingTuple ratings = rrd.BaseRatings; // Apply Modifiers @@ -1051,8 +1051,8 @@ static void RideRatingsCalculate(RideRatingUpdateState& state, Ride& ride) RideRatingsApplyAdjustments(ride, ratings); ride.ratings = ratings; - ride.upkeep_cost = RideComputeUpkeep(state, ride); - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME; + ride.upkeepCost = RideComputeUpkeep(state, ride); + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME; #ifdef ORIGINAL_RATINGS if (!ride.ratings.isNull()) @@ -1066,7 +1066,7 @@ static void RideRatingsCalculate(RideRatingUpdateState& state, Ride& ride) #ifdef ENABLE_SCRIPTING // Only call the 'ride.ratings.calculate' API hook if testing of the ride is complete - if (ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_TESTED) { auto& hookEngine = GetContext()->GetScriptEngine().GetHookEngine(); if (hookEngine.HasSubscriptions(HOOK_TYPE::RIDE_RATINGS_CALCULATE)) @@ -1137,7 +1137,7 @@ static void RideRatingsCalculateValue(Ride& ride) } // Start with the base ratings, multiplied by the ride type specific weights for excitement, intensity and nausea. - const auto& ratingsMultipliers = ride.GetRideTypeDescriptor().RatingsMultipliers; + const auto& ratingsMultipliers = ride.getRideTypeDescriptor().RatingsMultipliers; money64 value = (((ride.ratings.excitement * ratingsMultipliers.excitement) * 32) >> 15) + (((ride.ratings.intensity * ratingsMultipliers.intensity) * 32) >> 15) + (((ride.ratings.nausea * ratingsMultipliers.nausea) * 32) >> 15); @@ -1145,7 +1145,7 @@ static void RideRatingsCalculateValue(Ride& ride) int32_t monthsOld = 0; if (!GetGameState().Cheats.disableRideValueAging) { - monthsOld = ride.GetAge(); + monthsOld = ride.getAge(); } const Row* ageTable = ageTableNew; @@ -1199,21 +1199,21 @@ static void RideRatingsCalculateValue(Ride& ride) static money64 RideComputeUpkeep(RideRatingUpdateState& state, const Ride& ride) { // data stored at 0x0057E3A8, incrementing 18 bytes at a time - auto upkeep = ride.GetRideTypeDescriptor().UpkeepCosts.BaseCost; + auto upkeep = ride.getRideTypeDescriptor().UpkeepCosts.BaseCost; - auto trackCost = ride.GetRideTypeDescriptor().UpkeepCosts.CostPerTrackPiece; + auto trackCost = ride.getRideTypeDescriptor().UpkeepCosts.CostPerTrackPiece; upkeep += trackCost * ride.getNumPoweredLifts(); - uint32_t totalLength = ToHumanReadableRideLength(ride.GetTotalLength()); + uint32_t totalLength = ToHumanReadableRideLength(ride.getTotalLength()); // The data originally here was 20's and 0's. The 20's all represented // rides that had tracks. The 0's were fixed rides like crooked house or // dodgems. // Data source is 0x0097E3AC - totalLength *= ride.GetRideTypeDescriptor().UpkeepCosts.TrackLengthMultiplier; + totalLength *= ride.getRideTypeDescriptor().UpkeepCosts.TrackLengthMultiplier; upkeep += static_cast(totalLength >> 10); - if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) { // The original code read from a table starting at 0x0097E3AE and // incrementing by 0x12 bytes between values. However, all of these @@ -1232,12 +1232,12 @@ static money64 RideComputeUpkeep(RideRatingUpdateState& state, const Ride& ride) // various variables set on the ride itself. // https://gist.github.com/kevinburke/e19b803cd2769d96c540 - upkeep += ride.GetRideTypeDescriptor().UpkeepCosts.CostPerTrain * ride.NumTrains; - upkeep += ride.GetRideTypeDescriptor().UpkeepCosts.CostPerCar * ride.num_cars_per_train; + upkeep += ride.getRideTypeDescriptor().UpkeepCosts.CostPerTrain * ride.numTrains; + upkeep += ride.getRideTypeDescriptor().UpkeepCosts.CostPerCar * ride.numCarsPerTrain; // slight upkeep boosts for some rides - 5 for mini railway, 10 for log // flume/rapids, 10 for roller coaster, 28 for giga coaster - upkeep += ride.GetRideTypeDescriptor().UpkeepCosts.CostPerStation * ride.num_stations; + upkeep += ride.getRideTypeDescriptor().UpkeepCosts.CostPerStation * ride.numStations; if (ride.mode == RideMode::reverseInclineLaunchedShuttle) { @@ -1289,7 +1289,7 @@ static void RideRatingsApplyAdjustments(const Ride& ride, RatingTuple& ratings) // Apply total air time #ifdef ORIGINAL_RATINGS - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasAirTime)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasAirTime)) { uint16_t totalAirTime = ride.totalAirTime; if (rideEntry->flags & RIDE_ENTRY_FLAG_LIMIT_AIRTIME_BONUS) @@ -1308,7 +1308,7 @@ static void RideRatingsApplyAdjustments(const Ride& ride, RatingTuple& ratings) } } #else - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasAirTime)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasAirTime)) { int32_t excitementModifier; if (rideEntry->flags & RIDE_ENTRY_FLAG_LIMIT_AIRTIME_BONUS) @@ -1354,19 +1354,19 @@ static void SetUnreliabilityFactor(Ride& ride) // Special unreliability for a few ride types if (ride.type == RIDE_TYPE_COMPACT_INVERTED_COASTER && ride.mode == RideMode::reverseInclineLaunchedShuttle) { - ride.unreliability_factor += 10; + ride.unreliabilityFactor += 10; } - else if (ride.type == RIDE_TYPE_LOOPING_ROLLER_COASTER && ride.IsPoweredLaunched()) + else if (ride.type == RIDE_TYPE_LOOPING_ROLLER_COASTER && ride.isPoweredLaunched()) { - ride.unreliability_factor += 5; + ride.unreliabilityFactor += 5; } else if (ride.type == RIDE_TYPE_CHAIRLIFT) { - ride.unreliability_factor += (ride.speed * 2); + ride.unreliabilityFactor += (ride.speed * 2); } // The bigger the difference in lift speed and minimum the higher the unreliability - uint8_t minLiftSpeed = ride.GetRideTypeDescriptor().LiftData.minimum_speed; - ride.unreliability_factor += (ride.lift_hill_speed - minLiftSpeed) * 2; + uint8_t minLiftSpeed = ride.getRideTypeDescriptor().LiftData.minimum_speed; + ride.unreliabilityFactor += (ride.liftHillSpeed - minLiftSpeed) * 2; } static uint32_t get_proximity_score_helper_1(uint16_t x, uint16_t max, uint32_t multiplier) @@ -1431,8 +1431,8 @@ static uint32_t ride_ratings_get_proximity_score(RideRatingUpdateState& state) */ static ShelteredEights GetNumOfShelteredEighths(const Ride& ride) { - int32_t totalLength = ride.GetTotalLength(); - int32_t shelteredLength = ride.sheltered_length; + int32_t totalLength = ride.getTotalLength(); + int32_t shelteredLength = ride.shelteredLength; int32_t lengthEighth = totalLength / 8; int32_t lengthCounter = lengthEighth; uint8_t numShelteredEighths = 0; @@ -1545,18 +1545,18 @@ static RatingTuple get_inversions_ratings(uint16_t inversions) void SpecialTrackElementRatingsAjustment_Default(const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea) { - if (ride.HasWaterSplash()) + if (ride.hasWaterSplash()) { excitement += 50; intensity += 30; nausea += 20; } - if (ride.HasWaterfall()) + if (ride.hasWaterfall()) { excitement += 55; intensity += 30; } - if (ride.HasWhirlpool()) + if (ride.hasWhirlpool()) { excitement += 35; intensity += 20; @@ -1566,7 +1566,7 @@ void SpecialTrackElementRatingsAjustment_Default(const Ride& ride, int32_t& exci void SpecialTrackElementRatingsAjustment_GhostTrain(const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea) { - if (ride.HasSpinningTunnel()) + if (ride.hasSpinningTunnel()) { excitement += 40; intensity += 25; @@ -1576,7 +1576,7 @@ void SpecialTrackElementRatingsAjustment_GhostTrain(const Ride& ride, int32_t& e void SpecialTrackElementRatingsAjustment_LogFlume(const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea) { - if (ride.HasLogReverser()) + if (ride.hasLogReverser()) { excitement += 48; intensity += 55; @@ -1587,7 +1587,7 @@ void SpecialTrackElementRatingsAjustment_LogFlume(const Ride& ride, int32_t& exc static RatingTuple GetSpecialTrackElementsRating(uint8_t type, const Ride& ride) { int32_t excitement = 0, intensity = 0, nausea = 0; - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); rtd.SpecialElementRatingAdjustment(ride, excitement, intensity, nausea); uint8_t helixSections = RideGetHelixSections(ride); @@ -1634,7 +1634,7 @@ static RatingTuple ride_ratings_get_turns_ratings(const Ride& ride) intensity += slopedTurnsRating.intensity; nausea += slopedTurnsRating.nausea; - auto inversions = ride.GetRideTypeDescriptor().specialType == RtdSpecialType::miniGolf ? ride.holes : ride.inversions; + auto inversions = ride.getRideTypeDescriptor().specialType == RtdSpecialType::miniGolf ? ride.holes : ride.inversions; RatingTuple inversionsRating = get_inversions_ratings(inversions); excitement += inversionsRating.excitement; intensity += inversionsRating.intensity; @@ -1651,7 +1651,7 @@ static RatingTuple ride_ratings_get_turns_ratings(const Ride& ride) */ static RatingTuple ride_ratings_get_sheltered_ratings(const Ride& ride) { - int32_t shelteredLengthShifted = (ride.sheltered_length) >> 16; + int32_t shelteredLengthShifted = (ride.shelteredLength) >> 16; uint32_t shelteredLengthUpTo1000 = std::min(shelteredLengthShifted, 1000); uint32_t shelteredLengthUpTo2000 = std::min(shelteredLengthShifted, 2000); @@ -1660,22 +1660,22 @@ static RatingTuple ride_ratings_get_sheltered_ratings(const Ride& ride) int32_t intensity = (shelteredLengthUpTo2000 * 0x2666) >> 16; int32_t nausea = (shelteredLengthUpTo1000 * 0x4000) >> 16; - /*eax = (ride.var_11C * 30340) >> 16;*/ + /*eax = (ride.var11C * 30340) >> 16;*/ /*nausea += eax;*/ - if (ride.num_sheltered_sections & ShelteredSectionsBits::kBankingWhileSheltered) + if (ride.numShelteredSections & ShelteredSectionsBits::kBankingWhileSheltered) { excitement += 20; nausea += 15; } - if (ride.num_sheltered_sections & ShelteredSectionsBits::kRotatingWhileSheltered) + if (ride.numShelteredSections & ShelteredSectionsBits::kRotatingWhileSheltered) { excitement += 20; nausea += 15; } - uint8_t lowerVal = ride.GetNumShelteredSections(); + uint8_t lowerVal = ride.getNumShelteredSections(); lowerVal = std::min(lowerVal, 11); excitement += (lowerVal * 774516) >> 16; @@ -1697,29 +1697,29 @@ static RatingTuple ride_ratings_get_gforce_ratings(const Ride& ride) }; // Apply maximum positive G force factor - result.excitement += (ride.max_positive_vertical_g * 5242) >> 16; - result.intensity += (ride.max_positive_vertical_g * 52428) >> 16; - result.nausea += (ride.max_positive_vertical_g * 17039) >> 16; + result.excitement += (ride.maxPositiveVerticalG * 5242) >> 16; + result.intensity += (ride.maxPositiveVerticalG * 52428) >> 16; + result.nausea += (ride.maxPositiveVerticalG * 17039) >> 16; // Apply maximum negative G force factor - fixed16_2dp gforce = ride.max_negative_vertical_g; + fixed16_2dp gforce = ride.maxNegativeVerticalG; result.excitement += (std::clamp(gforce, -MakeRideRating(2, 50), MakeRideRating(0, 00)) * -15728) >> 16; result.intensity += ((gforce - MakeRideRating(1, 00)) * -52428) >> 16; result.nausea += ((gforce - MakeRideRating(1, 00)) * -14563) >> 16; // Apply lateral G force factor - result.excitement += (std::min(MakeRideRating(1, 50), ride.max_lateral_g) * 26214) >> 16; - result.intensity += ride.max_lateral_g; - result.nausea += (ride.max_lateral_g * 21845) >> 16; + result.excitement += (std::min(MakeRideRating(1, 50), ride.maxLateralG) * 26214) >> 16; + result.intensity += ride.maxLateralG; + result.nausea += (ride.maxLateralG * 21845) >> 16; // Very high lateral G force penalty #ifdef ORIGINAL_RATINGS - if (ride.max_lateral_g > MakeFixed16_2dp(2, 80)) + if (ride.maxLateralG > MakeFixed16_2dp(2, 80)) { result.intensity += MakeRideRating(3, 75); result.nausea += MakeRideRating(2, 00); } - if (ride.max_lateral_g > MakeFixed16_2dp(3, 10)) + if (ride.maxLateralG > MakeFixed16_2dp(3, 10)) { result.excitement /= 2; result.intensity += MakeRideRating(8, 50); @@ -1750,8 +1750,8 @@ static RatingTuple ride_ratings_get_drop_ratings(const Ride& ride) // Apply highest drop factor RideRatingsAdd( - result, ((ride.highest_drop_height * 2) * 16000) >> 16, ((ride.highest_drop_height * 2) * 32000) >> 16, - ((ride.highest_drop_height * 2) * 10240) >> 16); + result, ((ride.highestDropHeight * 2) * 16000) >> 16, ((ride.highestDropHeight * 2) * 32000) >> 16, + ((ride.highestDropHeight * 2) * 10240) >> 16); return result; } @@ -1770,20 +1770,20 @@ static int32_t ride_ratings_get_scenery_score(const Ride& ride) return 0; } - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) { - location = ride.GetStation().Entrance.ToCoordsXY(); + location = ride.getStation().Entrance.ToCoordsXY(); } else { - location = ride.GetStation(stationIndex).Start; + location = ride.getStation(stationIndex).Start; } int32_t z = TileElementHeight(location); // Check if station is underground, returns a fixed mediocre score since you can't have scenery underground - if (z > ride.GetStation(stationIndex).GetBaseZ()) + if (z > ride.getStation(stationIndex).GetBaseZ()) { return 40; } @@ -1841,13 +1841,13 @@ static void RideRatingsAdd(RatingTuple& ratings, int32_t excitement, int32_t int static void RideRatingsApplyBonusLength(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { RideRatingsAdd( - ratings, (std::min(ToHumanReadableRideLength(ride.GetTotalLength()), modifier.threshold) * modifier.excitement) >> 16, + ratings, (std::min(ToHumanReadableRideLength(ride.getTotalLength()), modifier.threshold) * modifier.excitement) >> 16, 0, 0); } static void RideRatingsApplyBonusSynchronisation(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if ((ride.depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) && RideHasAdjacentStation(ride)) + if ((ride.departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) && RideHasAdjacentStation(ride)) { RideRatingsAdd(ratings, modifier.excitement, modifier.intensity, modifier.nausea); } @@ -1855,12 +1855,12 @@ static void RideRatingsApplyBonusSynchronisation(RatingTuple& ratings, const Rid static void RideRatingsApplyBonusTrainLength(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - RideRatingsAdd(ratings, ((ride.num_cars_per_train - 1) * modifier.excitement) >> 16, 0, 0); + RideRatingsAdd(ratings, ((ride.numCarsPerTrain - 1) * modifier.excitement) >> 16, 0, 0); } static void RideRatingsApplyBonusMaxSpeed(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - int32_t maxSpeedMod = ride.max_speed >> 16; + int32_t maxSpeedMod = ride.maxSpeed >> 16; RideRatingsAdd( ratings, (maxSpeedMod * modifier.excitement) >> 16, (maxSpeedMod * modifier.intensity) >> 16, (maxSpeedMod * modifier.nausea) >> 16); @@ -1868,13 +1868,13 @@ static void RideRatingsApplyBonusMaxSpeed(RatingTuple& ratings, const Ride& ride static void RideRatingsApplyBonusAverageSpeed(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - int32_t avgSpeedMod = ride.average_speed >> 16; + int32_t avgSpeedMod = ride.averageSpeed >> 16; RideRatingsAdd(ratings, (avgSpeedMod * modifier.excitement) >> 16, (avgSpeedMod * modifier.intensity) >> 16, 0); } static void RideRatingsApplyBonusDuration(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - RideRatingsAdd(ratings, (std::min(ride.GetTotalTime(), modifier.threshold) * modifier.excitement) >> 16, 0, 0); + RideRatingsAdd(ratings, (std::min(ride.getTotalTime(), modifier.threshold) * modifier.excitement) >> 16, 0, 0); } static void RideRatingsApplyBonusGForces(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) @@ -1917,14 +1917,14 @@ static void RideRatingsApplyBonusRotations(RatingTuple& ratings, const Ride& rid static void RideRatingsApplyBonusOperationOption(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - int32_t intensity = (modifier.intensity >= 0) ? (ride.operation_option * modifier.intensity) - : (ride.operation_option / std::abs(modifier.intensity)); - RideRatingsAdd(ratings, ride.operation_option * modifier.excitement, intensity, ride.operation_option * modifier.nausea); + int32_t intensity = (modifier.intensity >= 0) ? (ride.operationOption * modifier.intensity) + : (ride.operationOption / std::abs(modifier.intensity)); + RideRatingsAdd(ratings, ride.operationOption * modifier.excitement, intensity, ride.operationOption * modifier.nausea); } static void RideRatingsApplyBonusReversedTrains(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) + if (ride.hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) { RideRatingsAdd( ratings, ((ratings.excitement * modifier.excitement) >> 7), (ratings.intensity * modifier.intensity) >> 7, @@ -1934,18 +1934,18 @@ static void RideRatingsApplyBonusReversedTrains(RatingTuple& ratings, const Ride static void RideRatingsApplyBonusGoKartRace(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.mode == RideMode::race && ride.NumTrains >= modifier.threshold) + if (ride.mode == RideMode::race && ride.numTrains >= modifier.threshold) { RideRatingsAdd(ratings, modifier.excitement, modifier.intensity, modifier.nausea); - int32_t lapsFactor = (ride.NumLaps - 1) * 30; + int32_t lapsFactor = (ride.numLaps - 1) * 30; RideRatingsAdd(ratings, lapsFactor, lapsFactor / 2, 0); } } static void RideRatingsApplyBonusTowerRide(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - int32_t lengthFactor = ToHumanReadableRideLength(ride.GetTotalLength()); + int32_t lengthFactor = ToHumanReadableRideLength(ride.getTotalLength()); RideRatingsAdd( ratings, (lengthFactor * modifier.excitement) >> 16, (lengthFactor * modifier.intensity) >> 16, (lengthFactor * modifier.nausea) >> 16); @@ -1953,20 +1953,20 @@ static void RideRatingsApplyBonusTowerRide(RatingTuple& ratings, const Ride& rid static void RideRatingsApplyBonusRotoDrop(RatingTuple& ratings, const Ride& ride) { - int32_t lengthFactor = (ToHumanReadableRideLength(ride.GetTotalLength()) * 209715) >> 16; + int32_t lengthFactor = (ToHumanReadableRideLength(ride.getTotalLength()) * 209715) >> 16; RideRatingsAdd(ratings, lengthFactor, lengthFactor * 2, lengthFactor * 2); } static void RideRatingsApplyBonusMazeSize(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - int32_t size = std::min(ride.maze_tiles, modifier.threshold); + int32_t size = std::min(ride.mazeTiles, modifier.threshold); RideRatingsAdd(ratings, size * modifier.excitement, size * modifier.intensity, size * modifier.nausea); } static void RideRatingsApplyBonusBoatHireNoCircuit(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { // Most likely checking if the ride has does not have a circuit - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_TESTED)) { RideRatingsAdd(ratings, modifier.excitement, modifier.intensity, modifier.nausea); } @@ -2047,7 +2047,7 @@ static void RideRatingsApplyBonusNumTrains(RatingTuple& ratings, const Ride& rid { // For some reason the original code ran this twice, before and after the operation option bonus // Has been changed to call once with double value - if (ride.NumTrains >= modifier.threshold) + if (ride.numTrains >= modifier.threshold) { RideRatingsAdd(ratings, modifier.excitement, modifier.intensity, modifier.nausea); } @@ -2064,14 +2064,14 @@ static void RideRatingsApplyBonusDownwardLaunch(RatingTuple& ratings, const Ride static void RideRatingsApplyBonusOperationOptionFreefall(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { RideRatingsAdd( - ratings, (ride.operation_option * modifier.excitement) >> 16, (ride.operation_option * modifier.intensity) >> 16, - (ride.operation_option * modifier.nausea) >> 16); + ratings, (ride.operationOption * modifier.excitement) >> 16, (ride.operationOption * modifier.intensity) >> 16, + (ride.operationOption * modifier.nausea) >> 16); } static void RideRatingsApplyBonusLaunchedFreefallSpecial( RatingTuple& ratings, const Ride& ride, RideRatingUpdateState& state, RatingsModifier modifier) { - int32_t excitement = (ToHumanReadableRideLength(ride.GetTotalLength()) * 32768) >> 16; + int32_t excitement = (ToHumanReadableRideLength(ride.getTotalLength()) * 32768) >> 16; RideRatingsAdd(ratings, excitement, 0, 0); #ifdef ORIGINAL_RATINGS @@ -2087,7 +2087,7 @@ static void RideRatingsApplyBonusLaunchedFreefallSpecial( // Fix #3282: When the ride mode is in downward launch mode, the intensity and // nausea were fixed regardless of how high the ride is. The following // calculation is based on roto-drop which is a similar mechanic. - int32_t lengthFactor = (ToHumanReadableRideLength(ride.GetTotalLength()) * 209715) >> 16; + int32_t lengthFactor = (ToHumanReadableRideLength(ride.getTotalLength()) * 209715) >> 16; RideRatingsAdd(ratings, lengthFactor, lengthFactor * 2, lengthFactor * 2); } #endif @@ -2106,7 +2106,7 @@ static void RideRatingsApplyBonusScenery(RatingTuple& ratings, const Ride& ride, static void RideRatingsApplyRequirementLength(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.GetStation().SegmentLength < modifier.threshold) + if (ride.getStation().SegmentLength < modifier.threshold) { ratings.excitement /= modifier.excitement; ratings.intensity /= modifier.intensity; @@ -2116,7 +2116,7 @@ static void RideRatingsApplyRequirementLength(RatingTuple& ratings, const Ride& static void RideRatingsApplyRequirementDropHeight(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.highest_drop_height < modifier.threshold) + if (ride.highestDropHeight < modifier.threshold) { ratings.excitement /= modifier.excitement; ratings.intensity /= modifier.intensity; @@ -2126,7 +2126,7 @@ static void RideRatingsApplyRequirementDropHeight(RatingTuple& ratings, const Ri static void RideRatingsApplyRequirementMaxSpeed(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.max_speed < modifier.threshold) + if (ride.maxSpeed < modifier.threshold) { ratings.excitement /= modifier.excitement; ratings.intensity /= modifier.intensity; @@ -2146,7 +2146,7 @@ static void RideRatingsApplyRequirementNumDrops(RatingTuple& ratings, const Ride static void RideRatingsApplyRequirementNegativeGs(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.max_negative_vertical_g >= modifier.threshold) + if (ride.maxNegativeVerticalG >= modifier.threshold) { ratings.excitement /= modifier.excitement; ratings.intensity /= modifier.intensity; @@ -2156,7 +2156,7 @@ static void RideRatingsApplyRequirementNegativeGs(RatingTuple& ratings, const Ri static void RideRatingsApplyRequirementLateralGs(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.max_lateral_g < modifier.threshold) + if (ride.maxLateralG < modifier.threshold) { ratings.excitement /= modifier.excitement; ratings.intensity /= modifier.intensity; @@ -2208,7 +2208,7 @@ static void RideRatingsApplyRequirementHoles(RatingTuple& ratings, const Ride& r static void RideRatingsApplyRequirementStations(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (ride.num_stations <= modifier.threshold) + if (ride.numStations <= modifier.threshold) { // Excitement is set to 0 in original code - this could be changed for consistency ratings.excitement = 0; @@ -2219,7 +2219,7 @@ static void RideRatingsApplyRequirementStations(RatingTuple& ratings, const Ride static void RideRatingsApplyRequirementSplashdown(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier) { - if (!(ride.special_track_elements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS)) + if (!(ride.specialTrackElements & RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS)) { ratings.excitement /= modifier.excitement; ratings.intensity /= modifier.intensity; @@ -2231,23 +2231,23 @@ static void RideRatingsApplyRequirementSplashdown(RatingTuple& ratings, const Ri static RatingTuple ride_ratings_get_excessive_lateral_g_penalty(const Ride& ride) { RatingTuple result{}; - if (ride.max_lateral_g > MakeFixed16_2dp(2, 80)) + if (ride.maxLateralG > MakeFixed16_2dp(2, 80)) { result.intensity = MakeRideRating(3, 75); result.nausea = MakeRideRating(2, 00); } - if (ride.max_lateral_g > MakeFixed16_2dp(3, 10)) + if (ride.maxLateralG > MakeFixed16_2dp(3, 10)) { // Remove half of the ride_ratings_get_gforce_ratings - result.excitement = (ride.max_positive_vertical_g * 5242) >> 16; + result.excitement = (ride.maxPositiveVerticalG * 5242) >> 16; // Apply maximum negative G force factor - fixed16_2dp gforce = ride.max_negative_vertical_g; + fixed16_2dp gforce = ride.maxNegativeVerticalG; result.excitement += (std::clamp(gforce, -MakeRideRating(2, 50), MakeRideRating(0, 00)) * -15728) >> 16; // Apply lateral G force factor - result.excitement += (std::min(MakeRideRating(1, 50), ride.max_lateral_g) * 26214) >> 16; + result.excitement += (std::min(MakeRideRating(1, 50), ride.maxLateralG) * 26214) >> 16; // Remove half of the ride_ratings_get_gforce_ratings result.excitement /= 2; diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index d42097ee1b..36ad580512 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -122,7 +122,7 @@ money64 ShopItemGetCommonPrice(Ride* forRide, const ShopItem shopItem) { if (&ride != forRide) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry == nullptr) { continue; @@ -135,7 +135,7 @@ money64 ShopItemGetCommonPrice(Ride* forRide, const ShopItem shopItem) { return ride.price[1]; } - if (GetShopItemDescriptor(shopItem).IsPhoto() && (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) + if (GetShopItemDescriptor(shopItem).IsPhoto() && (ride.lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) { return ride.price[1]; } diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 3d89a439cd..a2498f424e 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -34,7 +34,7 @@ static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bo */ void RideUpdateStation(Ride& ride, StationIndex stationIndex) { - if (ride.GetStation(stationIndex).Start.IsNull()) + if (ride.getStation(stationIndex).Start.IsNull()) return; switch (ride.mode) @@ -62,9 +62,9 @@ void RideUpdateStation(Ride& ride, StationIndex stationIndex) static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex) { TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex); - auto& station = ride.GetStation(stationIndex); + auto& station = ride.getStation(stationIndex); - if ((ride.status == RideStatus::closed && ride.num_riders == 0) + if ((ride.status == RideStatus::closed && ride.numRiders == 0) || (tileElement != nullptr && tileElement->AsTrack()->IsBrakeClosed())) { station.Depart &= ~kStationDepartFlag; @@ -92,21 +92,21 @@ static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex) */ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) { - auto& station = ride.GetStation(stationIndex); + auto& station = ride.getStation(stationIndex); // Change of station depart flag should really call invalidate_station_start // but since dodgems do not have station lights there is no point. - if (ride.status == RideStatus::closed || (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))) + if (ride.status == RideStatus::closed || (ride.lifecycleFlags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))) { station.Depart &= ~kStationDepartFlag; return; } - if (ride.lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) { - int32_t dx = ride.time_limit * 32; + int32_t dx = ride.timeLimit * 32; int32_t dh = (dx >> 8) & 0xFF; - for (size_t i = 0; i < ride.NumTrains; i++) + for (size_t i = 0; i < ride.numTrains; i++) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle == nullptr) @@ -116,7 +116,7 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) continue; // End match - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; station.Depart &= ~kStationDepartFlag; return; } @@ -127,7 +127,7 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) else { // Check if all vehicles are ready to go - for (size_t i = 0; i < ride.NumTrains; i++) + for (size_t i = 0; i < ride.numTrains; i++) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle == nullptr) @@ -141,9 +141,9 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) } // Begin the match - ride.lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; + ride.lifecycleFlags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; station.Depart |= kStationDepartFlag; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } @@ -153,11 +153,11 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) */ static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex) { - auto& station = ride.GetStation(stationIndex); + auto& station = ride.getStation(stationIndex); int32_t time = station.Depart & kStationDepartMask; const auto currentTicks = GetGameState().CurrentTicks; - if ((ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) - || (ride.status == RideStatus::closed && ride.num_riders == 0)) + if ((ride.lifecycleFlags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + || (ride.status == RideStatus::closed && ride.numRiders == 0)) { if (time != 0 && time != 127 && !(currentTicks & 7)) time--; @@ -189,8 +189,8 @@ static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex) */ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) { - auto& station = ride.GetStation(stationIndex); - if (ride.status == RideStatus::closed || (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))) + auto& station = ride.getStation(stationIndex); + if (ride.status == RideStatus::closed || (ride.lifecycleFlags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))) { if (station.Depart & kStationDepartFlag) { @@ -200,11 +200,11 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) return; } - if (ride.lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) { - int32_t numLaps = ride.NumLaps; + int32_t numLaps = ride.numLaps; - for (size_t i = 0; i < ride.NumTrains; i++) + for (size_t i = 0; i < ride.numTrains; i++) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle == nullptr) @@ -218,13 +218,13 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) auto* peep = GetEntity(vehicle->peep[0]); if (peep != nullptr) { - ride.race_winner = peep->Id; - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride.raceWinner = peep->Id; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } // Race is over - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; if (station.Depart & kStationDepartFlag) { station.Depart &= ~kStationDepartFlag; @@ -240,7 +240,7 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) else { // Check if all vehicles are ready to go - for (size_t i = 0; i < ride.NumTrains; i++) + for (size_t i = 0; i < ride.numTrains; i++) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle == nullptr) @@ -259,13 +259,13 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) // Begin the race RideRaceInitVehicleSpeeds(ride); - ride.lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; + ride.lifecycleFlags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; if (!(station.Depart & kStationDepartFlag)) { station.Depart |= kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, true); } - ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } @@ -277,7 +277,7 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) */ static void RideRaceInitVehicleSpeeds(const Ride& ride) { - for (size_t i = 0; i < ride.NumTrains; i++) + for (size_t i = 0; i < ride.numTrains; i++) { Vehicle* vehicle = GetEntity(ride.vehicles[i]); if (vehicle == nullptr) @@ -325,7 +325,7 @@ static void RideRaceInitVehicleSpeeds(const Ride& ride) */ static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight) { - auto startPos = ride.GetStation(stationIndex).Start; + auto startPos = ride.getStation(stationIndex).Start; TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex); // If no station track found return @@ -340,7 +340,7 @@ static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bo TileElement* RideGetStationStartTrackElement(const Ride& ride, StationIndex stationIndex) { - auto stationStart = ride.GetStation(stationIndex).GetStart(); + auto stationStart = ride.getStation(stationIndex).GetStart(); // Find the station track element TileElement* tileElement = MapGetFirstElementAt(stationStart); @@ -375,11 +375,11 @@ TileElement* RideGetStationExitElement(const CoordsXYZ& elementPos) StationIndex RideGetFirstValidStationExit(const Ride& ride) { - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { if (!station.Exit.IsNull()) { - return ride.GetStationIndex(&station); + return ride.getStationIndex(&station); } } return StationIndex::GetNull(); @@ -387,11 +387,11 @@ StationIndex RideGetFirstValidStationExit(const Ride& ride) StationIndex RideGetFirstValidStationStart(const Ride& ride) { - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { if (!station.Start.IsNull()) { - return ride.GetStationIndex(&station); + return ride.getStationIndex(&station); } } return StationIndex::GetNull(); @@ -399,11 +399,11 @@ StationIndex RideGetFirstValidStationStart(const Ride& ride) StationIndex RideGetFirstEmptyStationStart(const Ride& ride) { - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { if (station.Start.IsNull()) { - return ride.GetStationIndex(&station); + return ride.getStationIndex(&station); } } return StationIndex::GetNull(); diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 8e41fe2f1f..25c9056a9b 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -98,13 +98,13 @@ static TileElement* find_station_element(const CoordsXYZD& loc, RideId rideIndex static void ride_remove_station(Ride& ride, const CoordsXYZ& location) { - for (auto& station : ride.GetStations()) + for (auto& station : ride.getStations()) { auto stationStart = station.GetStart(); if (stationStart == location) { station.Start.SetNull(); - ride.num_stations--; + ride.numStations--; break; } } @@ -124,9 +124,9 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 CoordsXY stationFrontLoc = loc; int32_t stationLength = 1; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation)) { - if (ride->num_stations >= Limits::kMaxStationsPerRide) + if (ride->numStations >= Limits::kMaxStationsPerRide) { return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } @@ -135,13 +135,13 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 auto stationIndex = RideGetFirstEmptyStationStart(*ride); assert(!stationIndex.IsNull()); - auto& station = ride->GetStation(stationIndex); + auto& station = ride->getStation(stationIndex); station.Start.x = loc.x; station.Start.y = loc.y; station.Height = loc.z / kCoordsZStep; station.Depart = 1; station.Length = 0; - ride->num_stations++; + ride->numStations++; } return { true }; } @@ -195,7 +195,7 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 // When attempting to place a track design, it sometimes happens that the front and back of station 0 are built, // but the middle is not. Allow this, so the track place function can actually finish building all 4 stations. // This _might_ cause issues if the track designs is bugged and actually has 5. - if (stationBackLoc == stationFrontLoc && ride->num_stations >= Limits::kMaxStationsPerRide && !fromTrackDesign) + if (stationBackLoc == stationFrontLoc && ride->numStations >= Limits::kMaxStationsPerRide && !fromTrackDesign) { return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } @@ -227,12 +227,12 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 } else { - auto& station = ride->GetStation(stationIndex); + auto& station = ride->getStation(stationIndex); station.Start = loc; station.Height = loc.z / kCoordsZStep; station.Depart = 1; station.Length = stationLength; - ride->num_stations++; + ride->numStations++; } targetTrackType = TrackElemType::EndStation; @@ -276,7 +276,7 @@ ResultWithMessage TrackRemoveStationElement(const CoordsXYZD& loc, RideId rideIn int32_t stationLength = 0; int32_t ByteF441D1 = -1; - if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation)) + if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasSinglePieceStation)) { TileElement* tileElement = MapGetTrackElementAtWithDirectionFromRide(loc, rideIndex); if (tileElement != nullptr) @@ -332,8 +332,7 @@ ResultWithMessage TrackRemoveStationElement(const CoordsXYZD& loc, RideId rideIn if (!(flags & GAME_COMMAND_FLAG_APPLY)) { - if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc) - && ride->num_stations >= Limits::kMaxStationsPerRide) + if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc) && ride->numStations >= Limits::kMaxStationsPerRide) { return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } @@ -362,12 +361,12 @@ ResultWithMessage TrackRemoveStationElement(const CoordsXYZD& loc, RideId rideIn } else { - auto& station = ride->GetStation(stationIndex); + auto& station = ride->getStation(stationIndex); station.Start = currentLoc; station.Height = currentLoc.z / kCoordsZStep; station.Depart = 1; station.Length = stationLength != 0 ? stationLength : ByteF441D1; - ride->num_stations++; + ride->numStations++; } stationLength = 0; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index df0ada0c47..809bd45526 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -105,7 +105,7 @@ static void TrackDesignPreviewClearMap(); static u8string_view TrackDesignGetStationObjectIdentifier(const Ride& ride) { - const auto* stationObject = ride.GetStationObject(); + const auto* stationObject = ride.getStationObject(); if (stationObject == nullptr) return ""; @@ -133,38 +133,38 @@ ResultWithMessage TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ri for (size_t i = 0; i < std::size(appearance.vehicleColours); i++) { - appearance.vehicleColours[i] = ride.vehicle_colours[i]; + appearance.vehicleColours[i] = ride.vehicleColours[i]; } - for (size_t i = 0; i < std::min(std::size(ride.track_colour), std::size(appearance.trackColours)); i++) + for (size_t i = 0; i < std::min(std::size(ride.trackColours), std::size(appearance.trackColours)); i++) { - appearance.trackColours[i] = ride.track_colour[i]; + appearance.trackColours[i] = ride.trackColours[i]; } - operation.departFlags = ride.depart_flags; - trackAndVehicle.numberOfTrains = ride.NumTrains; - trackAndVehicle.numberOfCarsPerTrain = ride.num_cars_per_train; - operation.minWaitingTime = ride.min_waiting_time; - operation.maxWaitingTime = ride.max_waiting_time; - operation.operationSetting = ride.operation_option; - operation.liftHillSpeed = ride.lift_hill_speed; - operation.numCircuits = ride.num_circuits; + operation.departFlags = ride.departFlags; + trackAndVehicle.numberOfTrains = ride.numTrains; + trackAndVehicle.numberOfCarsPerTrain = ride.numCarsPerTrain; + operation.minWaitingTime = ride.minWaitingTime; + operation.maxWaitingTime = ride.maxWaitingTime; + operation.operationSetting = ride.operationOption; + operation.liftHillSpeed = ride.liftHillSpeed; + operation.numCircuits = ride.numCircuits; appearance.stationObjectIdentifier = TrackDesignGetStationObjectIdentifier(ride); - statistics.maxSpeed = static_cast(ride.max_speed / 65536); - statistics.averageSpeed = static_cast(ride.average_speed / 65536); - statistics.rideLength = ToHumanReadableRideLength(ride.GetTotalLength()); - statistics.maxPositiveVerticalG = ride.max_positive_vertical_g; - statistics.maxNegativeVerticalG = ride.max_negative_vertical_g; - statistics.maxLateralG = ride.max_lateral_g; + statistics.maxSpeed = static_cast(ride.maxSpeed / 65536); + statistics.averageSpeed = static_cast(ride.averageSpeed / 65536); + statistics.rideLength = ToHumanReadableRideLength(ride.getTotalLength()); + statistics.maxPositiveVerticalG = ride.maxPositiveVerticalG; + statistics.maxNegativeVerticalG = ride.maxNegativeVerticalG; + statistics.maxLateralG = ride.maxLateralG; statistics.inversions = ride.inversions; statistics.holes = ride.holes; statistics.drops = ride.getNumDrops(); - statistics.highestDropHeight = ride.highest_drop_height; + statistics.highestDropHeight = ride.highestDropHeight; statistics.totalAirTime = ride.totalAirTime; statistics.ratings = ride.ratings; - statistics.upkeepCost = ride.upkeep_cost; + statistics.upkeepCost = ride.upkeepCost; const auto& rtd = GetRideTypeDescriptor(trackAndVehicle.rtdIndex); @@ -241,7 +241,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con if (element->HasChain()) track.SetFlag(TrackDesignTrackElementFlag::hasChain); - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasInvertedVariant) && element->IsInverted()) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasInvertedVariant) && element->IsInverted()) { track.SetFlag(TrackDesignTrackElementFlag::isInverted); } @@ -275,7 +275,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con // First entrances, second exits for (int32_t i = 0; i < 2; i++) { - for (const auto& station : ride.GetStations()) + for (const auto& station : ride.getStations()) { z = station.GetBaseZ(); @@ -396,7 +396,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, cons x = 0; } - auto location = ride.GetStation().Entrance; + auto location = ride.getStation().Entrance; if (location.IsNull()) { return { false, STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY }; @@ -423,7 +423,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, cons mazeEntrance.isExit = false; entranceElements.push_back(mazeEntrance); - location = ride.GetStation().Exit; + location = ride.getStation().Exit; if (location.IsNull()) { return { false, STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY }; @@ -1713,8 +1713,8 @@ static GameActions::Result TrackDesignPlaceRide( if (tds.placeOperation == TrackPlaceOperation::removeGhost) { - ride.ValidateStations(); - ride.Delete(); + ride.validateStations(); + ride.remove(); } auto res = GameActions::Result(); @@ -1892,26 +1892,26 @@ static bool TrackDesignPlacePreview( if (ride == nullptr) return false; - ride->custom_name = {}; + ride->customName = {}; - ride->entrance_style = objManager.GetLoadedObjectEntryIndex(td.appearance.stationObjectIdentifier); - if (ride->entrance_style == kObjectEntryIndexNull) + ride->entranceStyle = objManager.GetLoadedObjectEntryIndex(td.appearance.stationObjectIdentifier); + if (ride->entranceStyle == kObjectEntryIndexNull) { - ride->entrance_style = gameState.LastEntranceStyle; + ride->entranceStyle = gameState.LastEntranceStyle; } - for (size_t i = 0; i < std::min(std::size(ride->track_colour), std::size(td.appearance.trackColours)); i++) + for (size_t i = 0; i < std::min(std::size(ride->trackColours), std::size(td.appearance.trackColours)); i++) { - ride->track_colour[i] = td.appearance.trackColours[i]; + ride->trackColours[i] = td.appearance.trackColours[i]; } // Flat rides need their vehicle colours loaded for display // in the preview window if (!GetRideTypeDescriptor(td.trackAndVehicle.rtdIndex).HasFlag(RtdFlag::hasTrack)) { - for (size_t i = 0; i < std::size(ride->vehicle_colours); i++) + for (size_t i = 0; i < std::size(ride->vehicleColours); i++) { - ride->vehicle_colours[i] = td.appearance.vehicleColours[i]; + ride->vehicleColours[i] = td.appearance.vehicleColours[i]; } } @@ -1963,7 +1963,7 @@ static bool TrackDesignPlacePreview( } _currentTrackPieceDirection = backup_rotation; - ride->Delete(); + ride->remove(); _trackDesignDrawingPreview = false; return false; } @@ -2141,7 +2141,7 @@ void TrackDesignDrawPreview(TrackDesign& td, uint8_t* pixels) dpi.bits += kTrackPreviewImageSize; } - ride->Delete(); + ride->remove(); UnstashMap(); } diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 0006cbb845..66cde62334 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -99,7 +99,7 @@ enum bool TrackPaintUtilHasFence( enum edge_t edge, const CoordsXY& position, const TrackElement& trackElement, const Ride& ride, uint8_t rotation) { - const auto* stationObject = ride.GetStationObject(); + const auto* stationObject = ride.getStationObject(); if (stationObject != nullptr && stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) return false; @@ -122,7 +122,7 @@ bool TrackPaintUtilHasFence( auto entranceLoc = TileCoordsXY(position) + offset; auto entranceId = trackElement.GetStationIndex(); - const auto& station = ride.GetStation(entranceId); + const auto& station = ride.getStation(entranceId); return (entranceLoc != station.Entrance && entranceLoc != station.Exit); } @@ -223,7 +223,7 @@ static void TrackPaintUtilDrawStationImpl( const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { CoordsXY position = session.MapPosition; - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); const bool hasGreenLight = trackElement.HasGreenLight(); if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -430,7 +430,7 @@ void TrackPaintUtilDrawStationInverted( uint8_t stationVariant) { CoordsXY position = session.MapPosition; - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); const bool hasGreenLight = trackElement.HasGreenLight(); if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -705,7 +705,7 @@ void TrackPaintUtilDrawNarrowStationPlatform( const TrackElement& trackElement) { CoordsXY position = session.MapPosition; - const auto* stationObj = ride.GetStationObject(); + const auto* stationObj = ride.getStationObject(); if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) return; auto colour = GetStationColourScheme(session, trackElement); @@ -1958,7 +1958,7 @@ void PaintTrack(PaintSession& session, Direction direction, int32_t height, cons const auto& ted = GetTrackElementDescriptor(trackType); if (ted.heightMarkerPositions & (1 << trackSequence)) { - uint16_t ax = ride->GetRideTypeDescriptor().Heights.VehicleZOffset; + uint16_t ax = ride->getRideTypeDescriptor().Heights.VehicleZOffset; // 0x1689 represents 0 height there are -127 to 128 heights above and below it // There are 3 arrays of 256 heights (units, m, ft) chosen with the GetHeightMarkerOffset() auto heightNum = (height + 8) / 16 - kMapBaseZ; @@ -1971,12 +1971,12 @@ void PaintTrack(PaintSession& session, Direction direction, int32_t height, cons if (LightFx::IsAvailable()) { uint8_t zOffset = 16; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::toilet || rtd.specialType == RtdSpecialType::firstAid || rtd.specialType == RtdSpecialType::cashMachine) zOffset = 23; - const auto* originElement = ride->GetOriginElement(StationIndex::FromUnderlying(0)); + const auto* originElement = ride->getOriginElement(StationIndex::FromUnderlying(0)); if (originElement != nullptr && originElement->GetTrackType() == TrackElemType::FlatTrack1x1B) LightFx::AddKioskLights(session.MapPosition, height, zOffset); else if (kRideTypeDescriptors[ride->type].HasFlag(RtdFlag::isShopOrFacility)) @@ -1985,9 +1985,9 @@ void PaintTrack(PaintSession& session, Direction direction, int32_t height, cons session.InteractionType = ViewportInteractionItem::Ride; session.TrackColours = ImageId( - 0, ride->track_colour[trackColourScheme].main, ride->track_colour[trackColourScheme].additional); + 0, ride->trackColours[trackColourScheme].main, ride->trackColours[trackColourScheme].additional); session.SupportColours = ImageId( - 0, ride->track_colour[trackColourScheme].supports, ride->track_colour[trackColourScheme].additional); + 0, ride->trackColours[trackColourScheme].supports, ride->trackColours[trackColourScheme].additional); if (trackElement.IsHighlighted() || session.SelectedElement == reinterpret_cast(&trackElement)) { session.TrackColours = HighlightMarker; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 93e8745e92..327f0362e0 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -634,26 +634,26 @@ bool Vehicle::CloseRestraints() vehicle = GetEntity(vehicle->next_vehicle_on_train)) { if (vehicle->HasFlag(VehicleFlags::CarIsBroken) && vehicle->restraints_position != 0 - && (curRide->breakdown_reason_pending == BREAKDOWN_RESTRAINTS_STUCK_OPEN - || curRide->breakdown_reason_pending == BREAKDOWN_DOORS_STUCK_OPEN)) + && (curRide->breakdownReasonPending == BREAKDOWN_RESTRAINTS_STUCK_OPEN + || curRide->breakdownReasonPending == BREAKDOWN_DOORS_STUCK_OPEN)) { - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { - curRide->lifecycle_flags |= RIDE_LIFECYCLE_BROKEN_DOWN; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_BROKEN_DOWN; RideBreakdownAddNewsItem(*curRide); - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE; - curRide->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; + curRide->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; - Vehicle* broken_vehicle = GetEntity(curRide->vehicles[curRide->broken_vehicle]); + Vehicle* broken_vehicle = GetEntity(curRide->vehicles[curRide->brokenTrain]); if (broken_vehicle != nullptr) { - curRide->inspection_station = broken_vehicle->current_station; + curRide->inspectionStation = broken_vehicle->current_station; } - curRide->breakdown_reason = curRide->breakdown_reason_pending; + curRide->breakdownReason = curRide->breakdownReasonPending; } } else @@ -750,26 +750,26 @@ bool Vehicle::OpenRestraints() } if (vehicle->HasFlag(VehicleFlags::CarIsBroken) && vehicle->restraints_position != 0xFF - && (curRide->breakdown_reason_pending == BREAKDOWN_RESTRAINTS_STUCK_CLOSED - || curRide->breakdown_reason_pending == BREAKDOWN_DOORS_STUCK_CLOSED)) + && (curRide->breakdownReasonPending == BREAKDOWN_RESTRAINTS_STUCK_CLOSED + || curRide->breakdownReasonPending == BREAKDOWN_DOORS_STUCK_CLOSED)) { - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { - curRide->lifecycle_flags |= RIDE_LIFECYCLE_BROKEN_DOWN; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_BROKEN_DOWN; RideBreakdownAddNewsItem(*curRide); - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE; - curRide->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; + curRide->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; - Vehicle* broken_vehicle = GetEntity(curRide->vehicles[curRide->broken_vehicle]); + Vehicle* broken_vehicle = GetEntity(curRide->vehicles[curRide->brokenTrain]); if (broken_vehicle != nullptr) { - curRide->inspection_station = broken_vehicle->current_station; + curRide->inspectionStation = broken_vehicle->current_station; } - curRide->breakdown_reason = curRide->breakdown_reason_pending; + curRide->breakdownReason = curRide->breakdownReasonPending; } } else @@ -814,7 +814,7 @@ void RideUpdateMeasurementsSpecialElements_WaterCoaster(Ride& ride, const OpenRC { if (trackType >= TrackElemType::FlatCovered && trackType <= TrackElemType::RightQuarterTurn3TilesCovered) { - ride.special_track_elements |= RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; + ride.specialTrackElements |= RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; } } @@ -830,9 +830,9 @@ void Vehicle::UpdateMeasurements() if (status == Vehicle::Status::TravellingBoat) { - curRide->lifecycle_flags |= RIDE_LIFECYCLE_TESTED; - curRide->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS; - curRide->lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_TESTED; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_NO_RAW_STATS; + curRide->lifecycleFlags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; ClearFlag(VehicleFlags::Testing); auto* windowMgr = Ui::GetWindowManager(); @@ -840,29 +840,29 @@ void Vehicle::UpdateMeasurements() return; } - if (curRide->current_test_station.IsNull()) + if (curRide->currentTestStation.IsNull()) return; - const auto& currentStation = curRide->GetStation(curRide->current_test_station); + const auto& currentStation = curRide->getStation(curRide->currentTestStation); if (!currentStation.Entrance.IsNull()) { - uint8_t test_segment = curRide->current_test_segment; + uint8_t test_segment = curRide->currentTestSegment; StationIndex stationIndex = StationIndex::FromUnderlying(test_segment); - auto& stationForTestSegment = curRide->GetStation(stationIndex); + auto& stationForTestSegment = curRide->getStation(stationIndex); - curRide->average_speed_test_timeout++; - if (curRide->average_speed_test_timeout >= 32) - curRide->average_speed_test_timeout = 0; + curRide->averageSpeedTestTimeout++; + if (curRide->averageSpeedTestTimeout >= 32) + curRide->averageSpeedTestTimeout = 0; int32_t absVelocity = abs(velocity); - if (absVelocity > curRide->max_speed) + if (absVelocity > curRide->maxSpeed) { - curRide->max_speed = absVelocity; + curRide->maxSpeed = absVelocity; } - if (curRide->average_speed_test_timeout == 0 && absVelocity > 0) + if (curRide->averageSpeedTestTimeout == 0 && absVelocity > 0) { - curRide->average_speed = AddClamp(curRide->average_speed, absVelocity); + curRide->averageSpeed = AddClamp(curRide->averageSpeed, absVelocity); stationForTestSegment.SegmentTime++; } @@ -872,37 +872,37 @@ void Vehicle::UpdateMeasurements() stationForTestSegment.SegmentLength = AddClamp(stationForTestSegment.SegmentLength, distance); } - if (curRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) + if (curRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) { auto gForces = GetGForces(); - gForces.VerticalG += curRide->previous_vertical_g; - gForces.LateralG += curRide->previous_lateral_g; + gForces.VerticalG += curRide->previousVerticalG; + gForces.LateralG += curRide->previousLateralG; gForces.VerticalG /= 2; gForces.LateralG /= 2; - curRide->previous_vertical_g = gForces.VerticalG; - curRide->previous_lateral_g = gForces.LateralG; + curRide->previousVerticalG = gForces.VerticalG; + curRide->previousLateralG = gForces.LateralG; if (gForces.VerticalG <= 0) { curRide->totalAirTime++; } - if (gForces.VerticalG > curRide->max_positive_vertical_g) - curRide->max_positive_vertical_g = gForces.VerticalG; + if (gForces.VerticalG > curRide->maxPositiveVerticalG) + curRide->maxPositiveVerticalG = gForces.VerticalG; - if (gForces.VerticalG < curRide->max_negative_vertical_g) - curRide->max_negative_vertical_g = gForces.VerticalG; + if (gForces.VerticalG < curRide->maxNegativeVerticalG) + curRide->maxNegativeVerticalG = gForces.VerticalG; gForces.LateralG = std::abs(gForces.LateralG); - curRide->max_lateral_g = std::max(curRide->max_lateral_g, static_cast(gForces.LateralG)); + curRide->maxLateralG = std::max(curRide->maxLateralG, static_cast(gForces.LateralG)); } } // If we have already evaluated this track piece skip to next section TileCoordsXYZ curTrackLoc{ TrackLocation }; - if (curTrackLoc != curRide->CurTestTrackLocation) + if (curTrackLoc != curRide->curTestTrackLocation) { - curRide->CurTestTrackLocation = curTrackLoc; + curRide->curTestTrackLocation = curTrackLoc; if (currentStation.Entrance.IsNull()) return; @@ -910,9 +910,9 @@ void Vehicle::UpdateMeasurements() auto trackElemType = GetTrackType(); if (trackElemType == TrackElemType::PoweredLift || HasFlag(VehicleFlags::OnLiftHill)) { - if (!(curRide->testing_flags & RIDE_TESTING_POWERED_LIFT)) + if (!(curRide->testingFlags & RIDE_TESTING_POWERED_LIFT)) { - curRide->testing_flags |= RIDE_TESTING_POWERED_LIFT; + curRide->testingFlags |= RIDE_TESTING_POWERED_LIFT; auto numPoweredLifts = curRide->getNumPoweredLifts(); if (numPoweredLifts < kRideMaxNumPoweredLiftsCount) { @@ -923,29 +923,29 @@ void Vehicle::UpdateMeasurements() } else { - curRide->testing_flags &= ~RIDE_TESTING_POWERED_LIFT; + curRide->testingFlags &= ~RIDE_TESTING_POWERED_LIFT; } - const auto& rtd = curRide->GetRideTypeDescriptor(); + const auto& rtd = curRide->getRideTypeDescriptor(); rtd.UpdateMeasurementsSpecialElements(*curRide, trackElemType); switch (trackElemType) { case TrackElemType::Rapids: case TrackElemType::SpinningTunnel: - curRide->special_track_elements |= RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; + curRide->specialTrackElements |= RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; break; case TrackElemType::Waterfall: case TrackElemType::LogFlumeReverser: - curRide->special_track_elements |= RIDE_ELEMENT_REVERSER_OR_WATERFALL; + curRide->specialTrackElements |= RIDE_ELEMENT_REVERSER_OR_WATERFALL; break; case TrackElemType::Whirlpool: - curRide->special_track_elements |= RIDE_ELEMENT_WHIRLPOOL; + curRide->specialTrackElements |= RIDE_ELEMENT_WHIRLPOOL; break; case TrackElemType::Watersplash: if (velocity >= 11.0_mph) { - curRide->special_track_elements |= RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; + curRide->specialTrackElements |= RIDE_ELEMENT_TUNNEL_SPLASH_OR_RAPIDS; } default: break; @@ -953,20 +953,20 @@ void Vehicle::UpdateMeasurements() const auto& ted = GetTrackElementDescriptor(trackElemType); uint16_t trackFlags = ted.flags; - uint32_t testingFlags = curRide->testing_flags; + uint32_t testingFlags = curRide->testingFlags; if (testingFlags & RIDE_TESTING_TURN_LEFT && trackFlags & TRACK_ELEM_FLAG_TURN_LEFT) { // 0x800 as this is masked to kCurrentTurnCountMask - curRide->turn_count_default += 0x800; + curRide->turnCountDefault += 0x800; } else if (testingFlags & RIDE_TESTING_TURN_RIGHT && trackFlags & TRACK_ELEM_FLAG_TURN_RIGHT) { // 0x800 as this is masked to kCurrentTurnCountMask - curRide->turn_count_default += 0x800; + curRide->turnCountDefault += 0x800; } else if (testingFlags & RIDE_TESTING_TURN_RIGHT || testingFlags & RIDE_TESTING_TURN_LEFT) { - curRide->testing_flags &= ~( + curRide->testingFlags &= ~( RIDE_TESTING_TURN_LEFT | RIDE_TESTING_TURN_RIGHT | RIDE_TESTING_TURN_BANKED | RIDE_TESTING_TURN_SLOPED); uint8_t turnType = 1; @@ -978,7 +978,7 @@ void Vehicle::UpdateMeasurements() turnType = 0; } } - switch (curRide->turn_count_default >> 11) + switch (curRide->turnCountDefault >> 11) { case 0: IncrementTurnCount1Element(*curRide, turnType); @@ -998,31 +998,31 @@ void Vehicle::UpdateMeasurements() { if (trackFlags & TRACK_ELEM_FLAG_TURN_LEFT) { - curRide->testing_flags |= RIDE_TESTING_TURN_LEFT; - curRide->turn_count_default &= ~kCurrentTurnCountMask; + curRide->testingFlags |= RIDE_TESTING_TURN_LEFT; + curRide->turnCountDefault &= ~kCurrentTurnCountMask; if (trackFlags & TRACK_ELEM_FLAG_TURN_BANKED) { - curRide->testing_flags |= RIDE_TESTING_TURN_BANKED; + curRide->testingFlags |= RIDE_TESTING_TURN_BANKED; } if (trackFlags & TRACK_ELEM_FLAG_TURN_SLOPED) { - curRide->testing_flags |= RIDE_TESTING_TURN_SLOPED; + curRide->testingFlags |= RIDE_TESTING_TURN_SLOPED; } } if (trackFlags & TRACK_ELEM_FLAG_TURN_RIGHT) { - curRide->testing_flags |= RIDE_TESTING_TURN_RIGHT; - curRide->turn_count_default &= ~kCurrentTurnCountMask; + curRide->testingFlags |= RIDE_TESTING_TURN_RIGHT; + curRide->turnCountDefault &= ~kCurrentTurnCountMask; if (trackFlags & TRACK_ELEM_FLAG_TURN_BANKED) { - curRide->testing_flags |= RIDE_TESTING_TURN_BANKED; + curRide->testingFlags |= RIDE_TESTING_TURN_BANKED; } if (trackFlags & TRACK_ELEM_FLAG_TURN_SLOPED) { - curRide->testing_flags |= RIDE_TESTING_TURN_SLOPED; + curRide->testingFlags |= RIDE_TESTING_TURN_SLOPED; } } } @@ -1031,30 +1031,30 @@ void Vehicle::UpdateMeasurements() { if (velocity < 0 || !(trackFlags & TRACK_ELEM_FLAG_DOWN)) { - curRide->testing_flags &= ~RIDE_TESTING_DROP_DOWN; + curRide->testingFlags &= ~RIDE_TESTING_DROP_DOWN; - int16_t curZ = z / kCoordsZStep - curRide->start_drop_height; + int16_t curZ = z / kCoordsZStep - curRide->startDropHeight; if (curZ < 0) { curZ = abs(curZ); - if (curZ > curRide->highest_drop_height) + if (curZ > curRide->highestDropHeight) { - curRide->highest_drop_height = static_cast(curZ); + curRide->highestDropHeight = static_cast(curZ); } } } } else if (trackFlags & TRACK_ELEM_FLAG_DOWN && velocity >= 0) { - curRide->testing_flags &= ~RIDE_TESTING_DROP_UP; - curRide->testing_flags |= RIDE_TESTING_DROP_DOWN; + curRide->testingFlags &= ~RIDE_TESTING_DROP_UP; + curRide->testingFlags |= RIDE_TESTING_DROP_DOWN; uint8_t drops = curRide->getNumDrops(); if (drops < kRideMaxDropsCount) drops++; curRide->setNumDrops(drops); - curRide->start_drop_height = z / kCoordsZStep; + curRide->startDropHeight = z / kCoordsZStep; testingFlags &= ~RIDE_TESTING_DROP_UP; } @@ -1062,30 +1062,30 @@ void Vehicle::UpdateMeasurements() { if (velocity > 0 || !(trackFlags & TRACK_ELEM_FLAG_UP)) { - curRide->testing_flags &= ~RIDE_TESTING_DROP_UP; + curRide->testingFlags &= ~RIDE_TESTING_DROP_UP; - int16_t curZ = z / kCoordsZStep - curRide->start_drop_height; + int16_t curZ = z / kCoordsZStep - curRide->startDropHeight; if (curZ < 0) { curZ = abs(curZ); - if (curZ > curRide->highest_drop_height) + if (curZ > curRide->highestDropHeight) { - curRide->highest_drop_height = static_cast(curZ); + curRide->highestDropHeight = static_cast(curZ); } } } } else if (trackFlags & TRACK_ELEM_FLAG_UP && velocity <= 0) { - curRide->testing_flags &= ~RIDE_TESTING_DROP_DOWN; - curRide->testing_flags |= RIDE_TESTING_DROP_UP; + curRide->testingFlags &= ~RIDE_TESTING_DROP_DOWN; + curRide->testingFlags |= RIDE_TESTING_DROP_UP; auto drops = curRide->getNumDrops(); if (drops != kRideMaxDropsCount) drops++; curRide->setNumDrops(drops); - curRide->start_drop_height = z / kCoordsZStep; + curRide->startDropHeight = z / kCoordsZStep; } if (trackFlags & TRACK_ELEM_FLAG_HELIX) @@ -1094,8 +1094,8 @@ void Vehicle::UpdateMeasurements() if (helixes != OpenRCT2::Limits::kMaxHelices) helixes++; - curRide->special_track_elements &= ~0x1F; - curRide->special_track_elements |= helixes; + curRide->specialTrackElements &= ~0x1F; + curRide->specialTrackElements |= helixes; } } @@ -1104,7 +1104,7 @@ void Vehicle::UpdateMeasurements() if (x == kLocationNull) { - curRide->testing_flags &= ~RIDE_TESTING_SHELTERED; + curRide->testingFlags &= ~RIDE_TESTING_SHELTERED; return; } @@ -1154,25 +1154,25 @@ void Vehicle::UpdateMeasurements() if (!coverFound) { - curRide->testing_flags &= ~RIDE_TESTING_SHELTERED; + curRide->testingFlags &= ~RIDE_TESTING_SHELTERED; return; } } - if (!(curRide->testing_flags & RIDE_TESTING_SHELTERED)) + if (!(curRide->testingFlags & RIDE_TESTING_SHELTERED)) { - curRide->testing_flags |= RIDE_TESTING_SHELTERED; + curRide->testingFlags |= RIDE_TESTING_SHELTERED; - curRide->IncreaseNumShelteredSections(); + curRide->increaseNumShelteredSections(); if (Pitch != 0) { - curRide->num_sheltered_sections |= ShelteredSectionsBits::kRotatingWhileSheltered; + curRide->numShelteredSections |= ShelteredSectionsBits::kRotatingWhileSheltered; } if (bank_rotation != 0) { - curRide->num_sheltered_sections |= ShelteredSectionsBits::kBankingWhileSheltered; + curRide->numShelteredSections |= ShelteredSectionsBits::kBankingWhileSheltered; } } @@ -1180,7 +1180,7 @@ void Vehicle::UpdateMeasurements() if (distance < 0) return; - curRide->sheltered_length = AddClamp(curRide->sheltered_length, distance); + curRide->shelteredLength = AddClamp(curRide->shelteredLength, distance); } struct SoundIdVolume @@ -1257,11 +1257,11 @@ void Vehicle::Update() UpdateMeasurements(); _vehicleBreakdown = 255; - if (curRide->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) + if (curRide->lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) { - _vehicleBreakdown = curRide->breakdown_reason_pending; + _vehicleBreakdown = curRide->breakdownReasonPending; auto carEntry = &rideEntry->Cars[vehicle_type]; - if ((carEntry->flags & CAR_ENTRY_FLAG_POWERED) && curRide->breakdown_reason_pending == BREAKDOWN_SAFETY_CUT_OUT) + if ((carEntry->flags & CAR_ENTRY_FLAG_POWERED) && curRide->breakdownReasonPending == BREAKDOWN_SAFETY_CUT_OUT) { if (!(carEntry->flags & CAR_ENTRY_FLAG_WATER_RIDE) || (Pitch == 2 && velocity <= 2.0_mph)) { @@ -1469,19 +1469,19 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se if (curRide == nullptr) return; - if (curRide->status == RideStatus::open && !(curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (curRide->status == RideStatus::open && !(curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) && !HasFlag(VehicleFlags::ReadyToDepart)) { return; } - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { // Original code did not check if the ride was a boat hire, causing empty boats to leave the platform when closing a // Boat Hire with passengers on it. - if (curRide->status != RideStatus::closed || (curRide->num_riders != 0 && curRide->type != RIDE_TYPE_BOAT_HIRE)) + if (curRide->status != RideStatus::closed || (curRide->numRiders != 0 && curRide->type != RIDE_TYPE_BOAT_HIRE)) { - curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; + curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain; sub_state = 2; return; } @@ -1492,7 +1492,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se uint8_t seat = ((-Pitch) / 8) & 0xF; if (!peep[seat].IsNull()) { - curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; + curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain; SetState(Vehicle::Status::UnloadingPassengers); return; } @@ -1500,7 +1500,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se if (num_peeps == 0) return; - curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; + curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain; sub_state = 2; return; } @@ -1508,7 +1508,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se if (num_peeps_on_train == 0) return; - curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; + curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain; SetState(Vehicle::Status::WaitingForPassengers); } @@ -1518,7 +1518,7 @@ static std::optional ride_get_train_index_from_vehicle(const Ride& rid while (ride.vehicles[trainIndex] != spriteIndex) { trainIndex++; - if (trainIndex >= ride.NumTrains) + if (trainIndex >= ride.numTrains) { // This should really return nullopt, but doing so // would break some hacked parks that hide track by setting tracked rides' @@ -1550,7 +1550,7 @@ void Vehicle::UpdateWaitingForPassengers() if (!OpenRestraints()) return; - auto& station = curRide->GetStation(current_station); + auto& station = curRide->getStation(current_station); if (station.Entrance.IsNull()) { station.TrainAtStation = RideStation::kNoTrain; @@ -1594,7 +1594,7 @@ void Vehicle::UpdateWaitingForPassengers() num_seats_on_train &= 0x7F; - if (curRide->SupportsStatus(RideStatus::testing)) + if (curRide->supportsStatus(RideStatus::testing)) { if (time_waiting < 20) { @@ -1611,19 +1611,19 @@ void Vehicle::UpdateWaitingForPassengers() } } - if (curRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLoadOptions)) + if (curRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasLoadOptions)) { - if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) + if (curRide->departFlags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) { - if (curRide->min_waiting_time * 32 > time_waiting) + if (curRide->minWaitingTime * 32 > time_waiting) { TrainReadyToDepart(num_peeps_on_train, num_used_seats_on_train); return; } } - if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) + if (curRide->departFlags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) { - if (curRide->max_waiting_time * 32 < time_waiting) + if (curRide->maxWaitingTime * 32 < time_waiting) { SetFlag(VehicleFlags::ReadyToDepart); TrainReadyToDepart(num_peeps_on_train, num_used_seats_on_train); @@ -1632,7 +1632,7 @@ void Vehicle::UpdateWaitingForPassengers() } } - if (curRide->depart_flags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) + if (curRide->departFlags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) { for (auto train_id : curRide->vehicles) { @@ -1656,8 +1656,8 @@ void Vehicle::UpdateWaitingForPassengers() } } - if (curRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLoadOptions) - && curRide->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD) + if (curRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasLoadOptions) + && curRide->departFlags & RIDE_DEPART_WAIT_FOR_LOAD) { if (num_peeps_on_train == num_seats_on_train) { @@ -1667,7 +1667,7 @@ void Vehicle::UpdateWaitingForPassengers() } // any load: load=4 , full: load=3 , 3/4s: load=2 , half: load=1 , quarter: load=0 - uint8_t load = curRide->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK; + uint8_t load = curRide->departFlags & RIDE_DEPART_WAIT_FOR_LOAD_MASK; // We want to wait for ceiling((load+1)/4 * num_seats_on_train) peeps, the +3 below is used instead of // ceil() to prevent issues on different cpus/platforms with floats. Note that vanilla RCT1/2 rounded @@ -1695,7 +1695,7 @@ void Vehicle::UpdateWaitingForPassengers() velocity = 0; ClearFlag(VehicleFlags::WaitingOnAdjacentStation); - if (curRide->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) + if (curRide->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) { SetFlag(VehicleFlags::WaitingOnAdjacentStation); } @@ -1735,7 +1735,7 @@ void Vehicle::UpdateDodgemsMode() TimeActive++; } - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) return; // Mark the dodgem as not in use. @@ -1756,12 +1756,12 @@ void Vehicle::UpdateWaitingToDepart() if (curRide == nullptr) return; - const auto& currentStation = curRide->GetStation(current_station); + const auto& currentStation = curRide->getStation(current_station); bool shouldBreak = false; - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - switch (curRide->breakdown_reason_pending) + switch (curRide->breakdownReasonPending) { case BREAKDOWN_RESTRAINTS_STUCK_CLOSED: case BREAKDOWN_RESTRAINTS_STUCK_OPEN: @@ -1820,9 +1820,9 @@ void Vehicle::UpdateWaitingToDepart() return; } - if (curRide->GetRideTypeDescriptor().HasFlag(RtdFlag::canSynchroniseWithAdjacentStations)) + if (curRide->getRideTypeDescriptor().HasFlag(RtdFlag::canSynchroniseWithAdjacentStations)) { - if (curRide->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) + if (curRide->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) { if (HasFlag(VehicleFlags::WaitingOnAdjacentStation)) { @@ -1836,7 +1836,7 @@ void Vehicle::UpdateWaitingToDepart() SetState(Vehicle::Status::Departing); - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT) { CoordsXYE track; int32_t zUnused; @@ -2008,7 +2008,7 @@ static bool try_add_synchronised_station(const CoordsXYZ& coords) auto rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); - if (ride == nullptr || !(ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)) + if (ride == nullptr || !(ride->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)) { /* Ride is not set to synchronise with adjacent stations. */ return false; @@ -2029,20 +2029,20 @@ static bool try_add_synchronised_station(const CoordsXYZ& coords) /* Ride vehicles are not on the track (e.g. ride is/was under * construction), so just return; vehicle_id for this station * is SPRITE_INDEX_NULL. */ - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) { return true; } /* Station is not ready to depart, so just return; * vehicle_id for this station is SPRITE_INDEX_NULL. */ - if (!(ride->GetStation(stationIndex).Depart & kStationDepartFlag)) + if (!(ride->getStation(stationIndex).Depart & kStationDepartFlag)) { return true; } // Look for a vehicle on this station waiting to depart. - for (int32_t i = 0; i < ride->NumTrains; i++) + for (int32_t i = 0; i < ride->numTrains; i++) { auto* vehicle = GetEntity(ride->vehicles[i]); if (vehicle == nullptr) @@ -2090,7 +2090,7 @@ static bool try_add_synchronised_station(const CoordsXYZ& coords) */ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex stationIndex) { - const auto& station = ride.GetStation(stationIndex); + const auto& station = ride.getStation(stationIndex); auto location = station.GetStart(); auto tileElement = MapGetTrackElementAt(location); @@ -2153,13 +2153,13 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex { Ride* sv_ride = GetRide(sv->ride_id); - if (!(sv_ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) + if (!(sv_ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { if (sv_ride->status != RideStatus::closed) { - if (sv_ride->IsBlockSectioned()) + if (sv_ride->isBlockSectioned()) { - if (!(sv_ride->GetStation(sv->stationIndex).Depart & kStationDepartFlag)) + if (!(sv_ride->getStation(sv->stationIndex).Depart & kStationDepartFlag)) { sv = _synchronisedVehicles; RideId rideId = RideId::GetNull(); @@ -2180,7 +2180,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex auto curRide = GetRide(rideId); if (curRide != nullptr) { - for (int32_t i = 0; i < curRide->NumTrains; i++) + for (int32_t i = 0; i < curRide->numTrains; i++) { Vehicle* v = GetEntity(curRide->vehicles[i]); if (v == nullptr) @@ -2218,7 +2218,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex int32_t numTrainsAtStation = 0; int32_t numTravelingTrains = 0; auto currentStation = sv->stationIndex; - for (int32_t i = 0; i < sv_ride->NumTrains; i++) + for (int32_t i = 0; i < sv_ride->numTrains; i++) { auto* otherVehicle = GetEntity(sv_ride->vehicles[i]); if (otherVehicle == nullptr) @@ -2243,9 +2243,9 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex } int32_t totalTrains = numTrainsAtStation + numTravelingTrains; - if (totalTrains != sv_ride->NumTrains || numTravelingTrains >= sv_ride->NumTrains / 2) + if (totalTrains != sv_ride->numTrains || numTravelingTrains >= sv_ride->numTrains / 2) { - // if (numArrivingTrains > 0 || numTravelingTrains >= sv_ride->NumTrains / 2) { + // if (numArrivingTrains > 0 || numTravelingTrains >= sv_ride->numTrains / 2) { /* Sync condition: If there are trains arriving at the * station or half or more of the ride trains are * travelling, this station must be sync-ed before the @@ -2309,11 +2309,11 @@ void Vehicle::PeepEasterEggHereWeAre() const */ static void test_finish(Ride& ride) { - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; - ride.lifecycle_flags |= RIDE_LIFECYCLE_TESTED; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; + ride.lifecycleFlags |= RIDE_LIFECYCLE_TESTED; - auto rideStations = ride.GetStations(); - for (int32_t i = ride.num_stations - 1; i >= 1; i--) + auto rideStations = ride.getStations(); + for (int32_t i = ride.numStations - 1; i >= 1; i--) { if (rideStations[i - 1].SegmentTime != 0) continue; @@ -2328,13 +2328,13 @@ static void test_finish(Ride& ride) } uint32_t totalTime = 0; - for (uint8_t i = 0; i < ride.num_stations; ++i) + for (uint8_t i = 0; i < ride.numStations; ++i) { totalTime += rideStations[i].SegmentTime; } totalTime = std::max(totalTime, 1u); - ride.average_speed = ride.average_speed / totalTime; + ride.averageSpeed = ride.averageSpeed / totalTime; auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByNumber(WindowClass::Ride, ride.id.ToUnderlying()); @@ -2355,38 +2355,38 @@ void Vehicle::UpdateTestFinish() */ static void test_reset(Ride& ride, StationIndex curStation) { - ride.lifecycle_flags |= RIDE_LIFECYCLE_TEST_IN_PROGRESS; - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_NO_RAW_STATS; - ride.max_speed = 0; - ride.average_speed = 0; - ride.current_test_segment = 0; - ride.average_speed_test_timeout = 0; - ride.max_positive_vertical_g = MakeFixed16_2dp(1, 0); - ride.max_negative_vertical_g = MakeFixed16_2dp(1, 0); - ride.max_lateral_g = 0; - ride.previous_vertical_g = 0; - ride.previous_lateral_g = 0; - ride.testing_flags = 0; - ride.CurTestTrackLocation.SetNull(); - ride.turn_count_default = 0; - ride.turn_count_banked = 0; - ride.turn_count_sloped = 0; + ride.lifecycleFlags |= RIDE_LIFECYCLE_TEST_IN_PROGRESS; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_NO_RAW_STATS; + ride.maxSpeed = 0; + ride.averageSpeed = 0; + ride.currentTestSegment = 0; + ride.averageSpeedTestTimeout = 0; + ride.maxPositiveVerticalG = MakeFixed16_2dp(1, 0); + ride.maxNegativeVerticalG = MakeFixed16_2dp(1, 0); + ride.maxLateralG = 0; + ride.previousVerticalG = 0; + ride.previousLateralG = 0; + ride.testingFlags = 0; + ride.curTestTrackLocation.SetNull(); + ride.turnCountDefault = 0; + ride.turnCountBanked = 0; + ride.turnCountSloped = 0; ride.inversions = 0; ride.holes = 0; - ride.sheltered_eighths = 0; + ride.shelteredEighths = 0; ride.dropsPoweredLifts = 0; - ride.sheltered_length = 0; - ride.var_11C = 0; - ride.num_sheltered_sections = 0; - ride.highest_drop_height = 0; - ride.special_track_elements = 0; - for (auto& station : ride.GetStations()) + ride.shelteredLength = 0; + ride.var11C = 0; + ride.numShelteredSections = 0; + ride.highestDropHeight = 0; + ride.specialTrackElements = 0; + for (auto& station : ride.getStations()) { station.SegmentLength = 0; station.SegmentTime = 0; } ride.totalAirTime = 0; - ride.current_test_station = curStation; + ride.currentTestStation = curStation; auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByNumber(WindowClass::Ride, ride.id.ToUnderlying()); @@ -2468,9 +2468,9 @@ void Vehicle::UpdateDepartingBoatHire() if (curRide == nullptr) return; - auto& station = curRide->GetStation(current_station); + auto& station = curRide->getStation(current_station); station.Depart &= kStationDepartFlag; - uint8_t waitingTime = std::max(curRide->min_waiting_time, static_cast(3)); + uint8_t waitingTime = std::max(curRide->minWaitingTime, static_cast(3)); waitingTime = std::min(waitingTime, static_cast(127)); station.Depart |= waitingTime; UpdateTravellingBoatHireSetup(); @@ -2494,17 +2494,17 @@ void Vehicle::UpdateDeparting() { if (HasFlag(VehicleFlags::TrainIsBroken)) { - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) return; - curRide->lifecycle_flags |= RIDE_LIFECYCLE_BROKEN_DOWN; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_BROKEN_DOWN; RideBreakdownAddNewsItem(*curRide); - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE; - curRide->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; - curRide->inspection_station = current_station; - curRide->breakdown_reason = curRide->breakdown_reason_pending; + curRide->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; + curRide->inspectionStation = current_station; + curRide->breakdownReason = curRide->breakdownReasonPending; velocity = 0; return; } @@ -2525,21 +2525,21 @@ void Vehicle::UpdateDeparting() OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, GetLocation()); } - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_TESTED)) { if (HasFlag(VehicleFlags::Testing)) { - if (curRide->current_test_segment + 1 < curRide->num_stations) + if (curRide->currentTestSegment + 1 < curRide->numStations) { - curRide->current_test_segment++; - curRide->current_test_station = current_station; + curRide->currentTestSegment++; + curRide->currentTestStation = current_station; } else { UpdateTestFinish(); } } - else if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TEST_IN_PROGRESS) && !IsGhost()) + else if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_TEST_IN_PROGRESS) && !IsGhost()) { TestReset(); } @@ -2547,7 +2547,7 @@ void Vehicle::UpdateDeparting() } const auto& carEntry = rideEntry->Cars[vehicle_type]; - const auto& rtd = curRide->GetRideTypeDescriptor(); + const auto& rtd = curRide->getRideTypeDescriptor(); switch (curRide->mode) { case RideMode::reverseInclineLaunchedShuttle: @@ -2559,9 +2559,9 @@ void Vehicle::UpdateDeparting() case RideMode::poweredLaunchBlockSectioned: case RideMode::limPoweredLaunch: case RideMode::upwardLaunch: - if ((curRide->launch_speed << 16) > velocity) + if ((curRide->launchSpeed << 16) > velocity) { - acceleration = curRide->launch_speed << rtd.BoosterSettings.AccelerationFactor; + acceleration = curRide->launchSpeed << rtd.BoosterSettings.AccelerationFactor; } break; case RideMode::downwardLaunch: @@ -2630,7 +2630,7 @@ void Vehicle::UpdateDeparting() sound2_flags |= VEHICLE_SOUND2_FLAGS_LIFT_HILL; if (curRide->mode != RideMode::reverseInclineLaunchedShuttle) { - int32_t curSpeed = curRide->lift_hill_speed * 31079; + int32_t curSpeed = curRide->liftHillSpeed * 31079; if (velocity <= curSpeed) { acceleration = 15539; @@ -2648,7 +2648,7 @@ void Vehicle::UpdateDeparting() } else { - int32_t curSpeed = curRide->lift_hill_speed * -31079; + int32_t curSpeed = curRide->liftHillSpeed * -31079; if (velocity >= curSpeed) { acceleration = -15539; @@ -2733,20 +2733,20 @@ void Vehicle::FinishDeparting() if (curRide->mode == RideMode::upwardLaunch) { - if ((curRide->launch_speed << 16) > velocity) + if ((curRide->launchSpeed << 16) > velocity) return; OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, GetLocation()); } - if (curRide->mode != RideMode::race && !curRide->IsBlockSectioned()) + if (curRide->mode != RideMode::race && !curRide->isBlockSectioned()) { - auto& currentStation = curRide->GetStation(current_station); + auto& currentStation = curRide->getStation(current_station); currentStation.Depart &= kStationDepartFlag; uint8_t waitingTime = 3; - if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) + if (curRide->departFlags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) { - waitingTime = std::max(curRide->min_waiting_time, static_cast(3)); + waitingTime = std::max(curRide->minWaitingTime, static_cast(3)); waitingTime = std::min(waitingTime, static_cast(127)); } @@ -2768,17 +2768,17 @@ void Vehicle::CheckIfMissing() if (curRide == nullptr) return; - if (curRide->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + if (curRide->lifecycleFlags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) return; - if (curRide->IsBlockSectioned()) + if (curRide->isBlockSectioned()) return; - if (!curRide->GetRideTypeDescriptor().HasFlag(RtdFlag::checkForStalling)) + if (!curRide->getRideTypeDescriptor().HasFlag(RtdFlag::checkForStalling)) return; lost_time_out++; - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_HAS_STALLED_VEHICLE) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_HAS_STALLED_VEHICLE) return; uint16_t limit = curRide->type == RIDE_TYPE_BOAT_HIRE ? 15360 : 9600; @@ -2786,7 +2786,7 @@ void Vehicle::CheckIfMissing() if (lost_time_out <= limit) return; - curRide->lifecycle_flags |= RIDE_LIFECYCLE_HAS_STALLED_VEHICLE; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_HAS_STALLED_VEHICLE; if (Config::Get().notifications.RideStalledVehicles) { @@ -2794,13 +2794,13 @@ void Vehicle::CheckIfMissing() ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number); uint8_t vehicleIndex = 0; - for (; vehicleIndex < curRide->NumTrains; ++vehicleIndex) + for (; vehicleIndex < curRide->numTrains; ++vehicleIndex) if (curRide->vehicles[vehicleIndex] == Id) break; vehicleIndex++; ft.Add(vehicleIndex); - curRide->FormatNameTo(ft); + curRide->formatNameTo(ft); ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular); News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, ride.ToUnderlying(), ft); @@ -2812,7 +2812,7 @@ void Vehicle::SimulateCrash() const auto curRide = GetRide(); if (curRide != nullptr) { - curRide->lifecycle_flags |= RIDE_LIFECYCLE_CRASHED; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_CRASHED; } } @@ -2836,7 +2836,7 @@ void Vehicle::UpdateCollisionSetup() SetState(Vehicle::Status::Crashed, sub_state); - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { auto frontVehicle = GetHead(); auto trainIndex = ride_get_train_index_from_vehicle(*curRide, frontVehicle->Id); @@ -2845,7 +2845,7 @@ void Vehicle::UpdateCollisionSetup() return; } - curRide->Crash(trainIndex.value()); + curRide->crash(trainIndex.value()); if (curRide->status != RideStatus::closed) { @@ -2855,8 +2855,8 @@ void Vehicle::UpdateCollisionSetup() } } - curRide->lifecycle_flags |= RIDE_LIFECYCLE_CRASHED; - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_CRASHED; + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; KillAllPassengersInTrain(); Vehicle* lastVehicle = this; @@ -3113,7 +3113,7 @@ void Vehicle::UpdateTravelling() if (!HasFlag(VehicleFlags::ReverseInclineCompletedLap)) { - if (velocity >= curRide->lift_hill_speed * -31079) + if (velocity >= curRide->liftHillSpeed * -31079) { acceleration = -15539; @@ -3129,7 +3129,7 @@ void Vehicle::UpdateTravelling() else { sound2_flags |= VEHICLE_SOUND2_FLAGS_LIFT_HILL; - if (velocity <= curRide->lift_hill_speed * 31079) + if (velocity <= curRide->liftHillSpeed * 31079) { acceleration = 15539; if (velocity != 0) @@ -3171,7 +3171,7 @@ void Vehicle::UpdateArrivingPassThroughStation(const Ride& curRide, const CarEnt { if (sub_state == 0) { - if (curRide.mode == RideMode::race && curRide.lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) + if (curRide.mode == RideMode::race && curRide.lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) { return; } @@ -3193,9 +3193,9 @@ void Vehicle::UpdateArrivingPassThroughStation(const Ride& curRide, const CarEnt return; } - if (curRide.num_circuits != 1) + if (curRide.numCircuits != 1) { - if (NumLaps + 1 < curRide.num_circuits) + if (NumLaps + 1 < curRide.numCircuits) { return; } @@ -3226,12 +3226,12 @@ void Vehicle::UpdateArrivingPassThroughStation(const Ride& curRide, const CarEnt return; } - if (NumLaps + 1 < curRide.num_circuits) + if (NumLaps + 1 < curRide.numCircuits) { return; } - if (NumLaps + 1 != curRide.num_circuits) + if (NumLaps + 1 != curRide.numCircuits) { velocity -= velocity_diff; acceleration = 0; @@ -3294,10 +3294,10 @@ void Vehicle::UpdateArriving() } } - bool hasBrakesFailure = curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN - && curRide->breakdown_reason_pending == BREAKDOWN_BRAKES_FAILURE; - if (hasBrakesFailure && curRide->inspection_station == current_station - && curRide->mechanic_status != RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) + bool hasBrakesFailure = curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN + && curRide->breakdownReasonPending == BREAKDOWN_BRAKES_FAILURE; + if (hasBrakesFailure && curRide->inspectionStation == current_station + && curRide->mechanicStatus != RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { stationBrakesWork = false; } @@ -3347,20 +3347,20 @@ void Vehicle::UpdateArriving() if (sub_state != 0) { - if (NumLaps < curRide->num_circuits) + if (NumLaps < curRide->numCircuits) { SetState(Vehicle::Status::Departing, 1); return; } - if (NumLaps == curRide->num_circuits && HasFlag(VehicleFlags::ReverseInclineCompletedLap)) + if (NumLaps == curRide->numCircuits && HasFlag(VehicleFlags::ReverseInclineCompletedLap)) { SetState(Vehicle::Status::Departing, 1); return; } } - if (curRide->num_circuits != 1 && NumLaps < curRide->num_circuits) + if (curRide->numCircuits != 1 && NumLaps < curRide->numCircuits) { SetState(Vehicle::Status::Departing, 1); return; @@ -3375,7 +3375,7 @@ void Vehicle::UpdateArriving() return; } - if (curRide->mode == RideMode::race && curRide->lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) + if (curRide->mode == RideMode::race && curRide->lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) { SetState(Vehicle::Status::Departing, 1); return; @@ -3405,7 +3405,7 @@ void Vehicle::UpdateUnloadingPassengers() if (curRide == nullptr) return; - const auto& currentStation = curRide->GetStation(current_station); + const auto& currentStation = curRide->getStation(current_station); if (curRide->mode == RideMode::forwardRotation || curRide->mode == RideMode::backwardRotation) { @@ -3440,8 +3440,8 @@ void Vehicle::UpdateUnloadingPassengers() if (sub_state != 1) return; - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TESTED) && HasFlag(VehicleFlags::Testing) - && curRide->current_test_segment + 1 >= curRide->num_stations) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_TESTED) && HasFlag(VehicleFlags::Testing) + && curRide->currentTestSegment + 1 >= curRide->numStations) { UpdateTestFinish(); } @@ -3480,8 +3480,8 @@ void Vehicle::UpdateUnloadingPassengers() return; } - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TESTED) && HasFlag(VehicleFlags::Testing) - && curRide->current_test_segment + 1 >= curRide->num_stations) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_TESTED) && HasFlag(VehicleFlags::Testing) + && curRide->currentTestSegment + 1 >= curRide->numStations) { UpdateTestFinish(); } @@ -3498,7 +3498,7 @@ void Vehicle::UpdateWaitingForCableLift() if (curRide == nullptr) return; - Vehicle* cableLift = GetEntity(curRide->cable_lift); + Vehicle* cableLift = GetEntity(curRide->cableLift); if (cableLift == nullptr) return; @@ -3523,38 +3523,38 @@ void Vehicle::UpdateTravellingCableLift() { if (HasFlag(VehicleFlags::TrainIsBroken)) { - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) return; - curRide->lifecycle_flags |= RIDE_LIFECYCLE_BROKEN_DOWN; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_BROKEN_DOWN; RideBreakdownAddNewsItem(*curRide); - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE; - curRide->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; - curRide->inspection_station = current_station; - curRide->breakdown_reason = curRide->breakdown_reason_pending; + curRide->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; + curRide->inspectionStation = current_station; + curRide->breakdownReason = curRide->breakdownReasonPending; velocity = 0; return; } sub_state = 1; PeepEasterEggHereWeAre(); - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_TESTED)) { if (HasFlag(VehicleFlags::Testing)) { - if (curRide->current_test_segment + 1 < curRide->num_stations) + if (curRide->currentTestSegment + 1 < curRide->numStations) { - curRide->current_test_segment++; - curRide->current_test_station = current_station; + curRide->currentTestSegment++; + curRide->currentTestStation = current_station; } else { UpdateTestFinish(); } } - else if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TEST_IN_PROGRESS) && !IsGhost()) + else if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_TEST_IN_PROGRESS) && !IsGhost()) { TestReset(); } @@ -3582,16 +3582,16 @@ void Vehicle::UpdateTravellingCableLift() sub_state = 2; - if (curRide->IsBlockSectioned()) + if (curRide->isBlockSectioned()) return; // This is slightly different to the vanilla function - auto& currentStation = curRide->GetStation(current_station); + auto& currentStation = curRide->getStation(current_station); currentStation.Depart &= kStationDepartFlag; uint8_t waitingTime = 3; - if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) + if (curRide->departFlags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) { - waitingTime = std::max(curRide->min_waiting_time, static_cast(3)); + waitingTime = std::max(curRide->minWaitingTime, static_cast(3)); waitingTime = std::min(waitingTime, static_cast(127)); } @@ -3623,7 +3623,7 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const if (trackElement != nullptr) SetTrackType(trackElement->GetTrackType()); - SetTrackDirection(curRide->boat_hire_return_direction); + SetTrackDirection(curRide->boatHireReturnDirection); BoatLocation.SetNull(); } @@ -3803,7 +3803,7 @@ void Vehicle::UpdateMotionBoatHire() else { auto flooredTileLoc = TileCoordsXY(flooredLocation); - if (curRide->boat_hire_return_position != flooredTileLoc) + if (curRide->boatHireReturnPosition != flooredTileLoc) { do_Loc6DAA97 = true; } @@ -3820,7 +3820,7 @@ void Vehicle::UpdateMotionBoatHire() break; } - if (!(curRide->boat_hire_return_direction & 1)) + if (!(curRide->boatHireReturnDirection & 1)) { uint16_t tilePart = loc2.y % kCoordsXYStep; if (tilePart == kCoordsXYHalfTile) @@ -3926,8 +3926,8 @@ void Vehicle::UpdateBoatLocation() if (curRide == nullptr) return; - TileCoordsXY returnPosition = curRide->boat_hire_return_position; - uint8_t returnDirection = curRide->boat_hire_return_direction & 3; + TileCoordsXY returnPosition = curRide->boatHireReturnPosition; + uint8_t returnDirection = curRide->boatHireReturnDirection & 3; CoordsXY location = CoordsXY{ x, y } + CoordsDirectionDelta[returnDirection]; @@ -4267,7 +4267,7 @@ void Vehicle::UpdateRotating() uint16_t time = current_time; if (_vehicleBreakdown == BREAKDOWN_CONTROL_FAILURE) { - time += (curRide->breakdown_sound_modifier >> 6) + 1; + time += (curRide->breakdownSoundModifier >> 6) + 1; } time++; @@ -4541,14 +4541,14 @@ static void ride_train_crash(Ride& ride, uint16_t numFatalities) uint8_t crashType = numFatalities == 0 ? RIDE_CRASH_TYPE_NO_FATALITIES : RIDE_CRASH_TYPE_FATALITIES; - if (crashType >= ride.last_crash_type) - ride.last_crash_type = crashType; + if (crashType >= ride.lastCrashType) + ride.lastCrashType = crashType; if (numFatalities != 0) { if (Config::Get().notifications.RideCasualties) { - ride.FormatNameTo(ft); + ride.formatNameTo(ft); News::AddItemToQueue( News::ItemType::Ride, numFatalities == 1 ? STR_X_PERSON_DIED_ON_X : STR_X_PEOPLE_DIED_ON_X, ride.id.ToUnderlying(), ft); @@ -4624,7 +4624,7 @@ void Vehicle::CrashOnLand() InvokeVehicleCrashHook(Id, "land"); #endif - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { auto frontVehicle = GetHead(); auto trainIndex = ride_get_train_index_from_vehicle(*curRide, frontVehicle->Id); @@ -4633,7 +4633,7 @@ void Vehicle::CrashOnLand() return; } - curRide->Crash(trainIndex.value()); + curRide->crash(trainIndex.value()); if (curRide->status != RideStatus::closed) { @@ -4642,8 +4642,8 @@ void Vehicle::CrashOnLand() GameActions::ExecuteNested(&gameAction); } } - curRide->lifecycle_flags |= RIDE_LIFECYCLE_CRASHED; - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_CRASHED; + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; if (IsHead()) { @@ -4692,7 +4692,7 @@ void Vehicle::CrashOnWater() InvokeVehicleCrashHook(Id, "water"); #endif - if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { auto frontVehicle = GetHead(); auto trainIndex = ride_get_train_index_from_vehicle(*curRide, frontVehicle->Id); @@ -4701,7 +4701,7 @@ void Vehicle::CrashOnWater() return; } - curRide->Crash(trainIndex.value()); + curRide->crash(trainIndex.value()); if (curRide->status != RideStatus::closed) { @@ -4710,8 +4710,8 @@ void Vehicle::CrashOnWater() GameActions::ExecuteNested(&gameAction); } } - curRide->lifecycle_flags |= RIDE_LIFECYCLE_CRASHED; - curRide->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + curRide->lifecycleFlags |= RIDE_LIFECYCLE_CRASHED; + curRide->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; if (IsHead()) { @@ -5091,10 +5091,10 @@ void Vehicle::SetMapToolbar() const auto ft = Formatter(); ft.Add(STR_RIDE_MAP_TIP); ft.Add(STR_MAP_TOOLTIP_STRINGID_STRINGID); - curRide->FormatNameTo(ft); + curRide->formatNameTo(ft); ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).capitalised); ft.Add(vehicleIndex + 1); - curRide->FormatStatusTo(ft); + curRide->formatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.PutExtra(INTENT_EXTRA_FORMATTER, &ft); ContextBroadcastIntent(&intent); @@ -5156,8 +5156,8 @@ int32_t Vehicle::UpdateMotionDodgems() return _vehicleMotionTrackFlags; int32_t nextVelocity = velocity + acceleration; - if (curRide->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN) - && curRide->breakdown_reason_pending == BREAKDOWN_SAFETY_CUT_OUT) + if (curRide->lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN) + && curRide->breakdownReasonPending == BREAKDOWN_SAFETY_CUT_OUT) { nextVelocity = 0; } @@ -5168,8 +5168,8 @@ int32_t Vehicle::UpdateMotionDodgems() _vehicleUnkF64E10 = 1; acceleration = 0; - if (!(curRide->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) - || curRide->breakdown_reason_pending != BREAKDOWN_SAFETY_CUT_OUT) + if (!(curRide->lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) + || curRide->breakdownReasonPending != BREAKDOWN_SAFETY_CUT_OUT) { if ((GetGameState().CurrentTicks & 1) && var_34 != 0) { @@ -5557,7 +5557,7 @@ void Vehicle::CheckAndApplyBlockSectionStopSite() { case TrackElemType::BlockBrakes: // Check if this brake is the start of a cable lift - if (curRide->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT) + if (curRide->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT) { CoordsXYE track; int32_t zUnused; @@ -5565,13 +5565,13 @@ void Vehicle::CheckAndApplyBlockSectionStopSite() if (TrackBlockGetNextFromZero(TrackLocation, *curRide, GetTrackDirection(), &track, &zUnused, &direction, false) && track.element != nullptr && track.element->AsTrack()->HasCableLift()) { - ApplyCableLiftBlockBrake(curRide->IsBlockSectioned() && trackElement->AsTrack()->IsBrakeClosed()); + ApplyCableLiftBlockBrake(curRide->isBlockSectioned() && trackElement->AsTrack()->IsBrakeClosed()); break; } } [[fallthrough]]; case TrackElemType::DiagBlockBrakes: - if (curRide->IsBlockSectioned() && trackElement->AsTrack()->IsBrakeClosed()) + if (curRide->isBlockSectioned() && trackElement->AsTrack()->IsBrakeClosed()) ApplyStopBlockBrake(); else ApplyNonStopBlockBrake(); @@ -5587,7 +5587,7 @@ void Vehicle::CheckAndApplyBlockSectionStopSite() case TrackElemType::CableLiftHill: case TrackElemType::DiagUp25ToFlat: case TrackElemType::DiagUp60ToFlat: - if (curRide->IsBlockSectioned()) + if (curRide->isBlockSectioned()) { if (trackType == TrackElemType::CableLiftHill || trackElement->AsTrack()->HasChain()) { @@ -6355,7 +6355,7 @@ static void AnimateLandscapeDoor(TrackElement* trackElement, bool isLastVehicle) void Vehicle::UpdateLandscapeDoor() const { const auto* currentRide = GetRide(); - if (currentRide == nullptr || !currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) + if (currentRide == nullptr || !currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) { return; } @@ -6427,7 +6427,7 @@ void Vehicle::UpdateSceneryDoorBackwards() const void Vehicle::UpdateLandscapeDoorBackwards() const { const auto* currentRide = GetRide(); - if (currentRide == nullptr || !currentRide->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) + if (currentRide == nullptr || !currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) { return; } @@ -7028,7 +7028,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack( { trackType = tileElement->AsTrack()->GetTrackType(); if (trackType == TrackElemType::Flat - || ((curRide.lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && tileElement->AsTrack()->IsStation())) + || ((curRide.lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && tileElement->AsTrack()->IsStation())) { UpdateGoKartAttemptSwitchLanes(); } @@ -7039,11 +7039,11 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack( { TileCoordsXYZ curLocation{ TrackLocation }; - if (curLocation == curRide.ChairliftBullwheelLocation[1]) + if (curLocation == curRide.chairliftBullwheelLocation[1]) { TrackSubposition = VehicleTrackSubposition::ChairliftEndBullwheel; } - else if (curLocation == curRide.ChairliftBullwheelLocation[0]) + else if (curLocation == curRide.chairliftBullwheelLocation[0]) { TrackSubposition = VehicleTrackSubposition::ChairliftStartBullwheel; } @@ -7112,9 +7112,9 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu } else if (TrackTypeIsBrakes(trackType)) { - bool hasBrakesFailure = curRide.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN - && curRide.breakdown_reason_pending == BREAKDOWN_BRAKES_FAILURE; - if (!hasBrakesFailure || curRide.mechanic_status == RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) + bool hasBrakesFailure = curRide.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN + && curRide.breakdownReasonPending == BREAKDOWN_BRAKES_FAILURE; + if (!hasBrakesFailure || curRide.mechanicStatus == RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { auto brakeSpeed = ChooseBrakeSpeed() << kTrackSpeedShiftAmount; @@ -7146,7 +7146,7 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu acceleration += CalculateRiderBraking(); } - if ((trackType == TrackElemType::Flat && curRide.GetRideTypeDescriptor().HasFlag(RtdFlag::hasLsmBehaviourOnFlat)) + if ((trackType == TrackElemType::Flat && curRide.getRideTypeDescriptor().HasFlag(RtdFlag::hasLsmBehaviourOnFlat)) || (trackType == TrackElemType::PoweredLift)) { acceleration = GetRideTypeDescriptor(curRide.type).LegacyBoosterSettings.PoweredLiftAcceleration @@ -7430,11 +7430,11 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(TrackElemType trackType, con { TileCoordsXYZ curLocation{ TrackLocation }; - if (curLocation == curRide.ChairliftBullwheelLocation[1]) + if (curLocation == curRide.chairliftBullwheelLocation[1]) { TrackSubposition = VehicleTrackSubposition::ChairliftEndBullwheel; } - else if (curLocation == curRide.ChairliftBullwheelLocation[0]) + else if (curLocation == curRide.chairliftBullwheelLocation[0]) { TrackSubposition = VehicleTrackSubposition::ChairliftStartBullwheel; } @@ -7501,7 +7501,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c while (true) { auto trackType = GetTrackType(); - if (trackType == TrackElemType::Flat && curRide.GetRideTypeDescriptor().HasFlag(RtdFlag::hasLsmBehaviourOnFlat)) + if (trackType == TrackElemType::Flat && curRide.getRideTypeDescriptor().HasFlag(RtdFlag::hasLsmBehaviourOnFlat)) { int32_t unkVelocity = _vehicleVelocityF64E08; if (unkVelocity < -524288) @@ -8211,7 +8211,7 @@ void Vehicle::Loc6DCE02(const Ride& curRide) _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_AT_STATION; - for (const auto& station : curRide.GetStations()) + for (const auto& station : curRide.getStations()) { if (TrackLocation != station.Start) { @@ -8221,7 +8221,7 @@ void Vehicle::Loc6DCE02(const Ride& curRide) { continue; } - _vehicleStationIndex = curRide.GetStationIndex(&station); + _vehicleStationIndex = curRide.getStationIndex(&station); } } diff --git a/src/openrct2/ride/rtd/gentle/SpiralSlide.h b/src/openrct2/ride/rtd/gentle/SpiralSlide.h index e0a72f02fe..2d8e487715 100644 --- a/src/openrct2/ride/rtd/gentle/SpiralSlide.h +++ b/src/openrct2/ride/rtd/gentle/SpiralSlide.h @@ -77,7 +77,7 @@ constexpr RideTypeDescriptor SpiralSlideRTD = .SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default, .GetGuestWaypointLocation = GetGuestWaypointLocationDefault, .ConstructionWindowContext = RideConstructionWindowContext::Default, - .RideUpdate = UpdateSpiralSlide, + .RideUpdate = updateSpiralSlide, .specialType = RtdSpecialType::spiralSlide, }; // clang-format on diff --git a/src/openrct2/ride/rtd/transport/Chairlift.h b/src/openrct2/ride/rtd/transport/Chairlift.h index 932a01e3f1..545236c6ff 100644 --- a/src/openrct2/ride/rtd/transport/Chairlift.h +++ b/src/openrct2/ride/rtd/transport/Chairlift.h @@ -88,6 +88,6 @@ constexpr RideTypeDescriptor ChairliftRTD = .SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default, .GetGuestWaypointLocation = GetGuestWaypointLocationDefault, .ConstructionWindowContext = RideConstructionWindowContext::Default, - .RideUpdate = UpdateChairlift, + .RideUpdate = updateChairlift, }; // clang-format on diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 39211f3927..e99b358731 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -535,18 +535,18 @@ static ResultWithMessage ScenarioPrepareRidesForSave(GameState_t& gameState) for (auto& ride : GetRideManager()) { - const auto* rideEntry = ride.GetRideEntry(); + const auto* rideEntry = ride.getRideEntry(); if (rideEntry != nullptr) { // If there are more than 5 roller coasters, only mark the first five. if (isFiveCoasterObjective && (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && rcs < 5)) { - ride.lifecycle_flags |= RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; + ride.lifecycleFlags |= RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; rcs++; } else { - ride.lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; + ride.lifecycleFlags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; } } } @@ -570,7 +570,7 @@ static ResultWithMessage ScenarioPrepareRidesForSave(GameState_t& gameState) auto ride = GetRide(it.element->AsTrack()->GetRideIndex()); // In the previous step, this flag was set on the first five roller coasters. - if (ride != nullptr && ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + if (ride != nullptr && ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { markTrackAsIndestructible = true; } @@ -661,7 +661,7 @@ ObjectiveStatus Objective::Check10RollerCoasters() const if (ride.status == RideStatus::open && ride.ratings.excitement >= MakeRideRating(6, 00) && ride.subtype != kObjectEntryIndexNull) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry != nullptr) { if (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && !type_already_counted[ride.subtype]) @@ -763,12 +763,12 @@ ObjectiveStatus Objective::Check10RollerCoastersLength() const if (ride.status == RideStatus::open && ride.ratings.excitement >= MakeRideRating(7, 00) && ride.subtype != kObjectEntryIndexNull) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry != nullptr) { if (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && !type_already_counted[ride.subtype]) { - if (ToHumanReadableRideLength(ride.GetTotalLength()) >= MinimumLength) + if (ToHumanReadableRideLength(ride.getTotalLength()) >= MinimumLength) { type_already_counted[ride.subtype] = true; rcs++; @@ -794,10 +794,10 @@ ObjectiveStatus Objective::CheckFinish5RollerCoasters() const { if (ride.status != RideStatus::closed && ride.ratings.excitement >= MinimumExcitement) { - auto rideEntry = ride.GetRideEntry(); + auto rideEntry = ride.getRideEntry(); if (rideEntry != nullptr) { - if ((ride.lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + if ((ride.lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster)) { rcs++; diff --git a/src/openrct2/scripting/bindings/game/ScProfiler.hpp b/src/openrct2/scripting/bindings/game/ScProfiler.hpp index 205295ccb2..014871833b 100644 --- a/src/openrct2/scripting/bindings/game/ScProfiler.hpp +++ b/src/openrct2/scripting/bindings/game/ScProfiler.hpp @@ -40,7 +40,7 @@ namespace OpenRCT2::Scripting obj.Set("callCount", f->GetCallCount()); obj.Set("minTime", f->GetMinTime()); obj.Set("maxTime", f->GetMaxTime()); - obj.Set("totalTime", f->GetTotalTime()); + obj.Set("totalTime", f->getTotalTime()); obj.Set("parents", GetFunctionIndexArray(data, f->GetParents())); obj.Set("children", GetFunctionIndexArray(data, f->GetChildren())); obj.Take().push(); diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp index c92c3060a7..f0cdd80e01 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - switch (ride->GetClassification()) + switch (ride->getClassification()) { case RideClassification::ride: return "ride"; @@ -72,7 +72,7 @@ namespace OpenRCT2::Scripting std::string ScRide::name_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->GetName() : std::string(); + return ride != nullptr ? ride->getName() : std::string(); } void ScRide::name_set(std::string value) { @@ -80,7 +80,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->custom_name = std::move(value); + ride->customName = std::move(value); } } @@ -109,7 +109,7 @@ namespace OpenRCT2::Scripting uint32_t ScRide::lifecycleFlags_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->lifecycle_flags : 0; + return ride != nullptr ? ride->lifecycleFlags : 0; } void ScRide::lifecycleFlags_set(uint32_t value) @@ -118,7 +118,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->lifecycle_flags = value; + ride->lifecycleFlags = value; } } @@ -141,7 +141,7 @@ namespace OpenRCT2::Scripting uint8_t ScRide::departFlags_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->depart_flags : 0; + return ride != nullptr ? ride->departFlags : 0; } void ScRide::departFlags_set(uint8_t value) @@ -150,14 +150,14 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->depart_flags = value; + ride->departFlags = value; } } uint8_t ScRide::minimumWaitingTime_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->min_waiting_time : 0; + return ride != nullptr ? ride->minWaitingTime : 0; } void ScRide::minimumWaitingTime_set(uint8_t value) @@ -166,14 +166,14 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->min_waiting_time = value; + ride->minWaitingTime = value; } } uint8_t ScRide::maximumWaitingTime_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->max_waiting_time : 0; + return ride != nullptr ? ride->maxWaitingTime : 0; } void ScRide::maximumWaitingTime_set(uint8_t value) @@ -182,7 +182,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->max_waiting_time = value; + ride->maxWaitingTime = value; } } @@ -192,7 +192,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - std::for_each(std::begin(ride->vehicles), std::begin(ride->vehicles) + ride->NumTrains, [&](auto& veh) { + std::for_each(std::begin(ride->vehicles), std::begin(ride->vehicles) + ride->numTrains, [&](auto& veh) { result.push_back(veh.ToUnderlying()); }); } @@ -206,7 +206,7 @@ namespace OpenRCT2::Scripting if (ride != nullptr) { auto ctx = GetContext()->GetScriptEngine().GetContext(); - for (const auto& vehicleColour : ride->vehicle_colours) + for (const auto& vehicleColour : ride->vehicleColours) { result.push_back(ToDuk(ctx, vehicleColour)); } @@ -219,10 +219,10 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - auto count = std::min(value.size(), std::size(ride->vehicle_colours)); + auto count = std::min(value.size(), std::size(ride->vehicleColours)); for (size_t i = 0; i < count; i++) { - ride->vehicle_colours[i] = FromDuk(value[i]); + ride->vehicleColours[i] = FromDuk(value[i]); } } } @@ -234,7 +234,7 @@ namespace OpenRCT2::Scripting if (ride != nullptr) { auto ctx = GetContext()->GetScriptEngine().GetContext(); - for (const auto& trackColour : ride->track_colour) + for (const auto& trackColour : ride->trackColours) { result.push_back(ToDuk(ctx, trackColour)); } @@ -247,10 +247,10 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - auto count = std::min(value.size(), std::size(ride->track_colour)); + auto count = std::min(value.size(), std::size(ride->trackColours)); for (size_t i = 0; i < count; i++) { - ride->track_colour[i] = FromDuk(value[i]); + ride->trackColours[i] = FromDuk(value[i]); } } } @@ -258,7 +258,7 @@ namespace OpenRCT2::Scripting ObjectEntryIndex ScRide::stationStyle_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->entrance_style : 0; + return ride != nullptr ? ride->entranceStyle : 0; } void ScRide::stationStyle_set(ObjectEntryIndex value) @@ -267,7 +267,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->entrance_style = value; + ride->entranceStyle = value; } } @@ -293,9 +293,9 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - for (const auto& station : ride->GetStations()) + for (const auto& station : ride->getStations()) { - result.push_back(std::make_shared(ride->id, ride->GetStationIndex(&station))); + result.push_back(std::make_shared(ride->id, ride->getStationIndex(&station))); } } return result; @@ -307,7 +307,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - auto numPrices = ride->GetNumPrices(); + auto numPrices = ride->getNumPrices(); for (size_t i = 0; i < numPrices; i++) { result.push_back(ride->price[i]); @@ -322,7 +322,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - auto numPrices = std::min(value.size(), ride->GetNumPrices()); + auto numPrices = std::min(value.size(), ride->getNumPrices()); for (size_t i = 0; i < numPrices; i++) { ride->price[i] = std::clamp(value[i], kRideMinPrice, kRideMaxPrice); @@ -378,7 +378,7 @@ namespace OpenRCT2::Scripting int32_t ScRide::totalCustomers_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->total_customers : 0; + return ride != nullptr ? ride->totalCustomers : 0; } void ScRide::totalCustomers_set(int32_t value) { @@ -386,14 +386,14 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->total_customers = value; + ride->totalCustomers = value; } } int32_t ScRide::buildDate_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->build_date : 0; + return ride != nullptr ? ride->buildDate : 0; } void ScRide::buildDate_set(int32_t value) { @@ -401,20 +401,20 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->build_date = value; + ride->buildDate = value; } } int32_t ScRide::age_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->GetAge() : 0; + return ride != nullptr ? ride->getAge() : 0; } money64 ScRide::runningCost_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->upkeep_cost : 0; + return ride != nullptr ? ride->upkeepCost : 0; } void ScRide::runningCost_set(money64 value) { @@ -422,14 +422,14 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->upkeep_cost = value; + ride->upkeepCost = value; } } int32_t ScRide::totalProfit_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->total_profit : 0; + return ride != nullptr ? ride->totalProfit : 0; } void ScRide::totalProfit_set(int32_t value) { @@ -437,14 +437,14 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->total_profit = value; + ride->totalProfit = value; } } uint8_t ScRide::inspectionInterval_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->inspection_interval : 0; + return ride != nullptr ? ride->inspectionInterval : 0; } void ScRide::inspectionInterval_set(uint8_t value) { @@ -452,7 +452,7 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride != nullptr) { - ride->inspection_interval = std::clamp(value, RIDE_INSPECTION_EVERY_10_MINUTES, RIDE_INSPECTION_NEVER); + ride->inspectionInterval = std::clamp(value, RIDE_INSPECTION_EVERY_10_MINUTES, RIDE_INSPECTION_NEVER); } } @@ -498,7 +498,7 @@ namespace OpenRCT2::Scripting uint8_t ScRide::liftHillSpeed_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->lift_hill_speed : 0; + return ride != nullptr ? ride->liftHillSpeed : 0; } void ScRide::lifthillSpeed_set(uint8_t value) @@ -508,20 +508,20 @@ namespace OpenRCT2::Scripting auto ride = GetRide(); if (ride) { - ride->lift_hill_speed = value; + ride->liftHillSpeed = value; } } uint8_t ScRide::maxLiftHillSpeed_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->GetRideTypeDescriptor().LiftData.maximum_speed : 0; + return ride != nullptr ? ride->getRideTypeDescriptor().LiftData.maximum_speed : 0; } uint8_t ScRide::minLiftHillSpeed_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->GetRideTypeDescriptor().LiftData.minimum_speed : 0; + return ride != nullptr ? ride->getRideTypeDescriptor().LiftData.minimum_speed : 0; } uint8_t ScRide::satisfaction_get() const @@ -533,43 +533,43 @@ namespace OpenRCT2::Scripting double ScRide::maxSpeed_get() const { auto ride = GetRide(); - return ride != nullptr ? ToHumanReadableSpeed(ride->max_speed) : 0; + return ride != nullptr ? ToHumanReadableSpeed(ride->maxSpeed) : 0; } double ScRide::averageSpeed_get() const { auto ride = GetRide(); - return ride != nullptr ? ToHumanReadableSpeed(ride->average_speed) : 0; + return ride != nullptr ? ToHumanReadableSpeed(ride->averageSpeed) : 0; } int32_t ScRide::rideTime_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->GetTotalTime() : 0; + return ride != nullptr ? ride->getTotalTime() : 0; } double ScRide::rideLength_get() const { auto ride = GetRide(); - return ride != nullptr ? ToHumanReadableRideLength(ride->GetTotalLength()) : 0; + return ride != nullptr ? ToHumanReadableRideLength(ride->getTotalLength()) : 0; } double ScRide::maxPositiveVerticalGs_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->max_positive_vertical_g / 100.0 : 0; + return ride != nullptr ? ride->maxPositiveVerticalG / 100.0 : 0; } double ScRide::maxNegativeVerticalGs_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->max_negative_vertical_g / 100.0 : 0; + return ride != nullptr ? ride->maxNegativeVerticalG / 100.0 : 0; } double ScRide::maxLateralGs_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->max_lateral_g / 100.0 : 0; + return ride != nullptr ? ride->maxLateralG / 100.0 : 0; } double ScRide::totalAirTime_get() const @@ -593,7 +593,7 @@ namespace OpenRCT2::Scripting double ScRide::highestDropHeight_get() const { auto ride = GetRide(); - return ride != nullptr ? ride->highest_drop_height : 0; + return ride != nullptr ? ride->highestDropHeight : 0; } void ScRide::Register(duk_context* ctx) diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp index c1363486fd..9b48bf7cf7 100644 --- a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp @@ -120,9 +120,9 @@ namespace OpenRCT2::Scripting auto ride = GetRide(_rideId); if (ride != nullptr) { - if (_stationIndex.ToUnderlying() < std::size(ride->GetStations())) + if (_stationIndex.ToUnderlying() < std::size(ride->getStations())) { - return &ride->GetStation(_stationIndex); + return &ride->getStation(_stationIndex); } } return nullptr; diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index ebb7251d2c..4cc07164a4 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -507,7 +507,7 @@ namespace OpenRCT2::Scripting if (ride != nullptr) { - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) throw DukException() << "Cannot read 'sequence' property, TrackElement belongs to a maze."; } @@ -560,7 +560,7 @@ namespace OpenRCT2::Scripting if (ride != nullptr) { - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) throw DukException() << "Cannot set 'sequence' property, TrackElement belongs to a maze."; } @@ -833,7 +833,7 @@ namespace OpenRCT2::Scripting if (ride == nullptr) throw DukException() << "Cannot read 'mazeEntry' property, ride is invalid."; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) throw DukException() << "Cannot read 'mazeEntry' property, ride is not a maze."; @@ -863,7 +863,7 @@ namespace OpenRCT2::Scripting if (ride == nullptr) throw DukException() << "Cannot set 'mazeEntry' property, ride is invalid."; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) throw DukException() << "Cannot set 'mazeEntry' property, ride is not a maze."; @@ -891,7 +891,7 @@ namespace OpenRCT2::Scripting if (ride == nullptr) throw DukException() << "Cannot read 'colourScheme' property, ride is invalid."; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) throw DukException() << "Cannot read 'colourScheme' property, TrackElement belongs to a maze."; @@ -921,7 +921,7 @@ namespace OpenRCT2::Scripting if (ride == nullptr) throw DukException() << "Cannot set 'colourScheme', ride is invalid."; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) throw DukException() << "Cannot set 'colourScheme' property, TrackElement belongs to a maze."; @@ -949,7 +949,7 @@ namespace OpenRCT2::Scripting if (ride == nullptr) throw DukException() << "Cannot read 'seatRotation' property, ride is invalid."; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) throw DukException() << "Cannot read 'seatRotation' property, TrackElement belongs to a maze."; @@ -979,7 +979,7 @@ namespace OpenRCT2::Scripting if (ride == nullptr) throw DukException() << "Cannot set 'seatRotation' property, ride is invalid."; - const auto& rtd = ride->GetRideTypeDescriptor(); + const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::maze) throw DukException() << "Cannot set 'seatRotation' property, TrackElement belongs to a maze."; diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 0667a7ad7f..5238400baa 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -74,7 +74,7 @@ void Banner::FormatTextTo(Formatter& ft) const auto ride = GetRide(ride_index); if (ride != nullptr) { - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } else { @@ -108,7 +108,7 @@ static RideId BannerGetRideIndexAt(const CoordsXYZ& bannerCoords) RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); - if (ride == nullptr || ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride == nullptr || ride->getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) continue; if ((tileElement->GetClearanceZ()) + (4 * kCoordsZStep) <= bannerCoords.z) @@ -229,10 +229,10 @@ RideId BannerGetClosestRideIndex(const CoordsXYZ& mapPos) auto resultDistance = std::numeric_limits::max(); for (auto& ride : GetRideManager()) { - if (ride.GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) + if (ride.getRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) continue; - auto rideCoords = ride.overall_view; + auto rideCoords = ride.overallView; if (rideCoords.IsNull()) continue; diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 35e2167e4b..e22084aff9 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -110,7 +110,7 @@ static bool MapLoc68BABCShouldContinue( && tileElement->AsTrack()->GetTrackType() == TrackElemType::Flat) { auto ride = GetRide(tileElement->AsTrack()->GetRideIndex()); - if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::supportsLevelCrossings)) + if (ride != nullptr && ride->getRideTypeDescriptor().HasFlag(RtdFlag::supportsLevelCrossings)) { return true; } @@ -313,7 +313,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r res.ErrorMessage = STR_X_IN_THE_WAY; Formatter ft(res.ErrorMessageArgs.data()); - ride->FormatNameTo(ft); + ride->formatNameTo(ft); } break; case TileElementType::SmallScenery: diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index bbb44b855c..9b89a21dbc 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -610,7 +610,7 @@ static void Loc6A6D7E( continue; } - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) { continue; } @@ -696,7 +696,7 @@ static void Loc6A6C85( return; } - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) { return; } @@ -954,7 +954,7 @@ void FootpathUpdateQueueChains() if (ride == nullptr) continue; - for (const auto& station : ride->GetStations()) + for (const auto& station : ride->getStations()) { if (station.Entrance.IsNull()) continue; @@ -973,7 +973,7 @@ void FootpathUpdateQueueChains() Direction direction = DirectionReverse(tileElement->GetDirection()); FootpathChainRideQueue( - rideIndex, ride->GetStationIndex(&station), station.Entrance.ToCoordsXY(), tileElement, direction); + rideIndex, ride->getStationIndex(&station), station.Entrance.ToCoordsXY(), tileElement, direction); } while (!(tileElement++)->IsLastForTile()); } } @@ -1661,7 +1661,7 @@ bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const T if (ride == nullptr) continue; - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) break; const auto trackType = tileElement->AsTrack()->GetTrackType(); @@ -1754,7 +1754,7 @@ void FootpathRemoveEdgesAt(const CoordsXY& footpathPos, TileElement* tileElement if (ride == nullptr) return; - if (!ride->GetRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) + if (!ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)) return; } @@ -2043,7 +2043,7 @@ bool PathElement::IsLevelCrossing(const CoordsXY& coords) const return false; } - return ride->GetRideTypeDescriptor().HasFlag(RtdFlag::supportsLevelCrossings); + return ride->getRideTypeDescriptor().HasFlag(RtdFlag::supportsLevelCrossings); } bool FootpathIsZAndDirectionValid(const PathElement& pathElement, int32_t currentZ, int32_t currentDirection) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index c0635c9bc0..dbf63bd70b 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -2349,7 +2349,7 @@ void ShiftMap(const TileCoordsXY& amount) // Rides for (auto& ride : GetRideManager()) { - auto stations = ride.GetStations(); + auto stations = ride.getStations(); for (auto& station : stations) { shiftIfNotNull(station.Start, amountToMove); @@ -2357,12 +2357,12 @@ void ShiftMap(const TileCoordsXY& amount) shiftIfNotNull(station.Exit, amount); } - shiftIfNotNull(ride.overall_view, amountToMove); - shiftIfNotNull(ride.boat_hire_return_position, amount); - shiftIfNotNull(ride.CurTestTrackLocation, amount); - shiftIfNotNull(ride.ChairliftBullwheelLocation[0], amount); - shiftIfNotNull(ride.ChairliftBullwheelLocation[1], amount); - shiftIfNotNull(ride.CableLiftLoc, amountToMove); + shiftIfNotNull(ride.overallView, amountToMove); + shiftIfNotNull(ride.boatHireReturnPosition, amount); + shiftIfNotNull(ride.curTestTrackLocation, amount); + shiftIfNotNull(ride.chairliftBullwheelLocation[0], amount); + shiftIfNotNull(ride.chairliftBullwheelLocation[1], amount); + shiftIfNotNull(ride.cableLiftLoc, amountToMove); } // Banners diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 98c1819b82..8f06244617 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -120,7 +120,7 @@ static bool MapAnimationInvalidateRideEntrance(const CoordsXYZ& loc) auto ride = GetRide(tileElement->AsEntrance()->GetRideIndex()); if (ride != nullptr) { - auto stationObj = ride->GetStationObject(); + auto stationObj = ride->getStationObject(); if (stationObj != nullptr) { int32_t height = loc.z + stationObj->Height + 8; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 25bc8da841..7e906171fa 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -77,7 +77,7 @@ namespace OpenRCT2::Park money64 result = 0; if (ride.value != kRideValueUndefined) { - const auto& rtd = ride.GetRideTypeDescriptor(); + const auto& rtd = ride.getRideTypeDescriptor(); result = (ride.value * 10) * (static_cast(RideCustomersInLast5Minutes(ride)) + rtd.BonusValue * 4LL); } return result; @@ -91,9 +91,9 @@ namespace OpenRCT2::Park { if (ride.status != RideStatus::open) continue; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) continue; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED) continue; // Add ride value @@ -124,30 +124,30 @@ namespace OpenRCT2::Park { if (ride.status != RideStatus::open) continue; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) continue; - if (ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED) + if (ride.lifecycleFlags & RIDE_LIFECYCLE_CRASHED) continue; // Add guest score for ride type - suggestedMaxGuests += ride.GetRideTypeDescriptor().BonusValue; + suggestedMaxGuests += ride.getRideTypeDescriptor().BonusValue; // If difficult guest generation, extra guests are available for good rides if (gameState.Park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION) { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (!(ride.lifecycleFlags & RIDE_LIFECYCLE_TESTED)) continue; - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)) continue; - if (!ride.GetRideTypeDescriptor().HasFlag(RtdFlag::hasDataLogging)) + if (!ride.getRideTypeDescriptor().HasFlag(RtdFlag::hasDataLogging)) continue; - if (ride.GetStation().SegmentLength < (600 << 16)) + if (ride.getStation().SegmentLength < (600 << 16)) continue; if (ride.ratings.excitement < MakeRideRating(6, 00)) continue; // Bonus guests for good ride - difficultGenerationBonus += ride.GetRideTypeDescriptor().BonusValue * 2; + difficultGenerationBonus += ride.getRideTypeDescriptor().BonusValue * 2; } } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 1ba81876df..4d5bf10120 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -240,7 +240,7 @@ namespace OpenRCT2::TileInspector if (ride != nullptr) { auto stationIndex = tileElement->AsEntrance()->GetStationIndex(); - auto& station = ride->GetStation(stationIndex); + auto& station = ride->getStation(stationIndex); auto entrance = station.Entrance; auto exit = station.Exit; uint8_t entranceType = tileElement->AsEntrance()->GetEntranceType(); @@ -470,7 +470,7 @@ namespace OpenRCT2::TileInspector if (ride != nullptr) { auto entranceIndex = tileElement->AsEntrance()->GetStationIndex(); - auto& station = ride->GetStation(entranceIndex); + auto& station = ride->getStation(entranceIndex); const auto& entranceLoc = station.Entrance; const auto& exitLoc = station.Exit; uint8_t z = tileElement->BaseHeight; @@ -653,7 +653,7 @@ namespace OpenRCT2::TileInspector if (isExecuting) { auto stationIndex = entranceElement->AsEntrance()->GetStationIndex(); - auto& station = ride->GetStation(stationIndex); + auto& station = ride->getStation(stationIndex); switch (entranceElement->AsEntrance()->GetEntranceType()) { diff --git a/src/openrct2/world/tile_element/TrackElement.cpp b/src/openrct2/world/tile_element/TrackElement.cpp index 9dfe8a1e50..30dc26314e 100644 --- a/src/openrct2/world/tile_element/TrackElement.cpp +++ b/src/openrct2/world/tile_element/TrackElement.cpp @@ -64,7 +64,7 @@ bool TrackElement::IsStation() const uint8_t TrackElement::GetSeatRotation() const { const auto* ride = GetRide(GetRideIndex()); - if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) + if (ride != nullptr && ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) return DEFAULT_SEAT_ROTATION; return URide.ColourScheme >> 4; diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 4a46e8c105..0865c48cc5 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -59,7 +59,7 @@ protected: { for (auto& ride : GetRideManager()) { - auto thisName = ride.GetName(); + auto thisName = ride.getName(); if (String::startsWith(thisName, u8string{ name }, true)) { return &ride; @@ -201,7 +201,7 @@ TEST_P(SimplePathfindingTest, CanFindPathFromStartToGoal) auto ride = FindRideByName(scenario.name); ASSERT_NE(ride, nullptr); - auto entrancePos = ride->GetStation().Entrance; + auto entrancePos = ride->getStation().Entrance; TileCoordsXYZ goal = TileCoordsXYZ( entrancePos.x - TileDirectionDelta[entrancePos.direction].x, entrancePos.y - TileDirectionDelta[entrancePos.direction].y, entrancePos.z); @@ -239,7 +239,7 @@ TEST_P(ImpossiblePathfindingTest, CannotFindPathFromStartToGoal) auto ride = FindRideByName(scenario.name); ASSERT_NE(ride, nullptr); - auto entrancePos = ride->GetStation().Entrance; + auto entrancePos = ride->getStation().Entrance; TileCoordsXYZ goal = TileCoordsXYZ( entrancePos.x + TileDirectionDelta[entrancePos.direction].x, entrancePos.y + TileDirectionDelta[entrancePos.direction].y, entrancePos.z); diff --git a/test/tests/RideRatings.cpp b/test/tests/RideRatings.cpp index 15f343a0a4..54f341a221 100644 --- a/test/tests/RideRatings.cpp +++ b/test/tests/RideRatings.cpp @@ -48,7 +48,7 @@ protected: std::string FormatRatings(const Ride& ride) { RatingTuple ratings = ride.ratings; - auto name = std::string(ride.GetRideTypeDescriptor().Name); + auto name = std::string(ride.getRideTypeDescriptor().Name); std::string line = String::stdFormat( "%s: (%d, %d, %d)", name.c_str(), static_cast(ratings.excitement), static_cast(ratings.intensity), static_cast(ratings.nausea));