From 5dba30778d055be79c4104265269bd7aa96bc4ee Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 8 Oct 2022 10:56:17 +0100 Subject: [PATCH] Code style: Remove more snakes from the park, maphelper, scenery. (#18222) --- .../interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- src/openrct2-ui/windows/Banner.cpp | 2 +- src/openrct2-ui/windows/Cheats.cpp | 10 ++--- .../windows/EditorBottomToolbar.cpp | 2 +- .../windows/EditorObjectiveOptions.cpp | 5 +-- .../windows/EditorScenarioOptions.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 25 +++++------ src/openrct2-ui/windows/Ride.cpp | 4 +- src/openrct2-ui/windows/Scenery.cpp | 36 +++++++-------- src/openrct2-ui/windows/Sign.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 44 +++++++++---------- src/openrct2/Editor.cpp | 4 +- src/openrct2/EditorObjectSelectionSession.cpp | 2 +- src/openrct2/Game.cpp | 2 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/actions/BannerPlaceAction.cpp | 4 +- src/openrct2/actions/BannerRemoveAction.cpp | 4 +- src/openrct2/actions/ChangeMapSizeAction.cpp | 2 +- .../actions/FootpathAdditionPlaceAction.cpp | 6 +-- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/LandBuyRightsAction.cpp | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 4 +- .../actions/ParkEntranceRemoveAction.cpp | 2 +- .../actions/PlaceParkEntranceAction.cpp | 10 ++--- src/openrct2/actions/RideCreateAction.cpp | 2 +- src/openrct2/actions/SetCheatAction.cpp | 8 ++-- .../actions/SetParkEntranceFeeAction.cpp | 2 +- src/openrct2/actions/WallPlaceAction.cpp | 4 +- src/openrct2/entity/Peep.cpp | 2 +- src/openrct2/entity/Staff.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 6 +-- src/openrct2/management/Award.cpp | 6 +-- src/openrct2/management/Marketing.cpp | 8 ++-- src/openrct2/management/Research.cpp | 20 ++++----- .../paint/tile_element/Paint.Banner.cpp | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 4 +- src/openrct2/scenario/Scenario.cpp | 6 +-- src/openrct2/windows/_legacy.cpp | 4 +- src/openrct2/world/Banner.cpp | 2 +- src/openrct2/world/Footpath.cpp | 2 +- src/openrct2/world/Map.cpp | 10 ++--- src/openrct2/world/MapGen.cpp | 4 +- src/openrct2/world/MapHelpers.cpp | 30 ++++++------- src/openrct2/world/MapHelpers.h | 4 +- src/openrct2/world/Park.cpp | 42 +++++++++--------- src/openrct2/world/Park.h | 22 +++++----- src/openrct2/world/Scenery.cpp | 22 +++++----- src/openrct2/world/Scenery.h | 18 ++++---- src/openrct2/world/TileInspector.cpp | 2 +- src/openrct2/world/Wall.cpp | 2 +- test/tests/PlayTests.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 55 files changed, 212 insertions(+), 214 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 6584bf6cf4..610fd3aba7 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -428,7 +428,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor auto banner = tileElement->AsBanner()->GetBanner(); if (banner != nullptr) { - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); auto ft = Formatter(); ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 7978d069d4..aae8cb2612 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -382,7 +382,7 @@ namespace OpenRCT2::Title reset_all_sprite_quadrant_placements(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); context_broadcast_intent(&intent); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); News::InitQueue(); load_palette(); gScreenAge = 0; diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 86e219dcf3..f671d73a36 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -274,7 +274,7 @@ public: rct_widget* colourBtn = &window_banner_widgets[WIDX_MAIN_COLOUR]; colourBtn->type = WindowWidgetType::Empty; - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry != nullptr && (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)) { colourBtn->type = WindowWidgetType::ColourBtn; diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index bcf1246b78..86091632cb 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -361,7 +361,7 @@ public: void OnOpen() override { SetPage(WINDOW_CHEATS_PAGE_MONEY); - _parkRatingSpinnerValue = get_forced_park_rating() >= 0 ? get_forced_park_rating() : 999; + _parkRatingSpinnerValue = ParkGetForcedRating() >= 0 ? ParkGetForcedRating() : 999; } void OnUpdate() override @@ -471,7 +471,7 @@ public: case WINDOW_CHEATS_PAGE_MISC: widgets[WIDX_OPEN_CLOSE_PARK].text = (gParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK : STR_CHEAT_OPEN_PARK; - SetCheckboxValue(WIDX_FORCE_PARK_RATING, get_forced_park_rating() >= 0); + SetCheckboxValue(WIDX_FORCE_PARK_RATING, ParkGetForcedRating() >= 0); SetCheckboxValue(WIDX_FREEZE_WEATHER, gCheatsFreezeWeather); SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gCheatsNeverendingMarketing); SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gCheatsDisablePlantAging); @@ -789,7 +789,7 @@ private: case WIDX_INCREASE_PARK_RATING: _parkRatingSpinnerValue = std::min(999, 10 * (_parkRatingSpinnerValue / 10 + 1)); InvalidateWidget(WIDX_PARK_RATING_SPINNER); - if (get_forced_park_rating() >= 0) + if (ParkGetForcedRating() >= 0) { auto setCheatAction = SetCheatAction(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); GameActions::Execute(&setCheatAction); @@ -798,7 +798,7 @@ private: case WIDX_DECREASE_PARK_RATING: _parkRatingSpinnerValue = std::max(0, 10 * (_parkRatingSpinnerValue / 10 - 1)); InvalidateWidget(WIDX_PARK_RATING_SPINNER); - if (get_forced_park_rating() >= 0) + if (ParkGetForcedRating() >= 0) { CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); } @@ -887,7 +887,7 @@ private: CheatsSet(CheatType::NeverEndingMarketing, !gCheatsNeverendingMarketing); break; case WIDX_FORCE_PARK_RATING: - if (get_forced_park_rating() >= 0) + if (ParkGetForcedRating() >= 0) { CheatsSet(CheatType::SetForcedParkRating, -1); } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 7379f34422..0675671b4a 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -157,7 +157,7 @@ private: { window_close_all(); set_all_scenery_items_invented(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); gEditorStep = EditorStep::LandscapeEditor; context_open_window(WindowClass::Map); gfx_invalidate_screen(); diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 3e98b9ace4..de5e18fb35 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -391,7 +391,7 @@ static void WindowEditorObjectiveOptionsShowObjectiveDropdown(rct_window* w) const bool objectiveAllowedByMoneyUsage = !(parkFlags & PARK_FLAGS_NO_MONEY) || !ObjectiveNeedsMoney(i); // This objective can only work if the player can ask money for rides. - const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME) || park_ride_prices_unlocked(); + const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME) || ParkRidePricesUnlocked(); if (objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings) { gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; @@ -664,8 +664,7 @@ static void WindowEditorObjectiveOptionsMainUpdate(rct_window* w) // Check if objective is allowed by money and pay-per-ride settings. const bool objectiveAllowedByMoneyUsage = !(parkFlags & PARK_FLAGS_NO_MONEY) || !ObjectiveNeedsMoney(objectiveType); // This objective can only work if the player can ask money for rides. - const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME) - || park_ride_prices_unlocked(); + const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME) || ParkRidePricesUnlocked(); if (!objectiveAllowedByMoneyUsage || !objectiveAllowedByPaymentSettings) { // Reset objective diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 725fe4fb50..9a5dc8c27c 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -1133,7 +1133,7 @@ private: widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type = WindowWidgetType::DropdownMenu; widgets[WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN].type = WindowWidgetType::Button; - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) { widgets[WIDX_ENTRY_PRICE].type = WindowWidgetType::Empty; widgets[WIDX_ENTRY_PRICE_INCREASE].type = WindowWidgetType::Empty; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index b1c8e9cf33..49b648126e 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -426,10 +426,10 @@ private: break; } case WIDX_CLOSE_LIGHT: - park_set_open(false); + ParkSetOpen(false); break; case WIDX_OPEN_LIGHT: - park_set_open(true); + ParkSetOpen(true); break; } } @@ -453,7 +453,7 @@ private: WindowDropdownShowText( { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2); - if (park_is_open()) + if (ParkIsOpen()) { gDropdownDefaultIndex = 0; Dropdown::SetChecked(1, true); @@ -475,11 +475,11 @@ private: if (dropdownIndex != 0) { - park_set_open(true); + ParkSetOpen(true); } else { - park_set_open(false); + ParkSetOpen(false); } } } @@ -515,11 +515,10 @@ private: ft.Add(STR_STRING); ft.Add(parkName); } - widgets[WIDX_OPEN_OR_CLOSE].image = park_is_open() ? SPR_OPEN : SPR_CLOSED; - widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + !park_is_open() * 2 + widgets[WIDX_OPEN_OR_CLOSE].image = ParkIsOpen() ? SPR_OPEN : SPR_CLOSED; + widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + !ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); - widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + park_is_open() * 2 - + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); + widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); // Only allow closing of park for guest / rating objective if (gScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) @@ -600,7 +599,7 @@ private: // Draw park closed / open label auto ft = Formatter(); - ft.Add(park_is_open() ? STR_PARK_OPEN : STR_PARK_CLOSED); + ft.Add(ParkIsOpen() ? STR_PARK_OPEN : STR_PARK_CLOSED); auto* labelWidget = &widgets[WIDX_STATUS]; DrawTextEllipsised( @@ -864,14 +863,14 @@ private: widgets[WIDX_PRICE_LABEL].tooltip = STR_NONE; widgets[WIDX_PRICE].tooltip = STR_NONE; - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) { widgets[WIDX_PRICE_LABEL].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; widgets[WIDX_PRICE].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; } // If the entry price is locked at free, disable the widget, unless the unlock_all_prices cheat is active. - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !park_entry_price_unlocked()) + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !ParkEntranceFeeUnlocked()) { widgets[WIDX_PRICE].type = WindowWidgetType::LabelCentred; widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Empty; @@ -899,7 +898,7 @@ private: ft.Add(gTotalIncomeFromAdmissions); DrawTextBasic(&dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); - money64 parkEntranceFee = park_get_entrance_fee(); + money64 parkEntranceFee = ParkGetEntranceFee(); auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PRICE].left + 1, widgets[WIDX_PRICE].top + 1 }; ft = Formatter(); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e6af4f712f..647a886799 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -6448,7 +6448,7 @@ static bool WindowRideIncomeCanModifyPrimaryPrice(rct_window* w) auto rideEntry = ride->GetRideEntry(); const auto& rtd = ride->GetRideTypeDescriptor(); - return park_ride_prices_unlocked() || rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) + return ParkRidePricesUnlocked() || rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::None); } @@ -6648,7 +6648,7 @@ static void WindowRideIncomeInvalidate(rct_window* w) // 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(); - if (!park_ride_prices_unlocked() && rideEntry->shop_item[0] == ShopItem::None && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) + if (!ParkRidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) { w->disabled_widgets |= (1ULL << WIDX_PRIMARY_PRICE); window_ride_income_widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index faa843e5bd..0f73ae6c51 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -120,7 +120,7 @@ private: const rct_scenery_group_entry* GetSceneryGroupEntry() const { - return get_scenery_group_entry(SceneryGroupIndex); + return ::GetSceneryGroupEntry(SceneryGroupIndex); } }; @@ -166,7 +166,7 @@ public: void OnClose() override { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); hide_gridlines(); viewport_set_visibility(0); @@ -189,7 +189,7 @@ public: case WIDX_SCENERY_ROTATE_OBJECTS_BUTTON: gWindowSceneryRotation++; gWindowSceneryRotation = gWindowSceneryRotation % 4; - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); Invalidate(); break; case WIDX_SCENERY_REPAINT_SCENERY_BUTTON: @@ -204,7 +204,7 @@ public: gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled; if (gWindowSceneryScatterEnabled) window_close_by_class(WindowClass::SceneryScatter); - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); Invalidate(); break; case WIDX_SCENERY_BUILD_CLUSTER_BUTTON: @@ -420,11 +420,11 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) { - gCurrentToolId = static_cast(get_wall_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetWallEntry(tabSelectedScenery.EntryIndex)->tool_id); } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_PATH_ITEM) { // path bit - gCurrentToolId = static_cast(get_footpath_item_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetFootpathItemEntry(tabSelectedScenery.EntryIndex)->tool_id); } else { // small scenery @@ -564,7 +564,7 @@ public: { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) { - auto* bannerEntry = get_banner_entry(tabSelectedScenery.EntryIndex); + auto* bannerEntry = GetBannerEntry(tabSelectedScenery.EntryIndex); if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; @@ -583,7 +583,7 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) { - auto* wallEntry = get_wall_entry(tabSelectedScenery.EntryIndex); + auto* wallEntry = GetWallEntry(tabSelectedScenery.EntryIndex); if (wallEntry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS)) { widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; @@ -750,7 +750,7 @@ public: for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < MaxTabs - 1; scenerySetIndex++) { - const auto* sceneryGroupEntry = get_scenery_group_entry(scenerySetIndex); + const auto* sceneryGroupEntry = GetSceneryGroupEntry(scenerySetIndex); if (sceneryGroupEntry != nullptr && scenery_group_is_invented(scenerySetIndex)) { SceneryTabInfo tabInfo; @@ -795,7 +795,7 @@ public: // walls for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_wall_entry(sceneryId); + const auto* sceneryEntry = GetWallEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_WALL, sceneryId }, sceneryEntry->scenery_tab_id); @@ -805,7 +805,7 @@ public: // banners for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_banner_entry(sceneryId); + const auto* sceneryEntry = GetBannerEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_BANNER, sceneryId }, sceneryEntry->scenery_tab_id); @@ -815,7 +815,7 @@ public: // path bits for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_footpath_item_entry(sceneryId); + const auto* sceneryEntry = GetFootpathItemEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_PATH_ITEM, sceneryId }, sceneryEntry->scenery_tab_id); @@ -1131,7 +1131,7 @@ private: } case SCENERY_TYPE_PATH_ITEM: { - auto* sceneryEntry = get_footpath_item_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetFootpathItemEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1141,7 +1141,7 @@ private: } case SCENERY_TYPE_WALL: { - auto* sceneryEntry = get_wall_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetWallEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1161,7 +1161,7 @@ private: } case SCENERY_TYPE_BANNER: { - auto* sceneryEntry = get_banner_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetBannerEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1193,7 +1193,7 @@ private: { if (scenerySelection.SceneryType == SCENERY_TYPE_BANNER) { - auto bannerEntry = get_banner_entry(scenerySelection.EntryIndex); + auto bannerEntry = GetBannerEntry(scenerySelection.EntryIndex); auto imageId = ImageId(bannerEntry->image + gWindowSceneryRotation * 2, gWindowSceneryPrimaryColour); gfx_draw_sprite(&dpi, imageId, { 33, 40 }); gfx_draw_sprite(&dpi, imageId.WithIndexOffset(1), { 33, 40 }); @@ -1212,7 +1212,7 @@ private: } else if (scenerySelection.SceneryType == SCENERY_TYPE_WALL) { - auto wallEntry = get_wall_entry(scenerySelection.EntryIndex); + auto wallEntry = GetWallEntry(scenerySelection.EntryIndex); auto imageId = ImageId(wallEntry->image); auto spriteTop = (wallEntry->height * 2) + 0x32; if (wallEntry->flags & WALL_SCENERY_HAS_GLASS) @@ -1248,7 +1248,7 @@ private: } else if (scenerySelection.SceneryType == SCENERY_TYPE_PATH_ITEM) { - auto* pathBitEntry = get_footpath_item_entry(scenerySelection.EntryIndex); + auto* pathBitEntry = GetFootpathItemEntry(scenerySelection.EntryIndex); auto imageId = ImageId(pathBitEntry->image); gfx_draw_sprite(&dpi, imageId, { 11, 16 }); } diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 90c53ee128..70b59062e6 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -244,7 +244,7 @@ public: if (_isSmall) { - auto* wallEntry = get_wall_entry(_sceneryEntry); + auto* wallEntry = GetWallEntry(_sceneryEntry); main_colour_btn->type = WindowWidgetType::Empty; text_colour_btn->type = WindowWidgetType::Empty; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index c97a3b2535..ca8d1a14cc 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1144,7 +1144,7 @@ public: if (tileElement->AsPath()->HasAddition()) { const auto pathAdditionType = tileElement->AsPath()->GetAdditionEntryIndex(); - const auto* pathBitEntry = get_footpath_item_entry(pathAdditionType); + const auto* pathBitEntry = GetFootpathItemEntry(pathAdditionType); StringId additionNameId = pathBitEntry != nullptr ? pathBitEntry->name : static_cast(STR_UNKNOWN_OBJECT_TYPE); auto ft = Formatter(); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index c0a5d9363c..b130bba44e 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1074,7 +1074,7 @@ static void RepaintSceneryToolDown(const ScreenCoordsXY& windowPos, WidgetIndex auto banner = info.Element->AsBanner()->GetBanner(); if (banner != nullptr) { - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { auto repaintScenery = BannerSetColourAction( @@ -1116,7 +1116,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd case ViewportInteractionItem::Wall: { auto entryIndex = info.Element->AsWall()->GetEntryIndex(); - auto* sceneryEntry = get_wall_entry(entryIndex); + auto* sceneryEntry = GetWallEntry(entryIndex); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1143,7 +1143,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd auto banner = info.Element->AsBanner()->GetBanner(); if (banner != nullptr) { - auto sceneryEntry = get_banner_entry(banner->type); + auto sceneryEntry = GetBannerEntry(banner->type); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1155,7 +1155,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd case ViewportInteractionItem::FootpathItem: { auto entryIndex = info.Element->AsPath()->GetAdditionEntryIndex(); - auto* pathBitEntry = get_footpath_item_entry(entryIndex); + auto* pathBitEntry = GetFootpathItemEntry(entryIndex); if (pathBitEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1484,7 +1484,7 @@ static void Sub6E1F34Wall( auto screenPos = sourceScreenPos; uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); - auto* wallEntry = get_wall_entry(sceneryIndex); + auto* wallEntry = GetWallEntry(sceneryIndex); if (wallEntry != nullptr) { maxPossibleHeight -= wallEntry->height; @@ -1713,7 +1713,7 @@ static void Sub6E1F34Banner( */ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct_window* w, WidgetIndex widgetIndex) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); if (gWindowSceneryPaintEnabled & 1) { RepaintSceneryToolDown(windowPos, widgetIndex); @@ -2469,7 +2469,7 @@ static money64 TryPlaceGhostSmallScenery( CoordsXYZD loc, uint8_t quadrant, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e252b auto smallSceneryPlaceAction = SmallSceneryPlaceAction( @@ -2504,7 +2504,7 @@ static money64 TryPlaceGhostSmallScenery( static money64 TryPlaceGhostPathAddition(CoordsXYZ loc, ObjectEntryIndex entryIndex) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e265b auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction(loc, entryIndex + 1); @@ -2528,7 +2528,7 @@ static money64 TryPlaceGhostWall( CoordsXYZ loc, uint8_t edge, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e26b0 auto wallPlaceAction = WallPlaceAction(entryIndex, loc, edge, primaryColour, secondaryColour, tertiaryColour); @@ -2554,7 +2554,7 @@ static money64 TryPlaceGhostWall( static money64 TryPlaceGhostLargeScenery( CoordsXYZD loc, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e25a7 auto sceneryPlaceAction = LargeSceneryPlaceAction(loc, entryIndex, primaryColour, secondaryColour, tertiaryColour); @@ -2585,7 +2585,7 @@ static money64 TryPlaceGhostLargeScenery( static money64 TryPlaceGhostBanner(CoordsXYZD loc, ObjectEntryIndex entryIndex) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e2612 auto primaryColour = gWindowSceneryPrimaryColour; @@ -2627,7 +2627,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) const auto selection = WindowSceneryGetTabSelection(); if (selection.IsUndefined()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2645,7 +2645,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2689,7 +2689,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); _unkF64F0E = quadrant; _unkF64F0A = gSceneryPlaceZ; @@ -2723,7 +2723,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2742,7 +2742,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); cost = TryPlaceGhostPathAddition({ mapTile, z }, selection.EntryIndex); @@ -2758,7 +2758,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2778,7 +2778,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); gSceneryGhostWallRotation = edge; _unkF64F0A = gSceneryPlaceZ; @@ -2813,7 +2813,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2843,7 +2843,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); gSceneryPlaceObject.SceneryType = SCENERY_TYPE_LARGE; gSceneryPlaceObject.EntryIndex = selection.EntryIndex; @@ -2880,7 +2880,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2900,7 +2900,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); cost = TryPlaceGhostBanner({ mapTile, z, direction }, selection.EntryIndex); diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 6f331f26c1..1c1a1679dd 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -456,7 +456,7 @@ namespace Editor windowManager->SetMainView(gSavedView, gSavedViewZoom, gSavedViewRotation); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES)); @@ -530,7 +530,7 @@ namespace Editor */ ResultWithMessage CheckPark() { - int32_t parkSize = park_calculate_size(); + int32_t parkSize = ParkCalculateSize(); if (parkSize == 0) { return { false, STR_PARK_MUST_OWN_SOME_LAND }; diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 2dfca1167b..4bc5e7ab93 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -491,7 +491,7 @@ void finish_object_selection() else { set_all_scenery_items_invented(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); gEditorStep = EditorStep::LandscapeEditor; gfx_invalidate_screen(); } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index e26cb3d2f2..439aa6e58b 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -482,7 +482,7 @@ void game_load_init() } ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); context_broadcast_intent(&intent); diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index e81f584086..c07bf704c3 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -79,7 +79,7 @@ void GameState::InitAll(const TileCoordsXY& mapSize) gNextGuestNumber = 1; context_init(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); auto intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); context_broadcast_intent(&intent); diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index f563dc858a..3e2628dea9 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -93,7 +93,7 @@ GameActions::Result BannerPlaceAction::Query() const GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } - auto* bannerEntry = get_banner_entry(_bannerType); + auto* bannerEntry = GetBannerEntry(_bannerType); if (bannerEntry == nullptr) { log_error("Invalid banner object type. bannerType = ", _bannerType); @@ -120,7 +120,7 @@ GameActions::Result BannerPlaceAction::Execute() const GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } - auto* bannerEntry = get_banner_entry(_bannerType); + auto* bannerEntry = GetBannerEntry(_bannerType); if (bannerEntry == nullptr) { log_error("Invalid banner object type. bannerType = ", _bannerType); diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index cf6235e9b1..42de2dc0cd 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -75,7 +75,7 @@ GameActions::Result BannerRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry != nullptr) { res.Cost = -((bannerEntry->price * 3) / 4); @@ -114,7 +114,7 @@ GameActions::Result BannerRemoveAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry != nullptr) { res.Cost = -((bannerEntry->price * 3) / 4); diff --git a/src/openrct2/actions/ChangeMapSizeAction.cpp b/src/openrct2/actions/ChangeMapSizeAction.cpp index 4f6b816a41..720ec3d696 100644 --- a/src/openrct2/actions/ChangeMapSizeAction.cpp +++ b/src/openrct2/actions/ChangeMapSizeAction.cpp @@ -69,7 +69,7 @@ GameActions::Result ChangeMapSizeAction::Execute() const auto* ctx = OpenRCT2::GetContext(); auto uiContext = ctx->GetUiContext(); auto* windowManager = uiContext->GetWindowManager(); - park_calculate_size(); + ParkCalculateSize(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_MAP)); gfx_invalidate_screen(); diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index adc2168832..bd04546a79 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -93,7 +93,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const if (_pathItemType != 0) { - auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); + auto* pathBitEntry = GetFootpathItemEntry(_pathItemType - 1); if (pathBitEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -163,7 +163,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const if (_pathItemType != 0) { - auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); + auto* pathBitEntry = GetFootpathItemEntry(_pathItemType - 1); if (pathBitEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -191,7 +191,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const pathElement->SetIsBroken(false); if (_pathItemType != 0) { - auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); + auto* pathBitEntry = GetFootpathItemEntry(_pathItemType - 1); if (pathBitEntry != nullptr && pathBitEntry->flags & PATH_BIT_FLAG_IS_BIN) { pathElement->SetAdditionStatus(255); diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 6323e028cf..fe1d649356 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -133,7 +133,7 @@ namespace GameActions case GameCommand::PlaceLargeScenery: case GameCommand::PlaceBanner: case GameCommand::PlaceScenery: - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); break; default: break; diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index aa3015cc3f..e6fcc32223 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -133,7 +133,7 @@ GameActions::Result LandBuyRightsAction::map_buy_land_rights_for_tile(const Coor if (isExecuting) { surfaceElement->SetOwnership(OWNERSHIP_OWNED); - update_park_fences_around_tile(loc); + ParkUpdateFencesAroundTile(loc); } res.Cost = gLandPrice; return res; diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index e63f11082a..8cc8b2dbfc 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -120,7 +120,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor { surfaceElement->SetOwnership( surfaceElement->GetOwnership() & ~(OWNERSHIP_OWNED | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)); - update_park_fences_around_tile(loc); + ParkUpdateFencesAroundTile(loc); } return res; case LandSetRightSetting::UnownConstructionRights: @@ -189,7 +189,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor gPeepSpawns.end()); } surfaceElement->SetOwnership(_ownership); - update_park_fences_around_tile(loc); + ParkUpdateFencesAroundTile(loc); gMapLandRightsUpdateSuccess = true; } return res; diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index 053d37648c..2aa90ffeef 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -93,5 +93,5 @@ void ParkEntranceRemoveAction::ParkEntranceRemoveSegment(const CoordsXYZ& loc) c map_invalidate_tile({ loc, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ() }); entranceElement->Remove(); - update_park_fences({ loc.x, loc.y }); + ParkUpdateFences({ loc.x, loc.y }); } diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 72ecb4406e..dece2c0878 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -160,11 +160,11 @@ GameActions::Result PlaceParkEntranceAction::Execute() const FootpathConnectEdges(entranceLoc, entranceElement->as(), GAME_COMMAND_FLAG_APPLY); } - update_park_fences(entranceLoc); - update_park_fences({ entranceLoc.x - COORDS_XY_STEP, entranceLoc.y }); - update_park_fences({ entranceLoc.x + COORDS_XY_STEP, entranceLoc.y }); - update_park_fences({ entranceLoc.x, entranceLoc.y - COORDS_XY_STEP }); - update_park_fences({ entranceLoc.x, entranceLoc.y + COORDS_XY_STEP }); + ParkUpdateFences(entranceLoc); + ParkUpdateFences({ entranceLoc.x - COORDS_XY_STEP, entranceLoc.y }); + ParkUpdateFences({ entranceLoc.x + COORDS_XY_STEP, entranceLoc.y }); + ParkUpdateFences({ entranceLoc.x, entranceLoc.y - COORDS_XY_STEP }); + ParkUpdateFences({ entranceLoc.x, entranceLoc.y + COORDS_XY_STEP }); map_invalidate_tile({ entranceLoc, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ() }); diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 780c9cd7a2..d5b434bf7f 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -216,7 +216,7 @@ GameActions::Result RideCreateAction::Execute() const if (rideEntry->shop_item[0] == ShopItem::None) { - if (!park_ride_prices_unlocked()) + if (!ParkRidePricesUnlocked()) { ride->price[0] = 0; } diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 9de82d6987..ce2c1cee2f 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -207,13 +207,13 @@ GameActions::Result SetCheatAction::Execute() const gCheatsNeverendingMarketing = _param1 != 0; break; case CheatType::OpenClosePark: - ParkSetOpen(!park_is_open()); + ParkSetOpen(!ParkIsOpen()); break; case CheatType::HaveFun: gScenarioObjective.Type = OBJECTIVE_HAVE_FUN; break; case CheatType::SetForcedParkRating: - set_forced_park_rating(_param1); + ParkSetForcedRating(_param1); break; case CheatType::AllowArbitraryRideTypeChanges: gCheatsAllowArbitraryRideTypeChanges = _param1 != 0; @@ -705,7 +705,7 @@ void SetCheatAction::OwnAllLand() const if (destOwnership != OWNERSHIP_UNOWNED) { surfaceElement->SetOwnership(destOwnership); - update_park_fences_around_tile(coords); + ParkUpdateFencesAroundTile(coords); map_invalidate_tile({ coords, baseZ, baseZ + 16 }); } } @@ -718,7 +718,7 @@ void SetCheatAction::OwnAllLand() const if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); - update_park_fences_around_tile(spawn); + ParkUpdateFencesAroundTile(spawn); uint16_t baseZ = surfaceElement->GetBaseZ(); map_invalidate_tile({ spawn, baseZ, baseZ + 16 }); } diff --git a/src/openrct2/actions/SetParkEntranceFeeAction.cpp b/src/openrct2/actions/SetParkEntranceFeeAction.cpp index 521a762f5c..81de841a04 100644 --- a/src/openrct2/actions/SetParkEntranceFeeAction.cpp +++ b/src/openrct2/actions/SetParkEntranceFeeAction.cpp @@ -40,7 +40,7 @@ void SetParkEntranceFeeAction::Serialise(DataSerialiser& stream) GameActions::Result SetParkEntranceFeeAction::Query() const { bool noMoney = (gParkFlags & PARK_FLAGS_NO_MONEY) != 0; - bool forceFreeEntry = !park_entry_price_unlocked(); + bool forceFreeEntry = !ParkEntranceFeeUnlocked(); if (noMoney || forceFreeEntry) { return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_NONE); diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 43b2d618b3..1497d24167 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -215,7 +215,7 @@ GameActions::Result WallPlaceAction::Query() const } } - auto* wallEntry = get_wall_entry(_wallType); + auto* wallEntry = GetWallEntry(_wallType); if (wallEntry == nullptr) { @@ -305,7 +305,7 @@ GameActions::Result WallPlaceAction::Execute() const } auto targetLoc = CoordsXYZ(_loc, targetHeight); - auto* wallEntry = get_wall_entry(_wallType); + auto* wallEntry = GetWallEntry(_wallType); if (wallEntry == nullptr) { diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 27e367d88d..849e6af060 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -1932,7 +1932,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin return true; } - money16 entranceFee = park_get_entrance_fee(); + money16 entranceFee = ParkGetEntranceFee(); if (entranceFee != 0) { if (guest->HasItem(ShopItem::Voucher)) diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 8ef98dc517..d072b252ec 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -1027,7 +1027,7 @@ uint32_t staff_get_available_entertainer_costumes() { if (scenery_group_is_invented(i)) { - const auto sgEntry = get_scenery_group_entry(i); + const auto sgEntry = GetSceneryGroupEntry(i); entertainerCostumes |= sgEntry->entertainer_costumes; } } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 20459a1c43..dfb4e9c038 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -586,7 +586,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) { console.WriteFormatLine("guest_initial_happiness %d%% (%d)", 15, gGuestInitialHappiness); } - else if (current_happiness == calculate_guest_initial_happiness(i)) + else if (current_happiness == CalculateGuestInitialHappiness(i)) { console.WriteFormatLine("guest_initial_happiness %d%% (%d)", i, gGuestInitialHappiness); break; @@ -833,7 +833,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) else if (argv[0] == "guest_initial_happiness" && invalidArguments(&invalidArgs, int_valid[0])) { auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialHappiness, calculate_guest_initial_happiness(static_cast(int_val[0]))); + ScenarioSetSetting::GuestInitialHappiness, CalculateGuestInitialHappiness(static_cast(int_val[0]))); scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) { if (res->Error != GameActions::Status::Ok) console.WriteLineError("set guest_initial_happiness command failed, likely due to permissions."); @@ -1260,7 +1260,7 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar research_reset_current_item(); gSilentResearch = false; } - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); context_broadcast_intent(&intent); diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 046d4297dc..9be48e8693 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -178,13 +178,13 @@ static bool award_is_deserved_best_value(int32_t activeAwardTypes) if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) return false; - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !park_entry_price_unlocked()) + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !ParkEntranceFeeUnlocked()) return false; if (gTotalRideValueForMoney < 10.00_GBP) return false; - if (park_get_entrance_fee() + 0.10_GBP >= gTotalRideValueForMoney / 2) + if (ParkGetEntranceFee() + 0.10_GBP >= gTotalRideValueForMoney / 2) return false; return true; @@ -231,7 +231,7 @@ static bool award_is_deserved_worst_value(int32_t activeAwardTypes) if (gParkFlags & PARK_FLAGS_NO_MONEY) return false; - const auto parkEntranceFee = park_get_entrance_fee(); + const auto parkEntranceFee = ParkGetEntranceFee(); if (parkEntranceFee == 0.00_GBP) return false; if (parkEntranceFee <= gTotalRideValueForMoney) diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index 32a098bb41..0dada450bc 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -50,11 +50,11 @@ uint16_t marketing_get_campaign_guest_generation_probability(int32_t campaignTyp switch (campaign->Type) { case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE: - if (park_get_entrance_fee() < 4.00_GBP) + if (ParkGetEntranceFee() < 4.00_GBP) probability /= 8; break; case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE: - if (park_get_entrance_fee() < 6.00_GBP) + if (ParkGetEntranceFee() < 6.00_GBP) probability /= 8; break; case ADVERTISING_CAMPAIGN_RIDE_FREE: @@ -174,12 +174,12 @@ bool marketing_is_campaign_type_applicable(int32_t campaignType) { case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE: case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE: - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) return false; return true; case ADVERTISING_CAMPAIGN_RIDE_FREE: - if (!park_ride_prices_unlocked()) + if (!ParkRidePricesUnlocked()) return false; // fall-through diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index a1686f2a76..c743238dd2 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -284,7 +284,7 @@ void research_finish_item(ResearchItem* researchItem) else { // Scenery - rct_scenery_group_entry* sceneryGroupEntry = get_scenery_group_entry(researchItem->entryIndex); + rct_scenery_group_entry* sceneryGroupEntry = GetSceneryGroupEntry(researchItem->entryIndex); if (sceneryGroupEntry != nullptr) { scenery_group_set_invented(researchItem->entryIndex); @@ -302,7 +302,7 @@ void research_finish_item(ResearchItem* researchItem) } research_invalidate_related_windows(); - init_scenery(); + SceneryInit(); } } } @@ -494,7 +494,7 @@ void research_populate_list_random() // Scenery for (uint32_t i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - rct_scenery_group_entry* sceneryGroupEntry = get_scenery_group_entry(i); + rct_scenery_group_entry* sceneryGroupEntry = GetSceneryGroupEntry(i); if (sceneryGroupEntry == nullptr) { continue; @@ -610,7 +610,7 @@ void scenery_set_not_invented(const ScenerySelection& sceneryItem) bool scenery_group_is_invented(int32_t sgIndex) { - const auto sgEntry = get_scenery_group_entry(sgIndex); + const auto sgEntry = GetSceneryGroupEntry(sgIndex); if (sgEntry == nullptr || sgEntry->SceneryEntries.empty()) { return false; @@ -635,7 +635,7 @@ bool scenery_group_is_invented(int32_t sgIndex) void scenery_group_set_invented(int32_t sgIndex) { - const auto sgEntry = get_scenery_group_entry(sgIndex); + const auto sgEntry = GetSceneryGroupEntry(sgIndex); if (sgEntry != nullptr) { for (const auto& entry : sgEntry->SceneryEntries) @@ -649,7 +649,7 @@ void set_all_scenery_groups_not_invented() { for (int32_t i = 0; i < MAX_SCENERY_GROUP_OBJECTS; ++i) { - rct_scenery_group_entry* scenery_set = get_scenery_group_entry(i); + rct_scenery_group_entry* scenery_set = GetSceneryGroupEntry(i); if (scenery_set == nullptr) { continue; @@ -715,7 +715,7 @@ StringId ResearchItem::GetName() const return rideEntry->naming.Name; } - rct_scenery_group_entry* sceneryEntry = get_scenery_group_entry(entryIndex); + rct_scenery_group_entry* sceneryEntry = GetSceneryGroupEntry(entryIndex); if (sceneryEntry == nullptr) { return STR_EMPTY; @@ -751,7 +751,7 @@ static void ResearchRemoveNullItems(std::vector& items) } else { - return get_scenery_group_entry(researchItem.entryIndex) == nullptr; + return GetSceneryGroupEntry(researchItem.entryIndex) == nullptr; } }); items.erase(it, std::end(items)); @@ -776,7 +776,7 @@ static void research_mark_item_as_researched(const ResearchItem& item) } else if (item.type == Research::EntryType::Scenery) { - const auto sgEntry = get_scenery_group_entry(item.entryIndex); + const auto sgEntry = GetSceneryGroupEntry(item.entryIndex); if (sgEntry != nullptr) { for (const auto& sceneryEntry : sgEntry->SceneryEntries) @@ -822,7 +822,7 @@ static void ResearchAddAllMissingItems(bool isResearched) for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - const auto* groupEntry = get_scenery_group_entry(i); + const auto* groupEntry = GetSceneryGroupEntry(i); if (groupEntry != nullptr) { research_insert_scenery_group_entry(i, isResearched); diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 657a0df6a9..9b8a069e9f 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -81,7 +81,7 @@ void PaintBanner(paint_session& session, uint8_t direction, int32_t height, cons return; } - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry == nullptr) { return; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 2e3aae1c9d..054f678b75 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5397,7 +5397,7 @@ money16 ride_get_price(const Ride* ride) return 0; if (ride->IsRide()) { - if (!park_ride_prices_unlocked()) + if (!ParkRidePricesUnlocked()) { return 0; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 39bfa32ee2..ab0ad59af6 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -6812,7 +6812,7 @@ void Vehicle::UpdateAdditionalAnimation() static void play_scenery_door_open_sound(const CoordsXYZ& loc, WallElement* tileElement) { auto* wallEntry = tileElement->GetEntry(); - int32_t doorSoundType = wall_entry_get_door_sound(wallEntry); + int32_t doorSoundType = WallEntryGetDoorSound(wallEntry); if (doorSoundType != 0) { auto soundId = DoorOpenSoundIds[doorSoundType - 1]; @@ -6830,7 +6830,7 @@ static void play_scenery_door_open_sound(const CoordsXYZ& loc, WallElement* tile static void play_scenery_door_close_sound(const CoordsXYZ& loc, WallElement* tileElement) { auto* wallEntry = tileElement->GetEntry(); - int32_t doorSoundType = wall_entry_get_door_sound(wallEntry); + int32_t doorSoundType = WallEntryGetDoorSound(wallEntry); if (doorSoundType != 0) { auto soundId = DoorCloseSoundIds[doorSoundType - 1]; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 1e620626cc..45741b1c8b 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -106,7 +106,7 @@ void scenario_reset() gScenarioRand.seed(s); research_reset_current_item(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); News::InitQueue(); auto& park = GetContext()->GetGameState()->GetPark(); @@ -160,7 +160,7 @@ void scenario_reset() reset_all_ride_build_dates(); date_reset(); Duck::RemoveAll(); - park_calculate_size(); + ParkCalculateSize(); map_count_remaining_land_rights(); Staff::ResetStats(); @@ -245,7 +245,7 @@ static void scenario_entrance_fee_too_high_check() { const auto max_fee = add_clamp_money16(gTotalRideValueForMoney, gTotalRideValueForMoney / 2); - if ((gParkFlags & PARK_FLAGS_PARK_OPEN) && park_get_entrance_fee() > max_fee) + if ((gParkFlags & PARK_FLAGS_PARK_OPEN) && ParkGetEntranceFee() > max_fee) { if (!gParkEntrances.empty()) { diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 72be90ffbb..6e9074e074 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -415,13 +415,13 @@ bool scenery_tool_is_active() return false; } -void init_scenery() +void SceneryInit() { auto intent = Intent(INTENT_ACTION_INIT_SCENERY); context_broadcast_intent(&intent); } -void scenery_set_default_placement_configuration() +void ScenerySetDefaultPlacementConfiguration() { auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); context_broadcast_intent(&intent); diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index c569a30580..e4fea0e9eb 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -318,7 +318,7 @@ BannerSceneryEntry* BannerElement::GetEntry() const auto banner = GetBanner(); if (banner != nullptr) { - return get_banner_entry(banner->type); + return GetBannerEntry(banner->type); } return nullptr; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 430c6b6346..bc4ab55238 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1624,7 +1624,7 @@ PathBitEntry* PathElement::GetAdditionEntry() const { if (!HasAddition()) return nullptr; - return get_footpath_item_entry(GetAdditionEntryIndex()); + return GetFootpathItemEntry(GetAdditionEntryIndex()); } void PathElement::SetAddition(uint8_t newAddition) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 2d9b16c54b..95a94f3879 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1334,7 +1334,7 @@ void map_update_tiles() if (surfaceElement != nullptr) { surfaceElement->UpdateGrassLength(mapPos); - scenery_update_tile(mapPos); + SceneryUpdateTile(mapPos); } } } @@ -1419,7 +1419,7 @@ void map_remove_out_of_range_elements() if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); - update_park_fences_around_tile({ x, y }); + ParkUpdateFencesAroundTile({ x, y }); } clear_elements_at({ x, y }); } @@ -1483,7 +1483,7 @@ void map_extend_boundary_surface_y() map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); } - update_park_fences({ x << 5, y << 5 }); + ParkUpdateFences({ x << 5, y << 5 }); } } @@ -1501,7 +1501,7 @@ void map_extend_boundary_surface_x() { map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); } - update_park_fences({ x << 5, y << 5 }); + ParkUpdateFences({ x << 5, y << 5 }); } } @@ -2292,7 +2292,7 @@ void FixLandOwnershipTilesWithOwnership(std::initializer_list tile continue; surfaceElement->SetOwnership(ownership); - update_park_fences_around_tile({ (*tile).x * 32, (*tile).y * 32 }); + ParkUpdateFencesAroundTile({ (*tile).x * 32, (*tile).y * 32 }); } } } diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 56e052bfee..9950f4dc5f 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -213,7 +213,7 @@ void MapGenGenerate(mapgen_settings* settings) delete[] _height; // Set the tile slopes so that there are no cliffs - while (map_smooth(1, 1, mapSize.x - 1, mapSize.y - 1)) + while (MapSmooth(1, 1, mapSize.x - 1, mapSize.y - 1)) { } @@ -880,7 +880,7 @@ void MapGenGenerateFromHeightmap(mapgen_settings* settings) for (uint32_t x = 0; x < _heightMapData.width; x++) { auto tileCoords = MapgenHeightmapCoordToTileCoordsXY(x, y); - numTilesChanged += tile_smooth(tileCoords); + numTilesChanged += TileSmooth(tileCoords); } } diff --git a/src/openrct2/world/MapHelpers.cpp b/src/openrct2/world/MapHelpers.cpp index 112a87ae7e..e7d8590cdf 100644 --- a/src/openrct2/world/MapHelpers.cpp +++ b/src/openrct2/world/MapHelpers.cpp @@ -14,7 +14,7 @@ #include -static uint8_t getBaseHeightOrZero(int32_t x, int32_t y) +static uint8_t GetBaseHeightOrZero(int32_t x, int32_t y) { auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); return surfaceElement != nullptr ? surfaceElement->base_height : 0; @@ -23,7 +23,7 @@ static uint8_t getBaseHeightOrZero(int32_t x, int32_t y) /** * Not perfect, this still leaves some particular tiles unsmoothed. */ -int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) +int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) { int32_t i, x, y, count, doubleCorner, raisedLand = 0; uint8_t highest, cornerHeights[4]; @@ -38,10 +38,10 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) // Raise to edge height - 2 highest = surfaceElement->base_height; - highest = std::max(highest, getBaseHeightOrZero(x - 1, y + 0)); - highest = std::max(highest, getBaseHeightOrZero(x + 1, y + 0)); - highest = std::max(highest, getBaseHeightOrZero(x + 0, y - 1)); - highest = std::max(highest, getBaseHeightOrZero(x + 0, y + 1)); + highest = std::max(highest, GetBaseHeightOrZero(x - 1, y + 0)); + highest = std::max(highest, GetBaseHeightOrZero(x + 1, y + 0)); + highest = std::max(highest, GetBaseHeightOrZero(x + 0, y - 1)); + highest = std::max(highest, GetBaseHeightOrZero(x + 0, y + 1)); if (surfaceElement->base_height < highest - 2) { raisedLand = 1; @@ -50,10 +50,10 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) // Check corners doubleCorner = -1; - cornerHeights[0] = getBaseHeightOrZero(x - 1, y - 1); - cornerHeights[1] = getBaseHeightOrZero(x + 1, y - 1); - cornerHeights[2] = getBaseHeightOrZero(x + 1, y + 1); - cornerHeights[3] = getBaseHeightOrZero(x - 1, y + 1); + cornerHeights[0] = GetBaseHeightOrZero(x - 1, y - 1); + cornerHeights[1] = GetBaseHeightOrZero(x + 1, y - 1); + cornerHeights[2] = GetBaseHeightOrZero(x + 1, y + 1); + cornerHeights[3] = GetBaseHeightOrZero(x - 1, y + 1); highest = surfaceElement->base_height; for (i = 0; i < 4; i++) highest = std::max(highest, cornerHeights[i]); @@ -75,16 +75,16 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) { default: case 0: - highestOnLowestSide = std::max(getBaseHeightOrZero(x + 1, y), getBaseHeightOrZero(x, y + 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x + 1, y), GetBaseHeightOrZero(x, y + 1)); break; case 1: - highestOnLowestSide = std::max(getBaseHeightOrZero(x - 1, y), getBaseHeightOrZero(x, y + 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x - 1, y), GetBaseHeightOrZero(x, y + 1)); break; case 2: - highestOnLowestSide = std::max(getBaseHeightOrZero(x - 1, y), getBaseHeightOrZero(x, y - 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x - 1, y), GetBaseHeightOrZero(x, y - 1)); break; case 3: - highestOnLowestSide = std::max(getBaseHeightOrZero(x + 1, y), getBaseHeightOrZero(x, y - 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x + 1, y), GetBaseHeightOrZero(x, y - 1)); break; } @@ -198,7 +198,7 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) * This does not change the base height, unless all corners have been raised. * @returns 0 if no edits were made, 1 otherwise */ -int32_t tile_smooth(const TileCoordsXY& tileCoords) +int32_t TileSmooth(const TileCoordsXY& tileCoords) { auto* const surfaceElement = map_get_surface_element_at(tileCoords.ToCoordsXY()); if (surfaceElement == nullptr) diff --git a/src/openrct2/world/MapHelpers.h b/src/openrct2/world/MapHelpers.h index c770fdc4f3..dc0fd53a14 100644 --- a/src/openrct2/world/MapHelpers.h +++ b/src/openrct2/world/MapHelpers.h @@ -20,5 +20,5 @@ enum SLOPE_E_THRESHOLD_FLAGS = (1 << 3) }; -int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b); -int32_t tile_smooth(const TileCoordsXY& tileCoords); +int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b); +int32_t TileSmooth(const TileCoordsXY& tileCoords); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 79f2745a38..04992531d6 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -82,7 +82,7 @@ int32_t _guestGenerationProbability; /** * Choose a random peep spawn and iterates through until defined spawn is found. */ -static PeepSpawn* get_random_peep_spawn() +static PeepSpawn* GetRandomPeepSpawn() { if (!gPeepSpawns.empty()) { @@ -92,7 +92,7 @@ static PeepSpawn* get_random_peep_spawn() return nullptr; } -void park_set_open(bool open) +void ParkSetOpen(bool open) { auto parkSetParameter = ParkSetParameterAction(open ? ParkParameter::Open : ParkParameter::Close); GameActions::Execute(&parkSetParameter); @@ -102,7 +102,7 @@ void park_set_open(bool open) * * rct2: 0x00664D05 */ -void update_park_fences(const CoordsXY& coords) +void ParkUpdateFences(const CoordsXY& coords) { if (map_is_edge(coords)) return; @@ -168,16 +168,16 @@ void update_park_fences(const CoordsXY& coords) } } -void update_park_fences_around_tile(const CoordsXY& coords) +void ParkUpdateFencesAroundTile(const CoordsXY& coords) { - update_park_fences(coords); - update_park_fences({ coords.x + COORDS_XY_STEP, coords.y }); - update_park_fences({ coords.x - COORDS_XY_STEP, coords.y }); - update_park_fences({ coords.x, coords.y + COORDS_XY_STEP }); - update_park_fences({ coords.x, coords.y - COORDS_XY_STEP }); + ParkUpdateFences(coords); + ParkUpdateFences({ coords.x + COORDS_XY_STEP, coords.y }); + ParkUpdateFences({ coords.x - COORDS_XY_STEP, coords.y }); + ParkUpdateFences({ coords.x, coords.y + COORDS_XY_STEP }); + ParkUpdateFences({ coords.x, coords.y - COORDS_XY_STEP }); } -void set_forced_park_rating(int32_t rating) +void ParkSetForcedRating(int32_t rating) { _forcedParkRating = rating; auto& park = GetContext()->GetGameState()->GetPark(); @@ -186,25 +186,25 @@ void set_forced_park_rating(int32_t rating) context_broadcast_intent(&intent); } -int32_t get_forced_park_rating() +int32_t ParkGetForcedRating() { return _forcedParkRating; } -money16 park_get_entrance_fee() +money16 ParkGetEntranceFee() { if (gParkFlags & PARK_FLAGS_NO_MONEY) { return 0; } - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) { return 0; } return gParkEntranceFee; } -bool park_ride_prices_unlocked() +bool ParkRidePricesUnlocked() { if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) { @@ -217,7 +217,7 @@ bool park_ride_prices_unlocked() return false; } -bool park_entry_price_unlocked() +bool ParkEntranceFeeUnlocked() { if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) { @@ -519,7 +519,7 @@ money64 Park::CalculateCompanyValue() const money16 Park::CalculateTotalRideValueForMoney() const { money16 totalRideValue = 0; - bool ridePricesUnlocked = park_ride_prices_unlocked() && !(gParkFlags & PARK_FLAGS_NO_MONEY); + bool ridePricesUnlocked = ParkRidePricesUnlocked() && !(gParkFlags & PARK_FLAGS_NO_MONEY); for (auto& ride : GetRideManager()) { if (ride.status != RideStatus::Open) @@ -616,7 +616,7 @@ uint32_t Park::CalculateGuestGenerationProbability() const } // Penalty for overpriced entrance fee relative to total ride value - money16 entranceFee = park_get_entrance_fee(); + money16 entranceFee = ParkGetEntranceFee(); if (entranceFee > gTotalRideValueForMoney) { probability /= 4; @@ -704,7 +704,7 @@ Guest* Park::GenerateGuestFromCampaign(int32_t campaign) Guest* Park::GenerateGuest() { Guest* peep = nullptr; - const auto spawn = get_random_peep_spawn(); + const auto spawn = GetRandomPeepSpawn(); if (spawn != nullptr) { auto direction = DirectionReverse(spawn->direction); @@ -778,12 +778,12 @@ void Park::UpdateHistories() window_invalidate_by_class(WindowClass::Finances); } -int32_t park_is_open() +int32_t ParkIsOpen() { return GetContext()->GetGameState()->GetPark().IsOpen(); } -uint32_t park_calculate_size() +uint32_t ParkCalculateSize() { auto tiles = GetContext()->GetGameState()->GetPark().CalculateParkSize(); if (tiles != gParkSize) @@ -794,7 +794,7 @@ uint32_t park_calculate_size() return tiles; } -uint8_t calculate_guest_initial_happiness(uint8_t percentage) +uint8_t CalculateGuestInitialHappiness(uint8_t percentage) { return Park::CalculateGuestInitialHappiness(percentage); } diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 30c0fc85d4..b1cf23dd24 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -109,20 +109,20 @@ extern uint32_t gGuestsInParkHistory[32]; extern int32_t _guestGenerationProbability; extern uint32_t _suggestedGuestMaximum; -void set_forced_park_rating(int32_t rating); -int32_t get_forced_park_rating(); +void ParkSetForcedRating(int32_t rating); +int32_t ParkGetForcedRating(); -int32_t park_is_open(); -uint32_t park_calculate_size(); +int32_t ParkIsOpen(); +uint32_t ParkCalculateSize(); -void update_park_fences(const CoordsXY& coords); -void update_park_fences_around_tile(const CoordsXY& coords); +void ParkUpdateFences(const CoordsXY& coords); +void ParkUpdateFencesAroundTile(const CoordsXY& coords); -uint8_t calculate_guest_initial_happiness(uint8_t percentage); +uint8_t CalculateGuestInitialHappiness(uint8_t percentage); -void park_set_open(bool open); +void ParkSetOpen(bool open); int32_t ParkEntranceGetIndex(const CoordsXYZ& entrancePos); -money16 park_get_entrance_fee(); +money16 ParkGetEntranceFee(); -bool park_ride_prices_unlocked(); -bool park_entry_price_unlocked(); +bool ParkRidePricesUnlocked(); +bool ParkEntranceFeeUnlocked(); diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 899bdcf6ea..7a862ceb9d 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -120,7 +120,7 @@ int32_t LargeSceneryText::MeasureHeight(std::string_view text) const return result; } -void scenery_update_tile(const CoordsXY& sceneryPos) +void SceneryUpdateTile(const CoordsXY& sceneryPos) { TileElement* tileElement; @@ -227,7 +227,7 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos) * * rct2: 0x006E2712 */ -void scenery_remove_ghost_tool_placement() +void SceneryRemoveGhostToolPlacement() { if (gSceneryGhostType & SCENERY_GHOST_FLAG_0) { @@ -295,7 +295,7 @@ void scenery_remove_ghost_tool_placement() } } -WallSceneryEntry* get_wall_entry(ObjectEntryIndex entryIndex) +WallSceneryEntry* GetWallEntry(ObjectEntryIndex entryIndex) { WallSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -307,7 +307,7 @@ WallSceneryEntry* get_wall_entry(ObjectEntryIndex entryIndex) return result; } -BannerSceneryEntry* get_banner_entry(ObjectEntryIndex entryIndex) +BannerSceneryEntry* GetBannerEntry(ObjectEntryIndex entryIndex) { BannerSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -319,7 +319,7 @@ BannerSceneryEntry* get_banner_entry(ObjectEntryIndex entryIndex) return result; } -PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex) +PathBitEntry* GetFootpathItemEntry(ObjectEntryIndex entryIndex) { PathBitEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -331,7 +331,7 @@ PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex) return result; } -rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex) +rct_scenery_group_entry* GetSceneryGroupEntry(ObjectEntryIndex entryIndex) { rct_scenery_group_entry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -343,7 +343,7 @@ rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex) return result; } -int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry) +int32_t WallEntryGetDoorSound(const WallSceneryEntry* wallEntry) { return (wallEntry->flags2 & WALL_SCENERY_2_DOOR_SOUND_MASK) >> WALL_SCENERY_2_DOOR_SOUND_SHIFT; } @@ -401,13 +401,13 @@ static SceneryEntryBase* GetSceneryEntry(const ScenerySelection& item) case SCENERY_TYPE_SMALL: return get_small_scenery_entry(item.EntryIndex); case SCENERY_TYPE_PATH_ITEM: - return get_footpath_item_entry(item.EntryIndex); + return GetFootpathItemEntry(item.EntryIndex); case SCENERY_TYPE_WALL: - return get_wall_entry(item.EntryIndex); + return GetWallEntry(item.EntryIndex); case SCENERY_TYPE_LARGE: return GetLargeSceneryEntry(item.EntryIndex); case SCENERY_TYPE_BANNER: - return get_banner_entry(item.EntryIndex); + return GetBannerEntry(item.EntryIndex); default: return nullptr; } @@ -434,7 +434,7 @@ static std::vector GetAllMiscScenery() std::vector nonMiscScenery; for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - const auto* sgEntry = get_scenery_group_entry(i); + const auto* sgEntry = GetSceneryGroupEntry(i); if (sgEntry != nullptr) { nonMiscScenery.insert(nonMiscScenery.end(), sgEntry->SceneryEntries.begin(), sgEntry->SceneryEntries.end()); diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index 6ff0fc59ce..93e4072e21 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -273,17 +273,17 @@ extern const CoordsXY SceneryQuadrantOffsets[]; extern money64 gClearSceneryCost; -void init_scenery(); -void scenery_update_tile(const CoordsXY& sceneryPos); -void scenery_set_default_placement_configuration(); -void scenery_remove_ghost_tool_placement(); +void SceneryInit(); +void SceneryUpdateTile(const CoordsXY& sceneryPos); +void ScenerySetDefaultPlacementConfiguration(); +void SceneryRemoveGhostToolPlacement(); -WallSceneryEntry* get_wall_entry(ObjectEntryIndex entryIndex); -BannerSceneryEntry* get_banner_entry(ObjectEntryIndex entryIndex); -PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex); -rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex); +WallSceneryEntry* GetWallEntry(ObjectEntryIndex entryIndex); +BannerSceneryEntry* GetBannerEntry(ObjectEntryIndex entryIndex); +PathBitEntry* GetFootpathItemEntry(ObjectEntryIndex entryIndex); +rct_scenery_group_entry* GetSceneryGroupEntry(ObjectEntryIndex entryIndex); -int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry); +int32_t WallEntryGetDoorSound(const WallSceneryEntry* wallEntry); bool IsSceneryAvailableToBuild(const ScenerySelection& item); diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index fea5d92f86..2c8a969105 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -524,7 +524,7 @@ namespace OpenRCT2::TileInspector if (!showFences) surfaceelement->SetParkFences(0); else - update_park_fences(loc); + ParkUpdateFences(loc); map_invalidate_tile_full(loc); diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index b3629977d1..927ef0c9ec 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -140,7 +140,7 @@ uint16_t WallElement::GetEntryIndex() const WallSceneryEntry* WallElement::GetEntry() const { - return get_wall_entry(entryIndex); + return GetWallEntry(entryIndex); } void WallElement::SetEntryIndex(uint16_t newIndex) diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 0d0fd48626..01db3b5295 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -55,7 +55,7 @@ static std::unique_ptr localStartGame(const std::string& parkPath) ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); load_palette(); EntityTweener::Get().Reset(); MapAnimationAutoCreate(); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 759991e9a2..e5c07c89cc 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -64,7 +64,7 @@ static void GameInit(bool retainSpatialIndices) ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); load_palette(); EntityTweener::Get().Reset(); MapAnimationAutoCreate();