From 41eb24dbd7d85fdce631210e60c9211a76415069 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 11 Jan 2026 17:10:23 +0100 Subject: [PATCH 1/4] Rename members of RailingEntrySupportType --- src/openrct2/object/FootpathObject.cpp | 2 +- src/openrct2/object/FootpathRailingsObject.cpp | 6 +++--- src/openrct2/paint/tile_element/Paint.Path.cpp | 2 +- src/openrct2/world/Footpath.h | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 97546c9368..5b3b45a6bc 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -29,7 +29,7 @@ namespace OpenRCT2 GetImageTable().Read(context, stream); // Validate properties - if (_legacyType.support_type >= RailingEntrySupportType::Count) + if (_legacyType.support_type >= RailingEntrySupportType::count) { context->LogError(ObjectError::invalidProperty, "RailingEntrySupportType not supported."); } diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index a22fef4a32..bdc8857294 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -58,7 +58,7 @@ namespace OpenRCT2 if (Colour != COLOUR_NULL) helper = helper.WithPrimary(Colour); - if (SupportType == RailingEntrySupportType::Pole) + if (SupportType == RailingEntrySupportType::pole) { auto img = helper.WithIndex(BridgeImageId + 20 + 15); for (int i = 0; i < 2; i++) @@ -106,8 +106,8 @@ namespace OpenRCT2 RailingEntrySupportType FootpathRailingsObject::ParseSupportType(std::string_view s) { if (s == "pole") - return RailingEntrySupportType::Pole; + return RailingEntrySupportType::pole; else /* if (s == "box") */ - return RailingEntrySupportType::Box; + return RailingEntrySupportType::box; } } // namespace OpenRCT2 diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 4b5a5f2ad4..daaff76fea 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -834,7 +834,7 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl auto hasSupports = ShouldDrawSupports(session, tileElement, height); auto pathPaintInfo = GetFootpathPaintInfo(tileElement); - if (pathPaintInfo.SupportType == RailingEntrySupportType::Pole) + if (pathPaintInfo.SupportType == RailingEntrySupportType::pole) { PathPaintPoleSupport(session, tileElement, height, pathPaintInfo, hasSupports, imageTemplate, sceneryImageTemplate); } diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 63fde1cf82..d272197be8 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -36,9 +36,9 @@ constexpr auto kPathClearance = 4 * kCoordsZStep; enum class RailingEntrySupportType : uint8_t { - Box = 0, - Pole = 1, - Count + box = 0, + pole = 1, + count }; struct PathSurfaceDescriptor From fdab1ceacda53a46bb4e46785bb7e010a6d5784d Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 11 Jan 2026 17:11:53 +0100 Subject: [PATCH 2/4] Rename members of PathSurfaceDescriptor --- src/openrct2/object/FootpathObject.cpp | 20 +++++++++---------- src/openrct2/object/FootpathSurfaceObject.cpp | 8 ++++---- .../paint/tile_element/Paint.Entrance.cpp | 2 +- .../paint/tile_element/Paint.Path.cpp | 4 ++-- src/openrct2/world/Footpath.h | 9 +++++---- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 5b3b45a6bc..6a31776505 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -42,15 +42,15 @@ namespace OpenRCT2 _legacyType.image = LoadImages(); _legacyType.bridge_image = _legacyType.image + 109; - _pathSurfaceDescriptor.Name = _legacyType.string_idx; - _pathSurfaceDescriptor.Image = _legacyType.image; - _pathSurfaceDescriptor.PreviewImage = _legacyType.GetPreviewImage(); - _pathSurfaceDescriptor.Flags = _legacyType.flags; + _pathSurfaceDescriptor.name = _legacyType.string_idx; + _pathSurfaceDescriptor.image = _legacyType.image; + _pathSurfaceDescriptor.previewImage = _legacyType.GetPreviewImage(); + _pathSurfaceDescriptor.flags = _legacyType.flags; - _queueSurfaceDescriptor.Name = _legacyType.string_idx; - _queueSurfaceDescriptor.Image = _legacyType.GetQueueImage(); - _queueSurfaceDescriptor.PreviewImage = _legacyType.GetQueuePreviewImage(); - _queueSurfaceDescriptor.Flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; + _queueSurfaceDescriptor.name = _legacyType.string_idx; + _queueSurfaceDescriptor.image = _legacyType.GetQueueImage(); + _queueSurfaceDescriptor.previewImage = _legacyType.GetQueuePreviewImage(); + _queueSurfaceDescriptor.flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; _pathRailingsDescriptor.Name = _legacyType.string_idx; _pathRailingsDescriptor.BridgeImage = _legacyType.bridge_image; @@ -73,8 +73,8 @@ namespace OpenRCT2 void FootpathObject::DrawPreview(Drawing::RenderTarget& rt, int32_t width, int32_t height) const { auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 }; - GfxDrawSprite(rt, ImageId(_pathSurfaceDescriptor.PreviewImage), screenCoords - ScreenCoordsXY{ 49, 17 }); - GfxDrawSprite(rt, ImageId(_queueSurfaceDescriptor.PreviewImage), screenCoords + ScreenCoordsXY{ 4, -17 }); + GfxDrawSprite(rt, ImageId(_pathSurfaceDescriptor.previewImage), screenCoords - ScreenCoordsXY{ 49, 17 }); + GfxDrawSprite(rt, ImageId(_queueSurfaceDescriptor.previewImage), screenCoords + ScreenCoordsXY{ 4, -17 }); } void FootpathObject::ReadJson(IReadObjectContext* context, json_t& root) diff --git a/src/openrct2/object/FootpathSurfaceObject.cpp b/src/openrct2/object/FootpathSurfaceObject.cpp index 47ee6db15f..e100f67f9c 100644 --- a/src/openrct2/object/FootpathSurfaceObject.cpp +++ b/src/openrct2/object/FootpathSurfaceObject.cpp @@ -31,10 +31,10 @@ namespace OpenRCT2 BaseImageId = PreviewImageId + 1; } - _descriptor.Name = NameStringId; - _descriptor.Image = BaseImageId; - _descriptor.PreviewImage = PreviewImageId; - _descriptor.Flags = Flags; + _descriptor.name = NameStringId; + _descriptor.image = BaseImageId; + _descriptor.previewImage = PreviewImageId; + _descriptor.flags = Flags; } void FootpathSurfaceObject::Unload() diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index ab1d310844..6615ccf6a3 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -309,7 +309,7 @@ static void PaintParkEntrance(PaintSession& session, uint8_t direction, int32_t auto surfaceDescriptor = entranceEl.GetPathSurfaceDescriptor(); if (surfaceDescriptor != nullptr) { - auto imageIndex = (surfaceDescriptor->Image + 5 * (1 + (direction & 1))); + auto imageIndex = (surfaceDescriptor->image + 5 * (1 + (direction & 1))); PaintAddImageAsParent( session, imageTemplate.WithIndex(imageIndex), { 0, 0, height }, { { 0, 2, height }, { 32, 28, 0 } }); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index daaff76fea..37e1d98418 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -685,8 +685,8 @@ static FootpathPaintInfo GetFootpathPaintInfo(const PathElement& pathEl) const auto* surfaceDescriptor = pathEl.GetSurfaceDescriptor(); if (surfaceDescriptor != nullptr) { - pathPaintInfo.SurfaceImageId = surfaceDescriptor->Image; - pathPaintInfo.SurfaceFlags = surfaceDescriptor->Flags; + pathPaintInfo.SurfaceImageId = surfaceDescriptor->image; + pathPaintInfo.SurfaceFlags = surfaceDescriptor->flags; } const auto* railingsDescriptor = pathEl.GetRailingsDescriptor(); diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index d272197be8..7550667189 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -11,6 +11,7 @@ #include "../Identifiers.h" #include "../actions/CommandFlag.h" +#include "../drawing/ImageIndexType.h" #include "../interface/Colour.h" #include "../localisation/StringIdType.h" #include "../object/ObjectTypes.h" @@ -43,10 +44,10 @@ enum class RailingEntrySupportType : uint8_t struct PathSurfaceDescriptor { - StringId Name; - uint32_t Image; - uint32_t PreviewImage; - uint8_t Flags; + StringId name; + ImageIndex image; + ImageIndex previewImage; + uint8_t flags; }; struct PathRailingsDescriptor From 09999837d1e99e7365b4cfa8cbb1ea29a1e407f2 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 11 Jan 2026 17:20:48 +0100 Subject: [PATCH 3/4] Rename members of PathRailingsDescriptor --- src/openrct2/object/FootpathObject.cpp | 14 +++++++------- src/openrct2/object/FootpathRailingsObject.cpp | 16 ++++++++-------- src/openrct2/paint/tile_element/Paint.Path.cpp | 12 ++++++------ src/openrct2/world/Footpath.h | 16 ++++++++-------- src/openrct2/world/tile_element/PathElement.cpp | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 6a31776505..f72e097842 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -52,13 +52,13 @@ namespace OpenRCT2 _queueSurfaceDescriptor.previewImage = _legacyType.GetQueuePreviewImage(); _queueSurfaceDescriptor.flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; - _pathRailingsDescriptor.Name = _legacyType.string_idx; - _pathRailingsDescriptor.BridgeImage = _legacyType.bridge_image; - _pathRailingsDescriptor.PreviewImage = _legacyType.GetPreviewImage(); - _pathRailingsDescriptor.Flags = _legacyType.flags; - _pathRailingsDescriptor.ScrollingMode = _legacyType.scrolling_mode; - _pathRailingsDescriptor.SupportType = _legacyType.support_type; - _pathRailingsDescriptor.RailingsImage = _legacyType.GetRailingsImage(); + _pathRailingsDescriptor.name = _legacyType.string_idx; + _pathRailingsDescriptor.bridgeImage = _legacyType.bridge_image; + _pathRailingsDescriptor.previewImage = _legacyType.GetPreviewImage(); + _pathRailingsDescriptor.flags = _legacyType.flags; + _pathRailingsDescriptor.scrollingMode = _legacyType.scrolling_mode; + _pathRailingsDescriptor.supportType = _legacyType.support_type; + _pathRailingsDescriptor.railingsImage = _legacyType.GetRailingsImage(); } void FootpathObject::Unload() diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index bdc8857294..57975eade9 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -29,14 +29,14 @@ namespace OpenRCT2 RailingsImageId = PreviewImageId + 1; } - _descriptor.Name = NameStringId; - _descriptor.BridgeImage = BridgeImageId; - _descriptor.PreviewImage = PreviewImageId; - _descriptor.Flags = Flags; - _descriptor.ScrollingMode = ScrollingMode; - _descriptor.SupportType = SupportType; - _descriptor.SupportColour = Colour; - _descriptor.RailingsImage = RailingsImageId; + _descriptor.name = NameStringId; + _descriptor.bridgeImage = BridgeImageId; + _descriptor.previewImage = PreviewImageId; + _descriptor.flags = Flags; + _descriptor.scrollingMode = ScrollingMode; + _descriptor.supportType = SupportType; + _descriptor.supportColour = Colour; + _descriptor.railingsImage = RailingsImageId; } void FootpathRailingsObject::Unload() diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 37e1d98418..fcfbf82a12 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -692,12 +692,12 @@ static FootpathPaintInfo GetFootpathPaintInfo(const PathElement& pathEl) const auto* railingsDescriptor = pathEl.GetRailingsDescriptor(); if (railingsDescriptor != nullptr) { - pathPaintInfo.BridgeImageId = railingsDescriptor->BridgeImage; - pathPaintInfo.RailingsImageId = railingsDescriptor->RailingsImage; - pathPaintInfo.RailingFlags = railingsDescriptor->Flags; - pathPaintInfo.ScrollingMode = railingsDescriptor->ScrollingMode; - pathPaintInfo.SupportType = railingsDescriptor->SupportType; - pathPaintInfo.SupportColour = railingsDescriptor->SupportColour; + pathPaintInfo.BridgeImageId = railingsDescriptor->bridgeImage; + pathPaintInfo.RailingsImageId = railingsDescriptor->railingsImage; + pathPaintInfo.RailingFlags = railingsDescriptor->flags; + pathPaintInfo.ScrollingMode = railingsDescriptor->scrollingMode; + pathPaintInfo.SupportType = railingsDescriptor->supportType; + pathPaintInfo.SupportColour = railingsDescriptor->supportColour; } return pathPaintInfo; diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 7550667189..8847bd534d 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -52,14 +52,14 @@ struct PathSurfaceDescriptor struct PathRailingsDescriptor { - StringId Name; - uint32_t PreviewImage; - uint32_t BridgeImage; - uint32_t RailingsImage; - RailingEntrySupportType SupportType; - colour_t SupportColour; - uint8_t Flags; - uint8_t ScrollingMode; + StringId name; + ImageIndex previewImage; + ImageIndex bridgeImage; + ImageIndex railingsImage; + RailingEntrySupportType supportType; + colour_t supportColour; + uint8_t flags; + uint8_t scrollingMode; }; using PathConstructFlags = uint8_t; diff --git a/src/openrct2/world/tile_element/PathElement.cpp b/src/openrct2/world/tile_element/PathElement.cpp index e86eae2abc..e900908316 100644 --- a/src/openrct2/world/tile_element/PathElement.cpp +++ b/src/openrct2/world/tile_element/PathElement.cpp @@ -299,7 +299,7 @@ namespace OpenRCT2 bool PathElement::ShouldDrawPathOverSupports() const { // TODO: make this an actual decision of the tile element. - return (GetRailingsDescriptor()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); + return (GetRailingsDescriptor()->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); } void PathElement::SetShouldDrawPathOverSupports(bool on) From 63354de46b7971a9ceaf95e3cef0f8d028ba7ae6 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 11 Jan 2026 17:29:07 +0100 Subject: [PATCH 4/4] Rename members of FootpathSelection --- .../windows/EditorParkEntrance.cpp | 8 +- src/openrct2-ui/windows/Footpath.cpp | 106 +++++++++--------- src/openrct2/world/Footpath.h | 14 +-- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index e97a976418..b88328ca1f 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -203,8 +203,8 @@ namespace OpenRCT2::Ui::Windows ParkEntranceRemoveGhost(); - bool isLegacyPath = (gFootpathSelection.LegacyPath != kObjectEntryIndexNull); - auto pathIndex = isLegacyPath ? gFootpathSelection.LegacyPath : gFootpathSelection.NormalSurface; + bool isLegacyPath = (gFootpathSelection.legacyPath != kObjectEntryIndexNull); + auto pathIndex = isLegacyPath ? gFootpathSelection.legacyPath : gFootpathSelection.normalSurface; auto gameAction = GameActions::ParkEntrancePlaceAction( parkEntrancePosition, pathIndex, _selectedEntranceType, isLegacyPath); gameAction.SetFlags({ CommandFlag::ghost }); @@ -226,8 +226,8 @@ namespace OpenRCT2::Ui::Windows CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); if (!parkEntrancePosition.IsNull()) { - bool isLegacyPath = (gFootpathSelection.LegacyPath != kObjectEntryIndexNull); - auto pathIndex = isLegacyPath ? gFootpathSelection.LegacyPath : gFootpathSelection.NormalSurface; + bool isLegacyPath = (gFootpathSelection.legacyPath != kObjectEntryIndexNull); + auto pathIndex = isLegacyPath ? gFootpathSelection.legacyPath : gFootpathSelection.normalSurface; auto gameAction = GameActions::ParkEntrancePlaceAction( parkEntrancePosition, pathIndex, _selectedEntranceType, isLegacyPath); gameAction.SetCallback( diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 2057d8200a..54bc10aaf7 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -413,33 +413,33 @@ namespace OpenRCT2::Ui::Windows auto entryIndex = _dropdownEntries[selectedIndex]; if (widgetIndex == WIDX_FOOTPATH_TYPE) { - gFootpathSelection.IsQueueSelected = false; + gFootpathSelection.isQueueSelected = false; if (entryIndex.first == ObjectType::paths) { - gFootpathSelection.LegacyPath = entryIndex.second; + gFootpathSelection.legacyPath = entryIndex.second; } else { - gFootpathSelection.LegacyPath = kObjectEntryIndexNull; - gFootpathSelection.NormalSurface = entryIndex.second; + gFootpathSelection.legacyPath = kObjectEntryIndexNull; + gFootpathSelection.normalSurface = entryIndex.second; } } else if (widgetIndex == WIDX_QUEUELINE_TYPE) { - gFootpathSelection.IsQueueSelected = true; + gFootpathSelection.isQueueSelected = true; if (entryIndex.first == ObjectType::paths) { - gFootpathSelection.LegacyPath = entryIndex.second; + gFootpathSelection.legacyPath = entryIndex.second; } else { - gFootpathSelection.LegacyPath = kObjectEntryIndexNull; - gFootpathSelection.QueueSurface = entryIndex.second; + gFootpathSelection.legacyPath = kObjectEntryIndexNull; + gFootpathSelection.queueSurface = entryIndex.second; } } else if (widgetIndex == WIDX_RAILINGS_TYPE) { - gFootpathSelection.Railings = entryIndex.second; + gFootpathSelection.railings = entryIndex.second; } else { @@ -527,7 +527,7 @@ namespace OpenRCT2::Ui::Windows // Press / unpress footpath and queue type buttons pressedWidgets &= ~(1uLL << WIDX_FOOTPATH_TYPE); pressedWidgets &= ~(1uLL << WIDX_QUEUELINE_TYPE); - pressedWidgets |= gFootpathSelection.IsQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) : (1uLL << WIDX_FOOTPATH_TYPE); + pressedWidgets |= gFootpathSelection.isQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) : (1uLL << WIDX_FOOTPATH_TYPE); // Enable / disable construct button widgets[WIDX_CONSTRUCT].type = _footpathConstructionMode == PathConstructionMode::bridgeOrTunnel @@ -546,7 +546,7 @@ namespace OpenRCT2::Ui::Windows disabledWidgets |= (1uLL << WIDX_CONSTRUCT_DRAG_AREA); #endif - if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull) + if (gFootpathSelection.legacyPath == kObjectEntryIndexNull) { widgets[WIDX_RAILINGS_TYPE].type = WidgetType::flatBtn; } @@ -569,9 +569,9 @@ namespace OpenRCT2::Ui::Windows auto slopeOffset = EnumValue(_footpathConstructSlope); std::optional baseImage; - if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull) + if (gFootpathSelection.legacyPath == kObjectEntryIndexNull) { - auto selectedPath = gFootpathSelection.GetSelectedSurface(); + auto selectedPath = gFootpathSelection.getSelectedSurface(); const auto* pathType = GetPathSurfaceEntry(selectedPath); if (pathType != nullptr) { @@ -581,11 +581,11 @@ namespace OpenRCT2::Ui::Windows else { auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - const auto* pathObj = objManager.GetLoadedObject(gFootpathSelection.LegacyPath); + const auto* pathObj = objManager.GetLoadedObject(gFootpathSelection.legacyPath); if (pathObj != nullptr) { auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - if (gFootpathSelection.IsQueueSelected) + if (gFootpathSelection.isQueueSelected) baseImage = pathEntry->GetQueueImage(); else baseImage = pathEntry->image; @@ -647,7 +647,7 @@ namespace OpenRCT2::Ui::Windows if (!_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) { ObjectEntryIndex type; - ObjectEntryIndex railings = gFootpathSelection.Railings; + ObjectEntryIndex railings = gFootpathSelection.railings; CoordsXYZ footpathLoc; FootpathSlope slope; @@ -686,18 +686,18 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathDrawDropdownButtons(Drawing::RenderTarget& rt) { - if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull) + if (gFootpathSelection.legacyPath == kObjectEntryIndexNull) { // Set footpath and queue type button images auto pathImage = kImageIndexUndefined; auto queueImage = kImageIndexUndefined; - auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.NormalSurface); + auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.normalSurface); if (pathEntry != nullptr) { pathImage = pathEntry->PreviewImageId; } - pathEntry = GetPathSurfaceEntry(gFootpathSelection.QueueSurface); + pathEntry = GetPathSurfaceEntry(gFootpathSelection.queueSurface); if (pathEntry != nullptr) { queueImage = pathEntry->PreviewImageId; @@ -708,7 +708,7 @@ namespace OpenRCT2::Ui::Windows // Set railing auto railingsImage = kImageIndexUndefined; - auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.Railings); + auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.railings); if (railingsEntry != nullptr) { railingsImage = railingsEntry->PreviewImageId; @@ -722,7 +722,7 @@ namespace OpenRCT2::Ui::Windows // Set footpath and queue type button images auto pathImage = kImageIndexUndefined; auto queueImage = kImageIndexUndefined; - const auto* pathObj = objManager.GetLoadedObject(gFootpathSelection.LegacyPath); + const auto* pathObj = objManager.GetLoadedObject(gFootpathSelection.legacyPath); if (pathObj != nullptr) { auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); @@ -781,8 +781,8 @@ namespace OpenRCT2::Ui::Windows continue; } - if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull - && i == (showQueues ? gFootpathSelection.QueueSurface : gFootpathSelection.NormalSurface)) + if (gFootpathSelection.legacyPath == kObjectEntryIndexNull + && i == (showQueues ? gFootpathSelection.queueSurface : gFootpathSelection.normalSurface)) { defaultIndex = numPathTypes; } @@ -806,7 +806,7 @@ namespace OpenRCT2::Ui::Windows continue; } - if (gFootpathSelection.LegacyPath != kObjectEntryIndexNull && gFootpathSelection.LegacyPath == i) + if (gFootpathSelection.legacyPath != kObjectEntryIndexNull && gFootpathSelection.legacyPath == i) { defaultIndex = numPathTypes; } @@ -842,7 +842,7 @@ namespace OpenRCT2::Ui::Windows { continue; } - if (i == gFootpathSelection.Railings) + if (i == gFootpathSelection.railings) { defaultIndex = numRailingsTypes; } @@ -1081,12 +1081,12 @@ namespace OpenRCT2::Ui::Windows } // Set provisional path - auto pathType = gFootpathSelection.GetSelectedSurface(); + auto pathType = gFootpathSelection.getSelectedSurface(); auto constructFlags = FootpathCreateConstructFlags(pathType); auto footpathLoc = CoordsXYZ(*mapPos, placement.baseZ); auto tiles = std::array({ footpathLoc, placement.slope }); const auto footpathCost = FootpathProvisionalSet( - pathType, gFootpathSelection.Railings, *mapPos, *mapPos, placement.baseZ, tiles, constructFlags); + pathType, gFootpathSelection.railings, *mapPos, *mapPos, placement.baseZ, tiles, constructFlags); if (_windowFootpathCost != footpathCost) { @@ -1133,10 +1133,10 @@ namespace OpenRCT2::Ui::Windows // Set provisional path auto tiles = buildTileVector(range, baseZ); - auto pathType = gFootpathSelection.GetSelectedSurface(); + auto pathType = gFootpathSelection.getSelectedSurface(); auto constructFlags = FootpathCreateConstructFlags(pathType); const auto footpathCost = FootpathProvisionalSet( - pathType, gFootpathSelection.Railings, range.Point1, range.Point2, baseZ, tiles, constructFlags); + pathType, gFootpathSelection.railings, range.Point1, range.Point2, baseZ, tiles, constructFlags); if (_windowFootpathCost != footpathCost) { @@ -1239,7 +1239,7 @@ namespace OpenRCT2::Ui::Windows auto correctedPos = mapPos->ToTileStart(); // For queues, only allow selecting a single line. - if (gFootpathSelection.IsQueueSelected) + if (gFootpathSelection.isQueueSelected) { auto xDiff = correctedPos.x - _dragStartPos.x; auto yDiff = correctedPos.y - _dragStartPos.y; @@ -1278,7 +1278,7 @@ namespace OpenRCT2::Ui::Windows return; // Try and place path - auto selectedType = gFootpathSelection.GetSelectedSurface(); + auto selectedType = gFootpathSelection.getSelectedSurface(); PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); bool anySuccess = false; @@ -1288,7 +1288,7 @@ namespace OpenRCT2::Ui::Windows for (const auto& tile : _provisionalFootpath.tiles) { auto footpathPlaceAction = GameActions::FootpathPlaceAction( - tile.position, tile.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags); + tile.position, tile.slope, selectedType, gFootpathSelection.railings, kInvalidDirection, constructFlags); auto result = GameActions::Execute(&footpathPlaceAction, getGameState()); if (result.error == GameActions::Status::ok) { @@ -1333,11 +1333,11 @@ namespace OpenRCT2::Ui::Windows auto placement = WindowFootpathGetPlacementFromScreenCoords(screenCoords); // Try and place path - auto selectedType = gFootpathSelection.GetSelectedSurface(); + auto selectedType = gFootpathSelection.getSelectedSurface(); PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); auto footpathPlaceAction = GameActions::FootpathPlaceAction( - { *mapPos, placement.baseZ }, placement.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, + { *mapPos, placement.baseZ }, placement.slope, selectedType, gFootpathSelection.railings, kInvalidDirection, constructFlags); footpathPlaceAction.SetCallback([this](const GameActions::GameAction* ga, const GameActions::Result* result) { if (result->error == GameActions::Status::ok) @@ -1430,7 +1430,7 @@ namespace OpenRCT2::Ui::Windows PathConstructFlags constructFlags = FootpathCreateConstructFlags(type); auto footpathPlaceAction = GameActions::FootpathPlaceAction( - footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); + footpathLoc, slope, type, gFootpathSelection.railings, _footpathConstructDirection, constructFlags); footpathPlaceAction.SetCallback( [footpathLoc](const GameActions::GameAction* ga, const GameActions::Result* result) { @@ -1678,7 +1678,7 @@ namespace OpenRCT2::Ui::Windows footpathLoc.z = _footpathConstructFromPosition.z; if (type != nullptr) { - *type = gFootpathSelection.GetSelectedSurface(); + *type = gFootpathSelection.getSelectedSurface(); } *slope = {}; if (_footpathConstructSlope != SlopePitch::flat) @@ -1695,12 +1695,12 @@ namespace OpenRCT2::Ui::Windows PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type) { PathConstructFlags pathConstructFlags = 0; - if (gFootpathSelection.IsQueueSelected) + if (gFootpathSelection.isQueueSelected) pathConstructFlags |= PathConstructFlag::IsQueue; - if (gFootpathSelection.LegacyPath != kObjectEntryIndexNull) + if (gFootpathSelection.legacyPath != kObjectEntryIndexNull) { pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; - type = gFootpathSelection.LegacyPath; + type = gFootpathSelection.legacyPath; } return pathConstructFlags; } @@ -2150,39 +2150,39 @@ namespace OpenRCT2::Ui::Windows { // Select default footpath auto surfaceIndex = FootpathGetDefaultSurface(false); - if (FootpathIsSurfaceEntryOkay(gFootpathSelection.NormalSurface, false)) + if (FootpathIsSurfaceEntryOkay(gFootpathSelection.normalSurface, false)) { - surfaceIndex = gFootpathSelection.NormalSurface; + surfaceIndex = gFootpathSelection.normalSurface; } // Select default queue auto queueIndex = FootpathGetDefaultSurface(true); - if (FootpathIsSurfaceEntryOkay(gFootpathSelection.QueueSurface, true)) + if (FootpathIsSurfaceEntryOkay(gFootpathSelection.queueSurface, true)) { - queueIndex = gFootpathSelection.QueueSurface; + queueIndex = gFootpathSelection.queueSurface; } // Select default railing auto railingIndex = FootpathGetDefaultRailings(); - const auto* railingEntry = GetPathRailingsEntry(gFootpathSelection.Railings); + const auto* railingEntry = GetPathRailingsEntry(gFootpathSelection.railings); if (railingEntry != nullptr) { - railingIndex = gFootpathSelection.Railings; + railingIndex = gFootpathSelection.railings; } // Select default legacy path auto legacyPathIndex = FootpathGetDefaultLegacyPath(); - if (gFootpathSelection.LegacyPath != kObjectEntryIndexNull) + if (gFootpathSelection.legacyPath != kObjectEntryIndexNull) { - if (FootpathIsLegacyPathEntryOkay(gFootpathSelection.LegacyPath)) + if (FootpathIsLegacyPathEntryOkay(gFootpathSelection.legacyPath)) { // Keep legacy path selected - legacyPathIndex = gFootpathSelection.LegacyPath; + legacyPathIndex = gFootpathSelection.legacyPath; } else { // Reset legacy path, we default to a surface (if there are any) - gFootpathSelection.LegacyPath = kObjectEntryIndexNull; + gFootpathSelection.legacyPath = kObjectEntryIndexNull; } } @@ -2195,12 +2195,12 @@ namespace OpenRCT2::Ui::Windows } // No surfaces available, so default to legacy path - gFootpathSelection.LegacyPath = legacyPathIndex; + gFootpathSelection.legacyPath = legacyPathIndex; } - gFootpathSelection.NormalSurface = surfaceIndex; - gFootpathSelection.QueueSurface = queueIndex; - gFootpathSelection.Railings = railingIndex; + gFootpathSelection.normalSurface = surfaceIndex; + gFootpathSelection.queueSurface = queueIndex; + gFootpathSelection.railings = railingIndex; return true; } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 8847bd534d..e19246545e 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -71,15 +71,15 @@ namespace OpenRCT2::PathConstructFlag struct FootpathSelection { - OpenRCT2::ObjectEntryIndex LegacyPath = OpenRCT2::kObjectEntryIndexNull; - OpenRCT2::ObjectEntryIndex NormalSurface = OpenRCT2::kObjectEntryIndexNull; - OpenRCT2::ObjectEntryIndex QueueSurface = OpenRCT2::kObjectEntryIndexNull; - OpenRCT2::ObjectEntryIndex Railings = OpenRCT2::kObjectEntryIndexNull; - bool IsQueueSelected{}; + OpenRCT2::ObjectEntryIndex legacyPath = OpenRCT2::kObjectEntryIndexNull; + OpenRCT2::ObjectEntryIndex normalSurface = OpenRCT2::kObjectEntryIndexNull; + OpenRCT2::ObjectEntryIndex queueSurface = OpenRCT2::kObjectEntryIndexNull; + OpenRCT2::ObjectEntryIndex railings = OpenRCT2::kObjectEntryIndexNull; + bool isQueueSelected{}; - OpenRCT2::ObjectEntryIndex GetSelectedSurface() const + OpenRCT2::ObjectEntryIndex getSelectedSurface() const { - return IsQueueSelected ? QueueSurface : NormalSurface; + return isQueueSelected ? queueSurface : normalSurface; } };