forked from rosebudai/OpenRCT2-Web
Make PathElement members adhere to code style
This commit is contained in:
45 files changed
+739
-739
No files matched your search
@@ -485,7 +485,7 @@ namespace OpenRCT2::Ui
|
||||
}
|
||||
case ViewportInteractionItem::footpath:
|
||||
ft.Add<StringId>(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE);
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
ft.Add<StringId>(STR_QUEUE_LINE_MAP_TIP);
|
||||
else
|
||||
ft.Add<StringId>(STR_FOOTPATH_MAP_TIP);
|
||||
@@ -494,9 +494,9 @@ namespace OpenRCT2::Ui
|
||||
|
||||
case ViewportInteractionItem::pathAddition:
|
||||
{
|
||||
auto* pathAddEntry = tileElement->asPath()->GetAdditionEntry();
|
||||
auto* pathAddEntry = tileElement->asPath()->getAdditionEntry();
|
||||
ft.Add<StringId>(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE);
|
||||
if (tileElement->asPath()->IsBroken())
|
||||
if (tileElement->asPath()->isBroken())
|
||||
{
|
||||
ft.Add<StringId>(STR_BROKEN);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRCT2::Ui
|
||||
if (info.interactionType == ViewportInteractionItem::footpath)
|
||||
{
|
||||
z = myTileElement->getBaseZ();
|
||||
if (myTileElement->asPath()->IsSloped())
|
||||
if (myTileElement->asPath()->isSloped())
|
||||
{
|
||||
z += 8;
|
||||
}
|
||||
|
||||
@@ -1017,9 +1017,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto pathElement = info.Element->asPath();
|
||||
if (pathElement != nullptr)
|
||||
{
|
||||
auto slopeDirection = pathElement->GetSlopeDirection();
|
||||
auto slopeDirection = pathElement->getSlopeDirection();
|
||||
FootpathSlope slope = { FootpathSlopeType::flat, slopeDirection };
|
||||
if (pathElement->IsSloped())
|
||||
if (pathElement->isSloped())
|
||||
{
|
||||
slope.type = FootpathSlopeType::sloped;
|
||||
}
|
||||
@@ -1443,9 +1443,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
z = tileElement->getBaseZ();
|
||||
if (tileElement->getType() == TileElementType::path)
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (direction == (tileElement->asPath()->GetSlopeDirection()))
|
||||
if (direction == (tileElement->asPath()->getSlopeDirection()))
|
||||
{
|
||||
z += kPathHeightStep;
|
||||
}
|
||||
@@ -1533,9 +1533,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
void FootpathRemoveTileElement(PathElement* pathElement)
|
||||
{
|
||||
auto z = pathElement->getBaseZ();
|
||||
if (pathElement->IsSloped())
|
||||
if (pathElement->isSloped())
|
||||
{
|
||||
uint8_t slopeDirection = pathElement->GetSlopeDirection();
|
||||
uint8_t slopeDirection = pathElement->getSlopeDirection();
|
||||
slopeDirection = DirectionReverse(slopeDirection);
|
||||
if (slopeDirection == _footpathConstructDirection)
|
||||
{
|
||||
@@ -1545,16 +1545,16 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// Find a connected edge
|
||||
int32_t edge = DirectionReverse(_footpathConstructDirection);
|
||||
if (!(pathElement->GetEdges() & (1 << edge)))
|
||||
if (!(pathElement->getEdges() & (1 << edge)))
|
||||
{
|
||||
edge = (edge + 1) & 3;
|
||||
if (!(pathElement->GetEdges() & (1 << edge)))
|
||||
if (!(pathElement->getEdges() & (1 << edge)))
|
||||
{
|
||||
edge = (edge + 2) & 3;
|
||||
if (!(pathElement->GetEdges() & (1 << edge)))
|
||||
if (!(pathElement->getEdges() & (1 << edge)))
|
||||
{
|
||||
edge = (edge - 1) & 3;
|
||||
if (!(pathElement->GetEdges() & (1 << edge)))
|
||||
if (!(pathElement->getEdges() & (1 << edge)))
|
||||
{
|
||||
edge = DirectionReverse(edge);
|
||||
}
|
||||
@@ -1595,9 +1595,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
if (pathElement->getBaseZ() == z)
|
||||
{
|
||||
if (pathElement->IsSloped())
|
||||
if (pathElement->isSloped())
|
||||
{
|
||||
if (DirectionReverse(pathElement->GetSlopeDirection()) != _footpathConstructDirection)
|
||||
if (DirectionReverse(pathElement->getSlopeDirection()) != _footpathConstructDirection)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1607,9 +1607,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
if (pathElement->getBaseZ() == zLow)
|
||||
{
|
||||
if (!pathElement->IsSloped())
|
||||
if (!pathElement->isSloped())
|
||||
{
|
||||
if ((pathElement->GetSlopeDirection()) == _footpathConstructDirection)
|
||||
if ((pathElement->getSlopeDirection()) == _footpathConstructDirection)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3448,7 +3448,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
pathsByDir[i] = MapGetFootpathElement(testLoc);
|
||||
|
||||
if (pathsByDir[i] != nullptr && pathsByDir[i]->IsSloped() && pathsByDir[i]->GetSlopeDirection() != i)
|
||||
if (pathsByDir[i] != nullptr && pathsByDir[i]->isSloped() && pathsByDir[i]->getSlopeDirection() != i)
|
||||
{
|
||||
pathsByDir[i] = nullptr;
|
||||
}
|
||||
@@ -3459,13 +3459,13 @@ namespace OpenRCT2::Ui::Windows
|
||||
pathsByDir[i] = MapGetFootpathElement({ *mapCoords + CoordsDirectionDelta[i], z - kPathHeightStep });
|
||||
|
||||
if (pathsByDir[i] != nullptr
|
||||
&& (!pathsByDir[i]->IsSloped() || pathsByDir[i]->GetSlopeDirection() != DirectionReverse(i)))
|
||||
&& (!pathsByDir[i]->isSloped() || pathsByDir[i]->getSlopeDirection() != DirectionReverse(i)))
|
||||
{
|
||||
pathsByDir[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (pathsByDir[i] != nullptr && pathsByDir[i]->IsQueue())
|
||||
if (pathsByDir[i] != nullptr && pathsByDir[i]->isQueue())
|
||||
{
|
||||
pathsByDir[i] = nullptr;
|
||||
}
|
||||
|
||||
@@ -2378,7 +2378,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
case ViewportInteractionItem::pathAddition:
|
||||
{
|
||||
auto entryIndex = info.Element->asPath()->GetAdditionEntryIndex();
|
||||
auto entryIndex = info.Element->asPath()->getAdditionEntryIndex();
|
||||
auto* pathAdditionEntry = ObjectEntryManager::GetObjectEntry<PathAdditionEntry>(entryIndex);
|
||||
if (pathAdditionEntry != nullptr)
|
||||
{
|
||||
@@ -2881,9 +2881,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto z = info.Element->getBaseZ();
|
||||
|
||||
if (info.Element->asPath()->IsSloped())
|
||||
if (info.Element->asPath()->isSloped())
|
||||
{
|
||||
if (rotation != DirectionReverse(info.Element->asPath()->GetSlopeDirection()))
|
||||
if (rotation != DirectionReverse(info.Element->asPath()->getSlopeDirection()))
|
||||
{
|
||||
z += (2 * kCoordsZStep);
|
||||
}
|
||||
|
||||
@@ -614,15 +614,15 @@ namespace OpenRCT2::Ui::Windows
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_PATH_CHECK_SLOPED:
|
||||
PathSetSloped(windowTileInspectorSelectedIndex, !tileElement->asPath()->IsSloped());
|
||||
PathSetSloped(windowTileInspectorSelectedIndex, !tileElement->asPath()->isSloped());
|
||||
break;
|
||||
case WIDX_PATH_CHECK_JUNCTION_RAILINGS:
|
||||
PathSetJunctionRailings(
|
||||
windowTileInspectorSelectedIndex, !tileElement->asPath()->HasJunctionRailings());
|
||||
windowTileInspectorSelectedIndex, !tileElement->asPath()->hasJunctionRailings());
|
||||
break;
|
||||
|
||||
case WIDX_PATH_CHECK_BROKEN:
|
||||
PathSetBroken(windowTileInspectorSelectedIndex, !tileElement->asPath()->IsBroken());
|
||||
PathSetBroken(windowTileInspectorSelectedIndex, !tileElement->asPath()->isBroken());
|
||||
break;
|
||||
|
||||
case WIDX_PATH_CHECK_EDGE_E:
|
||||
@@ -1207,11 +1207,11 @@ namespace OpenRCT2::Ui::Windows
|
||||
void onDrawPath(RenderTarget& rt, ScreenCoordsXY screenCoords, const PathElement& pathEl)
|
||||
{
|
||||
// Details
|
||||
auto footpathObj = pathEl.GetLegacyPathEntry();
|
||||
auto footpathObj = pathEl.getLegacyPathEntry();
|
||||
if (footpathObj == nullptr)
|
||||
{
|
||||
// Surface name
|
||||
auto surfaceObj = pathEl.GetSurfaceEntry();
|
||||
auto surfaceObj = pathEl.getSurfaceEntry();
|
||||
if (surfaceObj != nullptr)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
@@ -1220,7 +1220,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
// Railings name
|
||||
auto railingsObj = pathEl.GetRailingsEntry();
|
||||
auto railingsObj = pathEl.getRailingsEntry();
|
||||
if (railingsObj != nullptr)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
@@ -1240,9 +1240,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
// Path addition
|
||||
if (pathEl.HasAddition())
|
||||
if (pathEl.hasAddition())
|
||||
{
|
||||
const auto pathAdditionEntry = pathEl.GetAdditionEntry();
|
||||
const auto pathAdditionEntry = pathEl.getAdditionEntry();
|
||||
StringId additionNameId = pathAdditionEntry != nullptr ? pathAdditionEntry->name
|
||||
: static_cast<StringId>(STR_UNKNOWN_OBJECT_TYPE);
|
||||
auto ft = Formatter();
|
||||
@@ -1662,7 +1662,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
break;
|
||||
|
||||
case TileElementType::path:
|
||||
typeName = tileElement->asPath()->IsQueue() ? LanguageGetString(STR_QUEUE_LINE_MAP_TIP)
|
||||
typeName = tileElement->asPath()->isQueue() ? LanguageGetString(STR_QUEUE_LINE_MAP_TIP)
|
||||
: LanguageGetString(STR_FOOTPATH_MAP_TIP);
|
||||
break;
|
||||
|
||||
@@ -2248,25 +2248,25 @@ namespace OpenRCT2::Ui::Windows
|
||||
widgets[WIDX_PATH_CHECK_EDGE_NW].moveTo(CheckboxGroupOffset(PropertyRowCol(propertiesAnchor, 4, 1), 1, 1));
|
||||
widgets[WIDX_PATH_CHECK_EDGE_N].moveTo(CheckboxGroupOffset(PropertyRowCol(propertiesAnchor, 4, 1), 2, 0));
|
||||
|
||||
setCheckboxValue(WIDX_PATH_CHECK_SLOPED, tileElement->asPath()->IsSloped());
|
||||
setCheckboxValue(WIDX_PATH_CHECK_JUNCTION_RAILINGS, tileElement->asPath()->HasJunctionRailings());
|
||||
setCheckboxValue(WIDX_PATH_CHECK_BROKEN, tileElement->asPath()->IsBroken());
|
||||
setCheckboxValue(WIDX_PATH_CHECK_SLOPED, tileElement->asPath()->isSloped());
|
||||
setCheckboxValue(WIDX_PATH_CHECK_JUNCTION_RAILINGS, tileElement->asPath()->hasJunctionRailings());
|
||||
setCheckboxValue(WIDX_PATH_CHECK_BROKEN, tileElement->asPath()->isBroken());
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_NE, tileElement->asPath()->GetEdges() & (1 << ((0 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_NE, tileElement->asPath()->getEdges() & (1 << ((0 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_SE, tileElement->asPath()->GetEdges() & (1 << ((1 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_SE, tileElement->asPath()->getEdges() & (1 << ((1 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_SW, tileElement->asPath()->GetEdges() & (1 << ((2 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_SW, tileElement->asPath()->getEdges() & (1 << ((2 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_NW, tileElement->asPath()->GetEdges() & (1 << ((3 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_NW, tileElement->asPath()->getEdges() & (1 << ((3 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_E, tileElement->asPath()->GetCorners() & (1 << ((0 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_E, tileElement->asPath()->getCorners() & (1 << ((0 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_S, tileElement->asPath()->GetCorners() & (1 << ((1 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_S, tileElement->asPath()->getCorners() & (1 << ((1 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_W, tileElement->asPath()->GetCorners() & (1 << ((2 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_W, tileElement->asPath()->getCorners() & (1 << ((2 - GetCurrentRotation()) & 3)));
|
||||
setCheckboxValue(
|
||||
WIDX_PATH_CHECK_EDGE_N, tileElement->asPath()->GetCorners() & (1 << ((3 - GetCurrentRotation()) & 3)));
|
||||
WIDX_PATH_CHECK_EDGE_N, tileElement->asPath()->getCorners() & (1 << ((3 - GetCurrentRotation()) & 3)));
|
||||
break;
|
||||
|
||||
case TileElementType::track:
|
||||
|
||||
@@ -485,10 +485,10 @@ namespace OpenRCT2::GameActions
|
||||
if (it.element->getType() != TileElementType::path)
|
||||
continue;
|
||||
|
||||
if (!(it.element)->asPath()->HasAddition())
|
||||
if (!(it.element)->asPath()->hasAddition())
|
||||
continue;
|
||||
|
||||
it.element->asPath()->SetIsBroken(false);
|
||||
it.element->asPath()->setIsBroken(false);
|
||||
} while (TileElementIteratorNext(&it));
|
||||
|
||||
GfxInvalidateScreen();
|
||||
@@ -509,12 +509,12 @@ namespace OpenRCT2::GameActions
|
||||
continue;
|
||||
|
||||
auto* path = it.element->asPath();
|
||||
if (!path->HasAddition())
|
||||
if (!path->hasAddition())
|
||||
continue;
|
||||
|
||||
auto* pathAdditionEntry = path->GetAdditionEntry();
|
||||
auto* pathAdditionEntry = path->getAdditionEntry();
|
||||
if (pathAdditionEntry != nullptr && pathAdditionEntry->flags & PATH_ADDITION_FLAG_IS_BIN)
|
||||
path->SetAdditionStatus(0xFF);
|
||||
path->setAdditionStatus(0xFF);
|
||||
|
||||
} while (TileElementIteratorNext(&it));
|
||||
|
||||
|
||||
@@ -81,15 +81,15 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
auto pathElement = tileElement->asPath();
|
||||
if (pathElement->IsLevelCrossing(_loc))
|
||||
if (pathElement->isLevelCrossing(_loc))
|
||||
{
|
||||
return Result(
|
||||
Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_BUILD_PATH_ADDITIONS_ON_LEVEL_CROSSINGS);
|
||||
}
|
||||
|
||||
// No change
|
||||
if (!GetFlags().has(CommandFlag::ghost) && pathElement->GetAdditionEntryIndex() == _entryIndex
|
||||
&& !(pathElement->IsBroken()))
|
||||
if (!GetFlags().has(CommandFlag::ghost) && pathElement->getAdditionEntryIndex() == _entryIndex
|
||||
&& !(pathElement->isBroken()))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
@@ -102,23 +102,23 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
uint16_t sceneryFlags = pathAdditionEntry->flags;
|
||||
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_SLOPE) && pathElement->IsSloped())
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_SLOPE) && pathElement->isSloped())
|
||||
{
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH);
|
||||
}
|
||||
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_QUEUE) && pathElement->IsQueue())
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_QUEUE) && pathElement->isQueue())
|
||||
{
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_PLACE_THESE_ON_QUEUE_LINE_AREA);
|
||||
}
|
||||
|
||||
if (!(sceneryFlags & (PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_WATER | PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_SNOW))
|
||||
&& (pathElement->GetEdges()) == 0x0F)
|
||||
&& (pathElement->getEdges()) == 0x0F)
|
||||
{
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_PLACED_ON_PATH_EDGES);
|
||||
}
|
||||
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN) && !pathElement->IsQueue())
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN) && !pathElement->isQueue())
|
||||
{
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ namespace OpenRCT2::GameActions
|
||||
if (GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
// Check if there is something on the path already
|
||||
if (pathElement->HasAddition())
|
||||
if (pathElement->hasAddition())
|
||||
{
|
||||
return Result(Status::itemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
@@ -153,8 +153,8 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
// No change
|
||||
if (!GetFlags().has(CommandFlag::ghost) && pathElement->GetAdditionEntryIndex() == _entryIndex
|
||||
&& !(pathElement->IsBroken()) && !pathElement->AdditionIsGhost())
|
||||
if (!GetFlags().has(CommandFlag::ghost) && pathElement->getAdditionEntryIndex() == _entryIndex
|
||||
&& !(pathElement->isBroken()) && !pathElement->additionIsGhost())
|
||||
{
|
||||
return res;
|
||||
}
|
||||
@@ -170,19 +170,19 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
pathElement->SetAdditionIsGhost(true);
|
||||
pathElement->setAdditionIsGhost(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FootpathInterruptPeeps(_loc);
|
||||
pathElement->SetAdditionIsGhost(false);
|
||||
pathElement->setAdditionIsGhost(false);
|
||||
}
|
||||
|
||||
pathElement->SetAdditionEntryIndex(_entryIndex);
|
||||
pathElement->SetIsBroken(false);
|
||||
pathElement->setAdditionEntryIndex(_entryIndex);
|
||||
pathElement->setIsBroken(false);
|
||||
if (pathAdditionEntry->flags & PATH_ADDITION_FLAG_IS_BIN)
|
||||
{
|
||||
pathElement->SetAdditionStatus(255);
|
||||
pathElement->setAdditionStatus(255);
|
||||
}
|
||||
MapInvalidateTileFull(_loc);
|
||||
return res;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!pathElement->AdditionIsGhost() && (GetFlags().has(CommandFlag::ghost)))
|
||||
if (!pathElement->additionIsGhost() && (GetFlags().has(CommandFlag::ghost)))
|
||||
{
|
||||
LOG_WARNING("Tried to remove non ghost during ghost removal.");
|
||||
return Result(Status::disallowed, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
@@ -104,7 +104,7 @@ namespace OpenRCT2::GameActions
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
pathElement->SetAddition(0);
|
||||
pathElement->setAddition(0);
|
||||
MapInvalidateTileFull(_loc);
|
||||
|
||||
auto res = Result();
|
||||
|
||||
@@ -267,22 +267,22 @@ namespace OpenRCT2::GameActions
|
||||
pathElement->setClearanceZ(zHigh);
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
{
|
||||
pathElement->SetLegacyPathEntryIndex(_type);
|
||||
pathElement->setLegacyPathEntryIndex(_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
pathElement->SetSurfaceEntryIndex(_type);
|
||||
pathElement->SetRailingsEntryIndex(_railingsType);
|
||||
pathElement->setSurfaceEntryIndex(_type);
|
||||
pathElement->setRailingsEntryIndex(_railingsType);
|
||||
}
|
||||
pathElement->SetSlopeDirection(_slope.direction);
|
||||
pathElement->SetSloped(_slope.type == FootpathSlopeType::sloped);
|
||||
pathElement->SetIsQueue(isQueue);
|
||||
pathElement->SetAddition(0);
|
||||
pathElement->SetRideIndex(RideId::GetNull());
|
||||
pathElement->SetAdditionStatus(255);
|
||||
pathElement->SetIsBroken(false);
|
||||
pathElement->SetEdges(_edges);
|
||||
pathElement->SetCorners(0);
|
||||
pathElement->setSlopeDirection(_slope.direction);
|
||||
pathElement->setSloped(_slope.type == FootpathSlopeType::sloped);
|
||||
pathElement->setIsQueue(isQueue);
|
||||
pathElement->setAddition(0);
|
||||
pathElement->setRideIndex(RideId::GetNull());
|
||||
pathElement->setAdditionStatus(255);
|
||||
pathElement->setIsBroken(false);
|
||||
pathElement->setEdges(_edges);
|
||||
pathElement->setCorners(0);
|
||||
pathElement->setGhost(GetFlags().has(CommandFlag::ghost));
|
||||
|
||||
MapInvalidateTileFull(_loc);
|
||||
|
||||
@@ -165,10 +165,10 @@ namespace OpenRCT2::GameActions
|
||||
bool FootpathPlaceAction::IsSameAsPathElement(const PathElement* pathElement) const
|
||||
{
|
||||
// Check if both this action and the element is queue
|
||||
if (pathElement->IsQueue() != ((_constructFlags & PathConstructFlag::IsQueue) != 0))
|
||||
if (pathElement->isQueue() != ((_constructFlags & PathConstructFlag::IsQueue) != 0))
|
||||
return false;
|
||||
|
||||
auto footpathObj = pathElement->GetLegacyPathEntry();
|
||||
auto footpathObj = pathElement->getLegacyPathEntry();
|
||||
if (footpathObj == nullptr)
|
||||
{
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
@@ -176,12 +176,12 @@ namespace OpenRCT2::GameActions
|
||||
return false;
|
||||
}
|
||||
|
||||
return pathElement->GetSurfaceEntryIndex() == _type && pathElement->GetRailingsEntryIndex() == _railingsType;
|
||||
return pathElement->getSurfaceEntryIndex() == _type && pathElement->getRailingsEntryIndex() == _railingsType;
|
||||
}
|
||||
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
{
|
||||
return pathElement->GetLegacyPathEntryIndex() == _type;
|
||||
return pathElement->getLegacyPathEntryIndex() == _type;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -209,7 +209,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
Result FootpathPlaceAction::ElementUpdateQuery(PathElement* pathElement, Result res) const
|
||||
{
|
||||
if (_constructFlags & PathConstructFlag::IsQueue && pathElement->IsLevelCrossing(_loc))
|
||||
if (_constructFlags & PathConstructFlag::IsQueue && pathElement->isLevelCrossing(_loc))
|
||||
{
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_QUEUE_PATHS_CANNOT_BE_USED_FOR_LEVEL_CROSSINGS);
|
||||
}
|
||||
@@ -242,17 +242,17 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
{
|
||||
pathElement->SetLegacyPathEntryIndex(_type);
|
||||
pathElement->setLegacyPathEntryIndex(_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
pathElement->SetSurfaceEntryIndex(_type);
|
||||
pathElement->SetRailingsEntryIndex(_railingsType);
|
||||
pathElement->setSurfaceEntryIndex(_type);
|
||||
pathElement->setRailingsEntryIndex(_railingsType);
|
||||
}
|
||||
|
||||
pathElement->SetIsQueue((_constructFlags & PathConstructFlag::IsQueue) != 0);
|
||||
pathElement->setIsQueue((_constructFlags & PathConstructFlag::IsQueue) != 0);
|
||||
|
||||
auto* elem = pathElement->GetAdditionEntry();
|
||||
auto* elem = pathElement->getAdditionEntry();
|
||||
if (elem != nullptr)
|
||||
{
|
||||
if (_constructFlags & PathConstructFlag::IsQueue)
|
||||
@@ -260,8 +260,8 @@ namespace OpenRCT2::GameActions
|
||||
// remove any addition that isn't a TV or a lamp
|
||||
if ((elem->flags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN) == 0 && (elem->flags & PATH_ADDITION_FLAG_LAMP) == 0)
|
||||
{
|
||||
pathElement->SetIsBroken(false);
|
||||
pathElement->SetAddition(0);
|
||||
pathElement->setIsBroken(false);
|
||||
pathElement->setAddition(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -269,8 +269,8 @@ namespace OpenRCT2::GameActions
|
||||
// remove all TVs
|
||||
if ((elem->flags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN) != 0)
|
||||
{
|
||||
pathElement->SetIsBroken(false);
|
||||
pathElement->SetAddition(0);
|
||||
pathElement->setIsBroken(false);
|
||||
pathElement->setAddition(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -427,20 +427,20 @@ namespace OpenRCT2::GameActions
|
||||
pathElement->setClearanceZ(zHigh);
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
{
|
||||
pathElement->SetLegacyPathEntryIndex(_type);
|
||||
pathElement->setLegacyPathEntryIndex(_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
pathElement->SetSurfaceEntryIndex(_type);
|
||||
pathElement->SetRailingsEntryIndex(_railingsType);
|
||||
pathElement->setSurfaceEntryIndex(_type);
|
||||
pathElement->setRailingsEntryIndex(_railingsType);
|
||||
}
|
||||
pathElement->SetSlopeDirection(_slope.direction);
|
||||
pathElement->SetSloped(_slope.type == FootpathSlopeType::sloped);
|
||||
pathElement->SetIsQueue(isQueue);
|
||||
pathElement->SetAddition(0);
|
||||
pathElement->SetRideIndex(RideId::GetNull());
|
||||
pathElement->SetAdditionStatus(255);
|
||||
pathElement->SetIsBroken(false);
|
||||
pathElement->setSlopeDirection(_slope.direction);
|
||||
pathElement->setSloped(_slope.type == FootpathSlopeType::sloped);
|
||||
pathElement->setIsQueue(isQueue);
|
||||
pathElement->setAddition(0);
|
||||
pathElement->setRideIndex(RideId::GetNull());
|
||||
pathElement->setAdditionStatus(255);
|
||||
pathElement->setIsBroken(false);
|
||||
pathElement->setGhost(GetFlags().has(CommandFlag::ghost));
|
||||
|
||||
FootpathQueueChainReset();
|
||||
@@ -500,9 +500,9 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) const
|
||||
{
|
||||
if (pathElement->IsSloped() && !GetFlags().has(CommandFlag::ghost))
|
||||
if (pathElement->isSloped() && !GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
auto direction = pathElement->GetSlopeDirection();
|
||||
auto direction = pathElement->getSlopeDirection();
|
||||
int32_t z = pathElement->getBaseZ();
|
||||
WallRemoveIntersectingWalls({ _loc, z, z + (6 * kCoordsZStep) }, DirectionReverse(direction));
|
||||
WallRemoveIntersectingWalls({ _loc, z, z + (6 * kCoordsZStep) }, direction);
|
||||
@@ -530,9 +530,9 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (pathElement->getBaseZ() != footpathPos.z)
|
||||
continue;
|
||||
if (pathElement->IsSloped() != isSloped)
|
||||
if (pathElement->isSloped() != isSloped)
|
||||
continue;
|
||||
if (isSloped && pathElement->GetSlopeDirection() != slope.direction)
|
||||
if (isSloped && pathElement->getSlopeDirection() != slope.direction)
|
||||
continue;
|
||||
return pathElement;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace OpenRCT2::GameActions
|
||||
if (pathElement->getBaseZ() != _loc.z && pathElement->getBaseZ() != _loc.z - kPathHeightStep)
|
||||
continue;
|
||||
|
||||
if (!(pathElement->GetEdges() & (1 << _loc.direction)))
|
||||
if (!(pathElement->getEdges() & (1 << _loc.direction)))
|
||||
continue;
|
||||
|
||||
if (pathElement->isGhost() && !GetFlags().has(CommandFlag::ghost))
|
||||
|
||||
@@ -539,7 +539,7 @@ namespace OpenRCT2::GameActions
|
||||
MapGetObstructionErrorText(tileElement, res);
|
||||
return res;
|
||||
case TileElementType::path:
|
||||
if (tileElement->asPath()->GetEdges() & (1 << _edge))
|
||||
if (tileElement->asPath()->getEdges() & (1 << _edge))
|
||||
{
|
||||
MapGetObstructionErrorText(tileElement, res);
|
||||
return res;
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace OpenRCT2::GameActions
|
||||
// For that, we need the old height, so we can't use the _height variable.
|
||||
auto oldCoords = CoordsXYZ{ _coords, surfaceElement->getBaseZ() };
|
||||
auto* pathElement = MapGetFootpathElement(oldCoords);
|
||||
if (pathElement != nullptr && pathElement->asPath()->IsLevelCrossing(oldCoords))
|
||||
if (pathElement != nullptr && pathElement->asPath()->isLevelCrossing(oldCoords))
|
||||
{
|
||||
return Result(Status::disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone);
|
||||
}
|
||||
|
||||
@@ -494,9 +494,9 @@ namespace OpenRCT2::GameActions
|
||||
if (crossingMode == CreateCrossingMode::trackOverPath && !GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
auto footpathElement = MapGetFootpathElement(mapLoc);
|
||||
if (footpathElement != nullptr && footpathElement->HasAddition())
|
||||
if (footpathElement != nullptr && footpathElement->hasAddition())
|
||||
{
|
||||
footpathElement->SetAddition(0);
|
||||
footpathElement->setAddition(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1116,9 +1116,9 @@ namespace OpenRCT2
|
||||
continue;
|
||||
|
||||
// Check if the footpath has a queue line TV monitor on it
|
||||
if (pathElement->HasAddition() && !pathElement->AdditionIsGhost())
|
||||
if (pathElement->hasAddition() && !pathElement->additionIsGhost())
|
||||
{
|
||||
auto* pathAddEntry = pathElement->GetAdditionEntry();
|
||||
auto* pathAddEntry = pathElement->getAdditionEntry();
|
||||
if (pathAddEntry != nullptr && (pathAddEntry->flags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN))
|
||||
{
|
||||
found = true;
|
||||
@@ -2904,15 +2904,15 @@ namespace OpenRCT2
|
||||
{
|
||||
case TileElementType::path:
|
||||
{
|
||||
if (!tileElement->asPath()->HasAddition())
|
||||
if (!tileElement->asPath()->hasAddition())
|
||||
break;
|
||||
|
||||
auto* pathAddEntry = tileElement->asPath()->GetAdditionEntry();
|
||||
auto* pathAddEntry = tileElement->asPath()->getAdditionEntry();
|
||||
if (pathAddEntry == nullptr)
|
||||
{
|
||||
return PeepThoughtType::none;
|
||||
}
|
||||
if (tileElement->asPath()->AdditionIsGhost())
|
||||
if (tileElement->asPath()->additionIsGhost())
|
||||
break;
|
||||
|
||||
if (pathAddEntry->flags
|
||||
@@ -2921,7 +2921,7 @@ namespace OpenRCT2
|
||||
num_fountains++;
|
||||
break;
|
||||
}
|
||||
if (tileElement->asPath()->IsBroken())
|
||||
if (tileElement->asPath()->isBroken())
|
||||
{
|
||||
num_rubbish++;
|
||||
}
|
||||
@@ -5035,7 +5035,7 @@ namespace OpenRCT2
|
||||
// Find the station track element
|
||||
for (auto* pathElement : TileElementsView<PathElement>(targetLoc))
|
||||
{
|
||||
int16_t height = MapHeightFromSlope(targetLoc, pathElement->GetSlopeDirection(), pathElement->IsSloped());
|
||||
int16_t height = MapHeightFromSlope(targetLoc, pathElement->getSlopeDirection(), pathElement->isSloped());
|
||||
height += pathElement->getBaseZ();
|
||||
|
||||
int16_t z_diff = z - height;
|
||||
@@ -5552,11 +5552,11 @@ namespace OpenRCT2
|
||||
|
||||
int32_t positions_free = 15;
|
||||
|
||||
if (tileElement->asPath()->HasAddition())
|
||||
if (tileElement->asPath()->hasAddition())
|
||||
{
|
||||
if (!tileElement->asPath()->AdditionIsGhost())
|
||||
if (!tileElement->asPath()->additionIsGhost())
|
||||
{
|
||||
auto* pathAddEntry = tileElement->asPath()->GetAdditionEntry();
|
||||
auto* pathAddEntry = tileElement->asPath()->getAdditionEntry();
|
||||
if (pathAddEntry == nullptr)
|
||||
{
|
||||
return;
|
||||
@@ -5567,7 +5567,7 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
|
||||
int32_t edges = (tileElement->asPath()->GetEdges()) ^ 0xF;
|
||||
int32_t edges = (tileElement->asPath()->getEdges()) ^ 0xF;
|
||||
if (edges == 0)
|
||||
return;
|
||||
|
||||
@@ -5941,17 +5941,17 @@ namespace OpenRCT2
|
||||
if (pathElement->getBaseZ() != NextLoc.z)
|
||||
continue;
|
||||
|
||||
if (!pathElement->HasAddition())
|
||||
if (!pathElement->hasAddition())
|
||||
break;
|
||||
|
||||
auto* pathAddEntry = pathElement->GetAdditionEntry();
|
||||
auto* pathAddEntry = pathElement->getAdditionEntry();
|
||||
if (!(pathAddEntry->flags & PATH_ADDITION_FLAG_IS_BIN))
|
||||
break;
|
||||
|
||||
if (pathElement->IsBroken())
|
||||
if (pathElement->isBroken())
|
||||
break;
|
||||
|
||||
if (pathElement->AdditionIsGhost())
|
||||
if (pathElement->additionIsGhost())
|
||||
break;
|
||||
|
||||
foundElement = pathElement;
|
||||
@@ -5968,7 +5968,7 @@ namespace OpenRCT2
|
||||
uint8_t selectedBin = Var37 * 2;
|
||||
|
||||
// This counts down 2 = No rubbish, 0 = full
|
||||
uint8_t spaceLeftInBin = 0x3 & (foundElement->GetAdditionStatus() >> selectedBin);
|
||||
uint8_t spaceLeftInBin = 0x3 & (foundElement->getAdditionStatus() >> selectedBin);
|
||||
uint64_t emptyContainers = getEmptyContainerFlags();
|
||||
|
||||
for (uint8_t curContainer = 0; curContainer < 64; curContainer++)
|
||||
@@ -6002,12 +6002,12 @@ namespace OpenRCT2
|
||||
updateAnimationGroup();
|
||||
}
|
||||
|
||||
uint8_t additionStatus = foundElement->GetAdditionStatus();
|
||||
uint8_t additionStatus = foundElement->getAdditionStatus();
|
||||
// Place new amount in bin by first clearing the value
|
||||
additionStatus &= ~(3 << selectedBin);
|
||||
// Then placing the new value.
|
||||
additionStatus |= spaceLeftInBin << selectedBin;
|
||||
foundElement->SetAdditionStatus(additionStatus);
|
||||
foundElement->setAdditionStatus(additionStatus);
|
||||
|
||||
MapInvalidateTileZoom0({ NextLoc, foundElement->getBaseZ(), foundElement->getClearanceZ() });
|
||||
StateReset();
|
||||
@@ -6053,17 +6053,17 @@ namespace OpenRCT2
|
||||
if (pathElement->getBaseZ() != loc.z)
|
||||
continue;
|
||||
|
||||
if (!pathElement->HasAddition())
|
||||
if (!pathElement->hasAddition())
|
||||
continue;
|
||||
|
||||
auto* pathAddEntry = pathElement->GetAdditionEntry();
|
||||
auto* pathAddEntry = pathElement->getAdditionEntry();
|
||||
if (pathAddEntry == nullptr || !(pathAddEntry->flags & PATH_ADDITION_FLAG_IS_BENCH))
|
||||
continue;
|
||||
|
||||
if (pathElement->IsBroken())
|
||||
if (pathElement->isBroken())
|
||||
continue;
|
||||
|
||||
if (pathElement->AdditionIsGhost())
|
||||
if (pathElement->additionIsGhost())
|
||||
continue;
|
||||
|
||||
return pathElement;
|
||||
@@ -6086,7 +6086,7 @@ namespace OpenRCT2
|
||||
if (pathElement == nullptr)
|
||||
return false;
|
||||
|
||||
int32_t edges = pathElement->GetEdges() ^ 0xF;
|
||||
int32_t edges = pathElement->getEdges() ^ 0xF;
|
||||
if (edges == 0)
|
||||
return false;
|
||||
uint8_t chosen_edge = ScenarioRand() & 0x3;
|
||||
@@ -6142,17 +6142,17 @@ namespace OpenRCT2
|
||||
if (pathElement->getBaseZ() != loc.z)
|
||||
continue;
|
||||
|
||||
if (!pathElement->HasAddition())
|
||||
if (!pathElement->hasAddition())
|
||||
continue;
|
||||
|
||||
auto* pathAddEntry = pathElement->GetAdditionEntry();
|
||||
auto* pathAddEntry = pathElement->getAdditionEntry();
|
||||
if (pathAddEntry == nullptr || !(pathAddEntry->flags & PATH_ADDITION_FLAG_IS_BIN))
|
||||
continue;
|
||||
|
||||
if (pathElement->IsBroken())
|
||||
if (pathElement->isBroken())
|
||||
continue;
|
||||
|
||||
if (pathElement->AdditionIsGhost())
|
||||
if (pathElement->additionIsGhost())
|
||||
continue;
|
||||
|
||||
return pathElement;
|
||||
@@ -6174,14 +6174,14 @@ namespace OpenRCT2
|
||||
if (pathElement == nullptr)
|
||||
return false;
|
||||
|
||||
int32_t edges = (pathElement->GetEdges()) ^ 0xF;
|
||||
int32_t edges = (pathElement->getEdges()) ^ 0xF;
|
||||
if (edges == 0)
|
||||
return false;
|
||||
|
||||
uint8_t chosen_edge = ScenarioRand() & 0x3;
|
||||
|
||||
// Note: Bin quantity is inverted 0 = full, 3 = empty
|
||||
uint8_t bin_quantities = pathElement->GetAdditionStatus();
|
||||
uint8_t bin_quantities = pathElement->getAdditionStatus();
|
||||
|
||||
// Rotate the bin to the correct edge. Makes it easier for next calc.
|
||||
bin_quantities = Numerics::ror8(Numerics::ror8(bin_quantities, chosen_edge), chosen_edge);
|
||||
@@ -6220,17 +6220,17 @@ namespace OpenRCT2
|
||||
if (pathElement->getBaseZ() != loc.z)
|
||||
continue;
|
||||
|
||||
if (!pathElement->HasAddition())
|
||||
if (!pathElement->hasAddition())
|
||||
continue;
|
||||
|
||||
auto* pathAddEntry = pathElement->GetAdditionEntry();
|
||||
auto* pathAddEntry = pathElement->getAdditionEntry();
|
||||
if (pathAddEntry == nullptr || !(pathAddEntry->flags & PATH_ADDITION_FLAG_BREAKABLE))
|
||||
continue;
|
||||
|
||||
if (pathElement->IsBroken())
|
||||
if (pathElement->isBroken())
|
||||
continue;
|
||||
|
||||
if (pathElement->AdditionIsGhost())
|
||||
if (pathElement->additionIsGhost())
|
||||
continue;
|
||||
|
||||
return pathElement;
|
||||
@@ -6271,7 +6271,7 @@ namespace OpenRCT2
|
||||
if (tileElement == nullptr)
|
||||
return;
|
||||
|
||||
int32_t edges = tileElement->GetEdges();
|
||||
int32_t edges = tileElement->getEdges();
|
||||
if (edges == 0xF)
|
||||
return;
|
||||
|
||||
@@ -6302,7 +6302,7 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
|
||||
tileElement->SetIsBroken(true);
|
||||
tileElement->setIsBroken(true);
|
||||
|
||||
MapInvalidateTileZoom1({ guest.NextLoc, tileElement->getBaseZ(), tileElement->getBaseZ() + 32 });
|
||||
|
||||
|
||||
@@ -264,12 +264,12 @@ namespace OpenRCT2
|
||||
continue;
|
||||
if (tileElement->getBaseZ() != newLoc.z)
|
||||
continue;
|
||||
if (tileElement->asPath()->AdditionIsGhost())
|
||||
if (tileElement->asPath()->additionIsGhost())
|
||||
continue;
|
||||
if (!tileElement->asPath()->HasAddition())
|
||||
if (!tileElement->asPath()->hasAddition())
|
||||
continue;
|
||||
|
||||
auto* pathAdditionEntry = tileElement->asPath()->GetAdditionEntry();
|
||||
auto* pathAdditionEntry = tileElement->asPath()->getAdditionEntry();
|
||||
if (pathAdditionEntry != nullptr && pathAdditionEntry->flags & pathAdditionFlagMask)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRCT2
|
||||
continue;
|
||||
|
||||
int32_t pathBaseZ = tileElement->getBaseZ();
|
||||
int32_t pathTopZ = pathBaseZ + (tileElement->asPath()->IsSloped() ? kPathHeightStep : 0);
|
||||
int32_t pathTopZ = pathBaseZ + (tileElement->asPath()->isSloped() ? kPathHeightStep : 0);
|
||||
if (!(pathBaseZ <= mapPos.z && pathTopZ >= mapPos.z))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace OpenRCT2
|
||||
auto pathElement = MapGetFootpathElement(loc);
|
||||
if (pathElement != nullptr)
|
||||
{
|
||||
return pathElement->asPath()->IsLevelCrossing(loc);
|
||||
return pathElement->asPath()->isLevelCrossing(loc);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -805,8 +805,8 @@ namespace OpenRCT2
|
||||
if (tile_element->getType() == TileElementType::path)
|
||||
{
|
||||
int32_t height = MapHeightFromSlope(
|
||||
{ x, y }, tile_element->asPath()->GetSlopeDirection(),
|
||||
tile_element->asPath()->IsSloped())
|
||||
{ x, y }, tile_element->asPath()->getSlopeDirection(),
|
||||
tile_element->asPath()->isSloped())
|
||||
+ tile_element->getBaseZ();
|
||||
|
||||
if (height < z - 1 || height > z + 8)
|
||||
@@ -876,7 +876,7 @@ namespace OpenRCT2
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNextFlags(saved_map->asPath()->GetSlopeDirection(), saved_map->asPath()->IsSloped(), false);
|
||||
SetNextFlags(saved_map->asPath()->getSlopeDirection(), saved_map->asPath()->isSloped(), false);
|
||||
}
|
||||
SetState(PeepState::one);
|
||||
}
|
||||
@@ -1833,12 +1833,12 @@ namespace OpenRCT2
|
||||
if (nextTileElement->getType() != TileElementType::path)
|
||||
continue;
|
||||
|
||||
if (nextTileElement->asPath()->IsQueue())
|
||||
if (nextTileElement->asPath()->isQueue())
|
||||
continue;
|
||||
|
||||
if (nextTileElement->asPath()->IsSloped())
|
||||
if (nextTileElement->asPath()->isSloped())
|
||||
{
|
||||
uint8_t slopeDirection = nextTileElement->asPath()->GetSlopeDirection();
|
||||
uint8_t slopeDirection = nextTileElement->asPath()->getSlopeDirection();
|
||||
if (slopeDirection == entranceDirection)
|
||||
{
|
||||
if (z != nextTileElement->baseHeight)
|
||||
@@ -1935,7 +1935,7 @@ namespace OpenRCT2
|
||||
assert(pathElement != nullptr);
|
||||
|
||||
peep->NextLoc = { coords.ToTileStart(), pathElement->getBaseZ() };
|
||||
peep->SetNextFlags(pathElement->GetSlopeDirection(), pathElement->IsSloped(), false);
|
||||
peep->SetNextFlags(pathElement->getSlopeDirection(), pathElement->isSloped(), false);
|
||||
|
||||
int16_t z = peep->GetZOnSlope(coords.x, coords.y);
|
||||
|
||||
@@ -2094,7 +2094,7 @@ namespace OpenRCT2
|
||||
assert(pathElement != nullptr);
|
||||
|
||||
bool vandalismPresent = false;
|
||||
if (pathElement->HasAddition() && pathElement->IsBroken() && (pathElement->GetEdges()) != 0xF)
|
||||
if (pathElement->hasAddition() && pathElement->isBroken() && (pathElement->getEdges()) != 0xF)
|
||||
{
|
||||
vandalismPresent = true;
|
||||
}
|
||||
@@ -2118,9 +2118,9 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
|
||||
if (guest != nullptr && pathElement->IsQueue())
|
||||
if (guest != nullptr && pathElement->isQueue())
|
||||
{
|
||||
auto rideIndex = pathElement->GetRideIndex();
|
||||
auto rideIndex = pathElement->getRideIndex();
|
||||
if (guest->State == PeepState::queuing)
|
||||
{
|
||||
// Check if this queue is connected to the ride the
|
||||
@@ -2143,10 +2143,10 @@ namespace OpenRCT2
|
||||
{
|
||||
// Peep is not queuing.
|
||||
guest->timeLost = 0;
|
||||
auto stationNum = pathElement->GetStationIndex();
|
||||
auto stationNum = pathElement->getStationIndex();
|
||||
|
||||
if (pathElement->HasQueueBanner()
|
||||
&& pathElement->GetQueueBannerDirection()
|
||||
if (pathElement->hasQueueBanner()
|
||||
&& pathElement->getQueueBannerDirection()
|
||||
== DirectionReverse(guest->PeepDirection) // Ride sign is facing the direction the peep is walking
|
||||
)
|
||||
{
|
||||
|
||||
@@ -132,14 +132,14 @@ namespace OpenRCT2
|
||||
total++;
|
||||
|
||||
/* Check if path has an edge in adjac_dir */
|
||||
if (!(path->asPath()->GetEdges() & (1u << adjac_dir)))
|
||||
if (!(path->asPath()->getEdges() & (1u << adjac_dir)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (path->asPath()->IsSloped())
|
||||
if (path->asPath()->isSloped())
|
||||
{
|
||||
if (path->asPath()->GetSlopeDirection() == adjac_dir)
|
||||
if (path->asPath()->getSlopeDirection() == adjac_dir)
|
||||
{
|
||||
adjacPos.z += kPathHeightStep;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace OpenRCT2
|
||||
pathcount++;
|
||||
}
|
||||
|
||||
if (adjacentPathElement->IsWide())
|
||||
if (adjacentPathElement->isWide())
|
||||
{
|
||||
if (!widefound)
|
||||
{
|
||||
@@ -523,7 +523,7 @@ namespace OpenRCT2
|
||||
if (pathElement == nullptr)
|
||||
return true;
|
||||
|
||||
uint8_t pathDirections = (pathElement->GetEdges() & validDirections) & 0xF;
|
||||
uint8_t pathDirections = (pathElement->getEdges() & validDirections) & 0xF;
|
||||
if (pathDirections == 0)
|
||||
{
|
||||
newDirection = handymanDirectionRandSurface(validDirections);
|
||||
@@ -534,7 +534,7 @@ namespace OpenRCT2
|
||||
if (litterDirection != kInvalidDirection && pathDirections & (1 << litterDirection))
|
||||
{
|
||||
// Check whether path is a queue path and connected to a ride
|
||||
bool connectedQueue = (pathElement->IsQueue() && !pathElement->GetRideIndex().IsNull());
|
||||
bool connectedQueue = (pathElement->isQueue() && !pathElement->getRideIndex().IsNull());
|
||||
// When in a queue path make the probability of following litter much lower (10% instead of 90%)
|
||||
// as handymen often get stuck when there is litter on a normal path next to a queue they are in
|
||||
uint32_t chooseRandomProbability = connectedQueue ? 0xE666 : 0x1999;
|
||||
@@ -676,7 +676,7 @@ namespace OpenRCT2
|
||||
*/
|
||||
Direction Staff::mechanicDirectionPath(uint8_t validDirections, PathElement* pathElement)
|
||||
{
|
||||
uint32_t pathDirections = pathElement->GetEdges();
|
||||
uint32_t pathDirections = pathElement->getEdges();
|
||||
pathDirections &= validDirections;
|
||||
|
||||
if (pathDirections == 0)
|
||||
@@ -792,7 +792,7 @@ namespace OpenRCT2
|
||||
*/
|
||||
Direction Staff::directionPath(uint8_t validDirections, PathElement* pathElement) const
|
||||
{
|
||||
uint32_t pathDirections = pathElement->GetEdges();
|
||||
uint32_t pathDirections = pathElement->getEdges();
|
||||
if (State != PeepState::answering && State != PeepState::headingToInspection)
|
||||
{
|
||||
pathDirections &= validDirections;
|
||||
@@ -1197,22 +1197,22 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
|
||||
if (!tile_element->asPath()->HasAddition())
|
||||
if (!tile_element->asPath()->hasAddition())
|
||||
{
|
||||
StateReset();
|
||||
return;
|
||||
}
|
||||
|
||||
auto* pathAddEntry = tile_element->asPath()->GetAdditionEntry();
|
||||
if (!(pathAddEntry->flags & PATH_ADDITION_FLAG_IS_BIN) || tile_element->asPath()->IsBroken()
|
||||
|| tile_element->asPath()->AdditionIsGhost())
|
||||
auto* pathAddEntry = tile_element->asPath()->getAdditionEntry();
|
||||
if (!(pathAddEntry->flags & PATH_ADDITION_FLAG_IS_BIN) || tile_element->asPath()->isBroken()
|
||||
|| tile_element->asPath()->additionIsGhost())
|
||||
{
|
||||
StateReset();
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t additionStatus = tile_element->asPath()->GetAdditionStatus() | ((3 << Var37) << Var37);
|
||||
tile_element->asPath()->SetAdditionStatus(additionStatus);
|
||||
uint8_t additionStatus = tile_element->asPath()->getAdditionStatus() | ((3 << Var37) << Var37);
|
||||
tile_element->asPath()->setAdditionStatus(additionStatus);
|
||||
|
||||
MapInvalidateTileZoom0({ NextLoc, tile_element->getBaseZ(), tile_element->getClearanceZ() });
|
||||
staffBinsEmptied = AddClamp(staffBinsEmptied, 1u);
|
||||
@@ -1568,23 +1568,23 @@ namespace OpenRCT2
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!tileElement->asPath()->HasAddition())
|
||||
if (!tileElement->asPath()->hasAddition())
|
||||
return false;
|
||||
auto* pathAddEntry = tileElement->asPath()->GetAdditionEntry();
|
||||
auto* pathAddEntry = tileElement->asPath()->getAdditionEntry();
|
||||
if (pathAddEntry == nullptr)
|
||||
return false;
|
||||
|
||||
if (!(pathAddEntry->flags & PATH_ADDITION_FLAG_IS_BIN))
|
||||
return false;
|
||||
|
||||
if (tileElement->asPath()->IsBroken())
|
||||
if (tileElement->asPath()->isBroken())
|
||||
return false;
|
||||
|
||||
if (tileElement->asPath()->AdditionIsGhost())
|
||||
if (tileElement->asPath()->additionIsGhost())
|
||||
return false;
|
||||
|
||||
uint8_t bin_positions = tileElement->asPath()->GetEdges();
|
||||
uint8_t bin_quantity = tileElement->asPath()->GetAdditionStatus();
|
||||
uint8_t bin_positions = tileElement->asPath()->getEdges();
|
||||
uint8_t bin_quantity = tileElement->asPath()->getAdditionStatus();
|
||||
uint8_t chosen_position = 0;
|
||||
|
||||
for (; chosen_position < 4; ++chosen_position)
|
||||
|
||||
@@ -116,12 +116,12 @@ static void PathPaintQueueBanner(
|
||||
{
|
||||
auto imageId = imageTemplate.WithIndex(railings.railingsImage);
|
||||
|
||||
uint8_t direction = pathElement.GetQueueBannerDirection();
|
||||
uint8_t direction = pathElement.getQueueBannerDirection();
|
||||
// Draw ride sign
|
||||
session.InteractionType = ViewportInteractionItem::ride;
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
if (pathElement.GetSlopeDirection() == direction)
|
||||
if (pathElement.getSlopeDirection() == direction)
|
||||
height += kCoordsZStep * 2;
|
||||
}
|
||||
direction += session.CurrentRotation;
|
||||
@@ -142,7 +142,7 @@ static void PathPaintQueueBanner(
|
||||
|
||||
direction--;
|
||||
// If text shown
|
||||
auto ride = GetRide(pathElement.GetRideIndex());
|
||||
auto ride = GetRide(pathElement.getRideIndex());
|
||||
if (direction < 2 && ride != nullptr && !imageTemplate.IsRemap())
|
||||
{
|
||||
uint16_t scrollingMode = railings.scrollingMode;
|
||||
@@ -174,7 +174,7 @@ static void PathPaintSlopedFences(
|
||||
PaintSession& session, const PathElement& pathElement, uint16_t height, ImageId imageId, bool isQueue)
|
||||
{
|
||||
auto queueOffset = isQueue ? 14 : 0;
|
||||
switch ((pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections)
|
||||
switch ((pathElement.getSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections)
|
||||
{
|
||||
case 0:
|
||||
PaintAddImageAsParent(
|
||||
@@ -209,7 +209,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
{
|
||||
auto imageId = imageTemplate.WithIndex(railings.railingsImage);
|
||||
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
PathPaintSlopedFences(session, pathElement, height, imageId, true);
|
||||
}
|
||||
@@ -259,7 +259,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
session, imageId.WithIndexOffset(26), { 0, 0, height }, { { 27, 27, height + 2 }, { 4, 4, 7 } });
|
||||
break;
|
||||
case 0b0111:
|
||||
if (pathElement.HasJunctionRailings())
|
||||
if (pathElement.hasJunctionRailings())
|
||||
{
|
||||
PaintAddImageAsParent(
|
||||
session, imageId.WithIndexOffset(15), { 0, 4, height }, { { 0, 4, height + 2 }, { 32, 1, 7 } });
|
||||
@@ -290,7 +290,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
session, imageId.WithIndexOffset(14), { 28, 0, height }, { { 27, 0, height + 2 }, { 1, 32, 7 } });
|
||||
break;
|
||||
case 0b1011:
|
||||
if (pathElement.HasJunctionRailings())
|
||||
if (pathElement.hasJunctionRailings())
|
||||
{
|
||||
PaintAddImageAsParent(
|
||||
session, imageId.WithIndexOffset(14), { 28, 0, height }, { { 27, 0, height + 2 }, { 1, 32, 7 } });
|
||||
@@ -309,7 +309,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
session, imageId.WithIndexOffset(27), { 0, 0, height }, { { 27, 0, height + 2 }, { 4, 4, 7 } });
|
||||
break;
|
||||
case 0b1101:
|
||||
if (pathElement.HasJunctionRailings())
|
||||
if (pathElement.hasJunctionRailings())
|
||||
{
|
||||
PaintAddImageAsParent(
|
||||
session, imageId.WithIndexOffset(15), { 0, 28, height }, { { 0, 27, height + 2 }, { 32, 1, 7 } });
|
||||
@@ -320,7 +320,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
}
|
||||
break;
|
||||
case 0b1110:
|
||||
if (pathElement.HasJunctionRailings())
|
||||
if (pathElement.hasJunctionRailings())
|
||||
{
|
||||
PaintAddImageAsParent(
|
||||
session, imageId.WithIndexOffset(14), { 4, 0, height }, { { 4, 0, height + 2 }, { 1, 32, 7 } });
|
||||
@@ -331,7 +331,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
}
|
||||
break;
|
||||
case 0b1111:
|
||||
if (pathElement.HasJunctionRailings())
|
||||
if (pathElement.hasJunctionRailings())
|
||||
{
|
||||
PaintAddImageAsParent(
|
||||
session, imageId.WithIndexOffset(24), { 0, 0, height }, { { 0, 0, height + 2 }, { 4, 4, 7 } });
|
||||
@@ -345,7 +345,7 @@ static void PathPaintFencesAndQueueBannersQueue(
|
||||
}
|
||||
}
|
||||
|
||||
if (pathElement.HasQueueBanner() && !(railings.flags & RAILING_ENTRY_FLAG_NO_QUEUE_BANNER))
|
||||
if (pathElement.hasQueueBanner() && !(railings.flags & RAILING_ENTRY_FLAG_NO_QUEUE_BANNER))
|
||||
{
|
||||
PathPaintQueueBanner(session, pathElement, height, railings, imageTemplate);
|
||||
}
|
||||
@@ -366,7 +366,7 @@ static void PathPaintFencesAndQueueBannersNonQueue(
|
||||
}
|
||||
|
||||
auto slopeRailingsSupported = !(pathPaintInfo.surface.flags & FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS);
|
||||
if ((hasSupports || slopeRailingsSupported) && pathElement.IsSloped())
|
||||
if ((hasSupports || slopeRailingsSupported) && pathElement.isSloped())
|
||||
{
|
||||
PathPaintSlopedFences(session, pathElement, height, imageId, false);
|
||||
}
|
||||
@@ -557,7 +557,7 @@ static void PathPaintFencesAndQueueBanners(
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
if (pathElement.IsQueue())
|
||||
if (pathElement.isQueue())
|
||||
{
|
||||
PathPaintFencesAndQueueBannersQueue(
|
||||
session, pathElement, height, connectedEdges, hasSupports, pathPaintInfo.railings, imageTemplate);
|
||||
@@ -598,7 +598,7 @@ static void PathPaintFencesAdditionsTunnels(
|
||||
{
|
||||
if (!gTrackDesignSaveMode)
|
||||
{
|
||||
if (pathElement.HasAddition())
|
||||
if (pathElement.hasAddition())
|
||||
{
|
||||
paintPathAddition(session, pathElement, height, sceneryImageTemplate);
|
||||
}
|
||||
@@ -610,8 +610,8 @@ static void PathPaintFencesAdditionsTunnels(
|
||||
}
|
||||
|
||||
// This is about tunnel drawing
|
||||
uint8_t direction = (pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections;
|
||||
bool sloped = pathElement.IsSloped();
|
||||
uint8_t direction = (pathElement.getSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections;
|
||||
bool sloped = pathElement.isSloped();
|
||||
|
||||
if (connectedEdges & EDGE_SE)
|
||||
{
|
||||
@@ -665,16 +665,16 @@ static bool ShouldDrawSupports(PaintSession& session, const PathElement& pathEl,
|
||||
}
|
||||
else if (surface->getBaseZ() != height)
|
||||
{
|
||||
const auto* surfaceEntry = pathEl.GetSurfaceEntry();
|
||||
const auto* surfaceEntry = pathEl.getSurfaceEntry();
|
||||
const bool showUndergroundRailings = surfaceEntry == nullptr
|
||||
|| !(surfaceEntry->Flags & FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS);
|
||||
if (surface->getBaseZ() < height || showUndergroundRailings)
|
||||
return true;
|
||||
}
|
||||
else if (pathEl.IsSloped())
|
||||
else if (pathEl.isSloped())
|
||||
{
|
||||
// Diagonal path
|
||||
if (surface->GetSlope() != kPathSlopeToLandSlope[pathEl.GetSlopeDirection()])
|
||||
if (surface->GetSlope() != kPathSlopeToLandSlope[pathEl.getSlopeDirection()])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -693,9 +693,9 @@ static void PaintPatrolAreas(PaintSession& session, const PathElement& pathEl)
|
||||
{
|
||||
uint32_t baseImageIndex = SPR_TERRAIN_STAFF;
|
||||
auto patrolAreaBaseZ = pathEl.getBaseZ();
|
||||
if (pathEl.IsSloped())
|
||||
if (pathEl.isSloped())
|
||||
{
|
||||
baseImageIndex = SPR_TERRAIN_STAFF_SLOPED + ((pathEl.GetSlopeDirection() + session.CurrentRotation) & 3);
|
||||
baseImageIndex = SPR_TERRAIN_STAFF_SLOPED + ((pathEl.getSlopeDirection() + session.CurrentRotation) & 3);
|
||||
patrolAreaBaseZ += 16;
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ static void PaintHeightMarkers(PaintSession& session, const PathElement& pathEl)
|
||||
if (PaintShouldShowHeightMarkers(session, VIEWPORT_FLAG_PATH_HEIGHTS))
|
||||
{
|
||||
uint16_t heightMarkerBaseZ = pathEl.getBaseZ() + 3;
|
||||
if (pathEl.IsSloped())
|
||||
if (pathEl.isSloped())
|
||||
{
|
||||
heightMarkerBaseZ += 8;
|
||||
}
|
||||
@@ -738,7 +738,7 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl
|
||||
if (gTrackDesignSaveMode)
|
||||
{
|
||||
// Do not display queues for other rides
|
||||
if (tileElement.IsQueue() && tileElement.GetRideIndex() != gTrackDesignSaveRideIndex)
|
||||
if (tileElement.isQueue() && tileElement.getRideIndex() != gTrackDesignSaveRideIndex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -754,7 +754,7 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl
|
||||
imageTemplate = ImageId().WithRemap(FilterPaletteID::palette46);
|
||||
}
|
||||
|
||||
if (tileElement.AdditionIsGhost())
|
||||
if (tileElement.additionIsGhost())
|
||||
{
|
||||
sceneryImageTemplate = ImageId().WithRemap(FilterPaletteID::paletteGhost);
|
||||
}
|
||||
@@ -771,13 +771,13 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl
|
||||
}
|
||||
|
||||
// For debugging purpose, show blocked tiles with a colour
|
||||
if (gPaintBlockedTiles && tileElement.IsBlockedByVehicle())
|
||||
if (gPaintBlockedTiles && tileElement.isBlockedByVehicle())
|
||||
{
|
||||
imageTemplate = ImageId().WithRemap(FilterPaletteID::palette46);
|
||||
}
|
||||
|
||||
// Draw wide flags as ghosts, leaving only the "walkable" paths to be drawn normally
|
||||
if (gPaintWidePathsAsGhost && tileElement.IsWide())
|
||||
if (gPaintWidePathsAsGhost && tileElement.isWide())
|
||||
{
|
||||
imageTemplate = ImageId().WithRemap(FilterPaletteID::paletteGhost);
|
||||
}
|
||||
@@ -787,8 +787,8 @@ void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileEl
|
||||
|
||||
auto hasSupports = ShouldDrawSupports(session, tileElement, height);
|
||||
|
||||
const auto* const surfaceDescriptor = tileElement.GetSurfaceDescriptor();
|
||||
const auto* const railingsDescriptor = tileElement.GetRailingsDescriptor();
|
||||
const auto* const surfaceDescriptor = tileElement.getSurfaceDescriptor();
|
||||
const auto* const railingsDescriptor = tileElement.getRailingsDescriptor();
|
||||
if (surfaceDescriptor == nullptr || railingsDescriptor == nullptr)
|
||||
{
|
||||
return;
|
||||
@@ -811,11 +811,11 @@ static std::pair<uint8_t, uint8_t> PathPaintGetRotatedEdgesAndCorners(
|
||||
const PaintSession& session, const PathElement& pathElement)
|
||||
{
|
||||
// Rol edges around rotation
|
||||
uint8_t edges = ((pathElement.GetEdges() << session.CurrentRotation) & 0xF)
|
||||
| (((pathElement.GetEdges()) << session.CurrentRotation) >> 4);
|
||||
uint8_t edges = ((pathElement.getEdges() << session.CurrentRotation) & 0xF)
|
||||
| (((pathElement.getEdges()) << session.CurrentRotation) >> 4);
|
||||
|
||||
uint8_t corners = (((pathElement.GetCorners()) << session.CurrentRotation) & 0xF)
|
||||
| (((pathElement.GetCorners()) << session.CurrentRotation) >> 4);
|
||||
uint8_t corners = (((pathElement.getCorners()) << session.CurrentRotation) & 0xF)
|
||||
| (((pathElement.getCorners()) << session.CurrentRotation) >> 4);
|
||||
|
||||
return std::make_pair(edges, corners);
|
||||
}
|
||||
@@ -825,9 +825,9 @@ static ImageIndex PathPaintGetBaseImage(
|
||||
const uint8_t rotatedEdgesAndCorners)
|
||||
{
|
||||
ImageIndex surfaceBaseImageIndex = pathPaintInfo.surface.image;
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
auto directionOffset = (pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections;
|
||||
auto directionOffset = (pathElement.getSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections;
|
||||
surfaceBaseImageIndex += 16 + directionOffset;
|
||||
}
|
||||
else
|
||||
@@ -868,20 +868,20 @@ static void PathPaintSegmentSupportHeight(
|
||||
PaintSession& session, const PathElement& pathElement, int32_t height, uint8_t edges, bool hasSupports)
|
||||
{
|
||||
height += 32;
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
height += 16;
|
||||
}
|
||||
|
||||
PaintUtilSetGeneralSupportHeight(session, height);
|
||||
|
||||
if (pathElement.IsQueue() || (pathElement.GetEdgesAndCorners() != 0xFF && hasSupports))
|
||||
if (pathElement.isQueue() || (pathElement.getEdgesAndCorners() != 0xFF && hasSupports))
|
||||
{
|
||||
PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pathElement.GetEdgesAndCorners() == 0xFF)
|
||||
if (pathElement.getEdgesAndCorners() == 0xFF)
|
||||
{
|
||||
PaintUtilSetSegmentSupportHeight(
|
||||
session,
|
||||
@@ -920,7 +920,7 @@ static void PathPaintBoxSupport(
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
auto [edges, corners] = PathPaintGetRotatedEdgesAndCorners(session, pathElement);
|
||||
const uint8_t edgesAndCorners = pathElement.IsQueue() ? edges : edges | (corners << 4);
|
||||
const uint8_t edgesAndCorners = pathElement.isQueue() ? edges : edges | (corners << 4);
|
||||
|
||||
const auto surfaceBaseImageIndex = PathPaintGetBaseImage(session, pathElement, pathPaintInfo, edgesAndCorners);
|
||||
auto boundbox = PathPaintGetBoundbox(session, height, edges);
|
||||
@@ -933,9 +933,9 @@ static void PathPaintBoxSupport(
|
||||
else
|
||||
{
|
||||
ImageIndex bridgeBaseImageIndex;
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
auto directionOffset = (pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections;
|
||||
auto directionOffset = (pathElement.getSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections;
|
||||
bridgeBaseImageIndex = pathPaintInfo.railings.bridgeImage + 51 + directionOffset;
|
||||
}
|
||||
else
|
||||
@@ -945,7 +945,7 @@ static void PathPaintBoxSupport(
|
||||
|
||||
PaintAddImageAsParent(session, imageTemplate.WithIndex(bridgeBaseImageIndex), { 0, 0, height }, boundbox);
|
||||
|
||||
if (pathElement.IsQueue() || (pathPaintInfo.railings.flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
|
||||
if (pathElement.isQueue() || (pathPaintInfo.railings.flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
|
||||
{
|
||||
PaintAddImageAsChild(session, imageTemplate.WithIndex(surfaceBaseImageIndex), { 0, 0, height }, boundbox);
|
||||
}
|
||||
@@ -955,13 +955,13 @@ static void PathPaintBoxSupport(
|
||||
session, pathElement, edgesAndCorners, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports);
|
||||
|
||||
Direction slopeDirection{};
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
slopeDirection = ((pathElement.GetSlopeDirection() + session.CurrentRotation) & 0x3);
|
||||
slopeDirection = ((pathElement.getSlopeDirection() + session.CurrentRotation) & 0x3);
|
||||
}
|
||||
|
||||
PathBoxSupportsPaintSetup(
|
||||
session, PathSupportOrientation[edges], pathElement.IsSloped(), slopeDirection, height, imageTemplate,
|
||||
session, PathSupportOrientation[edges], pathElement.isSloped(), slopeDirection, height, imageTemplate,
|
||||
pathPaintInfo.railings);
|
||||
|
||||
PathPaintSegmentSupportHeight(session, pathElement, height, edges, hasSupports);
|
||||
@@ -974,7 +974,7 @@ static void PathPaintPoleSupport(
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
auto [edges, corners] = PathPaintGetRotatedEdgesAndCorners(session, pathElement);
|
||||
const uint8_t edgesAndCorners = pathElement.IsQueue() ? edges : edges | (corners << 4);
|
||||
const uint8_t edgesAndCorners = pathElement.isQueue() ? edges : edges | (corners << 4);
|
||||
|
||||
const auto surfaceBaseImageIndex = PathPaintGetBaseImage(session, pathElement, pathPaintInfo, edgesAndCorners);
|
||||
auto boundbox = PathPaintGetBoundbox(session, height, edges);
|
||||
@@ -988,9 +988,9 @@ static void PathPaintPoleSupport(
|
||||
else
|
||||
{
|
||||
ImageIndex bridgeBaseImageIndex;
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
bridgeBaseImageIndex = ((pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections)
|
||||
bridgeBaseImageIndex = ((pathElement.getSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections)
|
||||
+ pathPaintInfo.railings.bridgeImage + 16;
|
||||
}
|
||||
else
|
||||
@@ -1000,7 +1000,7 @@ static void PathPaintPoleSupport(
|
||||
|
||||
PaintAddImageAsParent(session, imageTemplate.WithIndex(bridgeBaseImageIndex), { 0, 0, height }, boundbox);
|
||||
|
||||
if (pathElement.IsQueue() || (pathPaintInfo.railings.flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
|
||||
if (pathElement.isQueue() || (pathPaintInfo.railings.flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
|
||||
{
|
||||
PaintAddImageAsChild(session, imageTemplate.WithIndex(surfaceBaseImageIndex), { 0, 0, height }, boundbox);
|
||||
}
|
||||
@@ -1028,7 +1028,7 @@ static void PathPaintPoleSupport(
|
||||
imageTemplate = ImageId().WithPrimary(supportColour);
|
||||
}
|
||||
PathPoleSupportsPaintSetup(
|
||||
session, supports[i], pathElement.IsSloped(), height, imageTemplate, pathPaintInfo.railings);
|
||||
session, supports[i], pathElement.isSloped(), height, imageTemplate, pathPaintInfo.railings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ static void PathAdditionLightsPaint(
|
||||
PaintSession& session, const PathAdditionEntry& pathAdditionEntry, const PathElement& pathElement, int32_t height,
|
||||
uint8_t edges, ImageId imageTemplate)
|
||||
{
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
height += 8;
|
||||
|
||||
auto isBroken = pathElement.IsBroken();
|
||||
auto isBroken = pathElement.isBroken();
|
||||
if (edges & EDGE_NE)
|
||||
{
|
||||
auto imageIndex = GetFootpathLampImage(pathAdditionEntry, EDGE_NE, isBroken);
|
||||
@@ -106,13 +106,13 @@ static bool IsBinFull(PaintSession& session, const PathElement& pathElement, edg
|
||||
switch (edge)
|
||||
{
|
||||
case EDGE_NE:
|
||||
return !(pathElement.GetAdditionStatus() & Numerics::ror8(0x03, (2 * session.CurrentRotation)));
|
||||
return !(pathElement.getAdditionStatus() & Numerics::ror8(0x03, (2 * session.CurrentRotation)));
|
||||
case EDGE_SE:
|
||||
return !(pathElement.GetAdditionStatus() & Numerics::ror8(0x0C, (2 * session.CurrentRotation)));
|
||||
return !(pathElement.getAdditionStatus() & Numerics::ror8(0x0C, (2 * session.CurrentRotation)));
|
||||
case EDGE_SW:
|
||||
return !(pathElement.GetAdditionStatus() & Numerics::ror8(0x30, (2 * session.CurrentRotation)));
|
||||
return !(pathElement.getAdditionStatus() & Numerics::ror8(0x30, (2 * session.CurrentRotation)));
|
||||
case EDGE_NW:
|
||||
return !(pathElement.GetAdditionStatus() & Numerics::ror8(0xC0, (2 * session.CurrentRotation)));
|
||||
return !(pathElement.getAdditionStatus() & Numerics::ror8(0xC0, (2 * session.CurrentRotation)));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -123,10 +123,10 @@ static void PathAdditionBinsPaint(
|
||||
PaintSession& session, const PathAdditionEntry& pathAdditionEntry, const PathElement& pathElement, int32_t height,
|
||||
uint8_t edges, ImageId imageTemplate)
|
||||
{
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
height += 8;
|
||||
|
||||
bool binsAreVandalised = pathElement.IsBroken();
|
||||
bool binsAreVandalised = pathElement.isBroken();
|
||||
auto highlightPathIssues = (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) != 0;
|
||||
|
||||
if (edges & EDGE_NE)
|
||||
@@ -168,7 +168,7 @@ static void PathAdditionBenchesPaint(
|
||||
PaintSession& session, const PathAdditionEntry& pathAdditionEntry, const PathElement& pathElement, int32_t height,
|
||||
uint8_t edges, ImageId imageTemplate)
|
||||
{
|
||||
auto isBroken = pathElement.IsBroken();
|
||||
auto isBroken = pathElement.isBroken();
|
||||
if (edges & EDGE_NE)
|
||||
{
|
||||
auto imageIndex = GetFootpathBenchImage(pathAdditionEntry, EDGE_NE, isBroken);
|
||||
@@ -228,7 +228,7 @@ inline bool PathAdditionIsVisible(uint32_t viewFlags, const PathAdditionEntry& p
|
||||
void paintPathAddition(PaintSession& session, const PathElement& pathElement, uint16_t height, ImageId sceneryImageTemplate)
|
||||
{
|
||||
// Path additions get drawn on edges that are not connected, so we need to flip them.
|
||||
const auto edges = pathElement.GetEdges() ^ 0b1111;
|
||||
const auto edges = pathElement.getEdges() ^ 0b1111;
|
||||
const auto rotatedEdges = ((edges << session.CurrentRotation) & 0xF) | (((edges) << session.CurrentRotation) >> 4);
|
||||
|
||||
session.InteractionType = ViewportInteractionItem::pathAddition;
|
||||
@@ -237,9 +237,9 @@ void paintPathAddition(PaintSession& session, const PathElement& pathElement, ui
|
||||
session.InteractionType = ViewportInteractionItem::none;
|
||||
}
|
||||
|
||||
auto* pathAddEntry = pathElement.GetAdditionEntry();
|
||||
auto* pathAddEntry = pathElement.getAdditionEntry();
|
||||
// Can be null if the object is not loaded.
|
||||
if (pathAddEntry == nullptr || !PathAdditionIsVisible(session.ViewFlags, *pathAddEntry, pathElement.IsBroken()))
|
||||
if (pathAddEntry == nullptr || !PathAdditionIsVisible(session.ViewFlags, *pathAddEntry, pathElement.isBroken()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -275,24 +275,24 @@ void PaintLampLightEffects(PaintSession& session, const PathElement& pathEl, uin
|
||||
|
||||
if (LightFx::IsAvailable())
|
||||
{
|
||||
if (pathEl.HasAddition() && !(pathEl.IsBroken()))
|
||||
if (pathEl.hasAddition() && !(pathEl.isBroken()))
|
||||
{
|
||||
auto* pathAddEntry = pathEl.GetAdditionEntry();
|
||||
auto* pathAddEntry = pathEl.getAdditionEntry();
|
||||
if (pathAddEntry != nullptr && pathAddEntry->flags & PATH_ADDITION_FLAG_LAMP)
|
||||
{
|
||||
if (!(pathEl.GetEdges() & EDGE_NE))
|
||||
if (!(pathEl.getEdges() & EDGE_NE))
|
||||
{
|
||||
LightFx::Add3DLightMagicFromDrawingTile(session.MapPosition, -16, 0, height + 23, LightType::lantern3);
|
||||
}
|
||||
if (!(pathEl.GetEdges() & EDGE_SE))
|
||||
if (!(pathEl.getEdges() & EDGE_SE))
|
||||
{
|
||||
LightFx::Add3DLightMagicFromDrawingTile(session.MapPosition, 0, 16, height + 23, LightType::lantern3);
|
||||
}
|
||||
if (!(pathEl.GetEdges() & EDGE_SW))
|
||||
if (!(pathEl.getEdges() & EDGE_SW))
|
||||
{
|
||||
LightFx::Add3DLightMagicFromDrawingTile(session.MapPosition, 16, 0, height + 23, LightType::lantern3);
|
||||
}
|
||||
if (!(pathEl.GetEdges() & EDGE_NW))
|
||||
if (!(pathEl.getEdges() & EDGE_NW))
|
||||
{
|
||||
LightFx::Add3DLightMagicFromDrawingTile(session.MapPosition, 0, -16, height + 23, LightType::lantern3);
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ static ImageId MiniatureRailwayTrackToGroovedIndent(const TileElement* path, uin
|
||||
|
||||
uint32_t imageIdAlt = SPR_TRACKS_MINIATURE_RAILWAY_GROOVED_SW_NE;
|
||||
|
||||
uint8_t correctedEdges = path->asPath()->GetEdges();
|
||||
uint8_t correctedEdges = path->asPath()->getEdges();
|
||||
correctedEdges |= correctedEdges << 4;
|
||||
correctedEdges >>= 4 - rotation;
|
||||
correctedEdges &= 0x0F;
|
||||
|
||||
@@ -1211,17 +1211,17 @@ namespace OpenRCT2
|
||||
if (it.element->getType() == TileElementType::path)
|
||||
{
|
||||
auto* pathElement = it.element->asPath();
|
||||
if (pathElement->HasLegacyPathEntry())
|
||||
if (pathElement->hasLegacyPathEntry())
|
||||
{
|
||||
auto pathEntryIndex = pathElement->GetLegacyPathEntryIndex();
|
||||
auto pathEntryIndex = pathElement->getLegacyPathEntryIndex();
|
||||
if (pathToRailingsMap[pathEntryIndex] != kObjectEntryIndexNull)
|
||||
{
|
||||
if (pathElement->IsQueue())
|
||||
pathElement->SetSurfaceEntryIndex(pathToQueueSurfaceMap[pathEntryIndex]);
|
||||
if (pathElement->isQueue())
|
||||
pathElement->setSurfaceEntryIndex(pathToQueueSurfaceMap[pathEntryIndex]);
|
||||
else
|
||||
pathElement->SetSurfaceEntryIndex(pathToSurfaceMap[pathEntryIndex]);
|
||||
pathElement->setSurfaceEntryIndex(pathToSurfaceMap[pathEntryIndex]);
|
||||
|
||||
pathElement->SetRailingsEntryIndex(pathToRailingsMap[pathEntryIndex]);
|
||||
pathElement->setRailingsEntryIndex(pathToRailingsMap[pathEntryIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace OpenRCT2::PathFinding
|
||||
*/
|
||||
static int32_t PathGetPermittedEdges(bool ignoreBanners, const PathElement* pathElement)
|
||||
{
|
||||
return BannerClearPathEdges(ignoreBanners, pathElement, pathElement->GetEdgesAndCorners()) & 0x0F;
|
||||
return BannerClearPathEdges(ignoreBanners, pathElement, pathElement->getEdgesAndCorners()) & 0x0F;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,9 +341,9 @@ namespace OpenRCT2::PathFinding
|
||||
static PathSearchResult FootpathElementNextInDirection(
|
||||
TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection)
|
||||
{
|
||||
if (pathElement->IsSloped())
|
||||
if (pathElement->isSloped())
|
||||
{
|
||||
if (pathElement->GetSlopeDirection() == chosenDirection)
|
||||
if (pathElement->getSlopeDirection() == chosenDirection)
|
||||
{
|
||||
loc.z += 2;
|
||||
}
|
||||
@@ -362,10 +362,10 @@ namespace OpenRCT2::PathFinding
|
||||
const auto* nextPathElement = nextTileElement->asPath();
|
||||
if (!FootpathIsZAndDirectionValid(*nextPathElement, loc.z, chosenDirection))
|
||||
continue;
|
||||
if (nextPathElement->IsWide())
|
||||
if (nextPathElement->isWide())
|
||||
return PathSearchResult::wide;
|
||||
// Only queue tiles that are connected to a ride are returned as ride queues.
|
||||
if (nextPathElement->IsQueue() && !nextPathElement->GetRideIndex().IsNull())
|
||||
if (nextPathElement->isQueue() && !nextPathElement->getRideIndex().IsNull())
|
||||
return PathSearchResult::rideQueue;
|
||||
|
||||
return PathSearchResult::other;
|
||||
@@ -451,7 +451,7 @@ namespace OpenRCT2::PathFinding
|
||||
const auto* pathElement = tileElement->asPath();
|
||||
if (!FootpathIsZAndDirectionValid(*pathElement, loc.z, chosenDirection))
|
||||
continue;
|
||||
if (tileElement->asPath()->IsWide())
|
||||
if (tileElement->asPath()->isWide())
|
||||
return PathSearchResult::wide;
|
||||
|
||||
uint8_t edges = PathGetPermittedEdges(ignoreBanners, pathElement);
|
||||
@@ -467,9 +467,9 @@ namespace OpenRCT2::PathFinding
|
||||
if (edges != 0)
|
||||
return PathSearchResult::junction;
|
||||
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (tileElement->asPath()->GetSlopeDirection() == dir)
|
||||
if (tileElement->asPath()->getSlopeDirection() == dir)
|
||||
{
|
||||
loc.z += 2;
|
||||
}
|
||||
@@ -512,9 +512,9 @@ namespace OpenRCT2::PathFinding
|
||||
static PathSearchResult FootpathElementDestinationInDirection(
|
||||
TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection, RideId* outRideIndex)
|
||||
{
|
||||
if (pathElement->IsSloped())
|
||||
if (pathElement->isSloped())
|
||||
{
|
||||
if (pathElement->GetSlopeDirection() == chosenDirection)
|
||||
if (pathElement->getSlopeDirection() == chosenDirection)
|
||||
{
|
||||
loc.z += 2;
|
||||
}
|
||||
@@ -590,7 +590,7 @@ namespace OpenRCT2::PathFinding
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
uint32_t edges = path->GetEdges();
|
||||
uint32_t edges = path->getEdges();
|
||||
|
||||
int32_t testEdge = Numerics::bitScanForward(edges);
|
||||
if (testEdge == -1)
|
||||
@@ -719,7 +719,7 @@ namespace OpenRCT2::PathFinding
|
||||
{
|
||||
PathSearchResult searchResult = PathSearchResult::failed;
|
||||
|
||||
bool currentElementIsWide = currentTileElement->asPath()->IsWide();
|
||||
bool currentElementIsWide = currentTileElement->asPath()->isWide();
|
||||
if (currentElementIsWide)
|
||||
{
|
||||
const Staff* staff = peep.as<Staff>();
|
||||
@@ -847,7 +847,7 @@ namespace OpenRCT2::PathFinding
|
||||
// Path may be sloped, so set z to path base height.
|
||||
loc.z = tileElement->baseHeight;
|
||||
|
||||
if (pathElement->IsWide())
|
||||
if (pathElement->isWide())
|
||||
{
|
||||
/* Check if staff can ignore this wide flag. */
|
||||
if (staff == nullptr || !staff->canIgnoreWideFlag(loc.ToCoordsXYZ(), tileElement))
|
||||
@@ -860,7 +860,7 @@ namespace OpenRCT2::PathFinding
|
||||
|
||||
searchResult = PathSearchResult::thin;
|
||||
|
||||
uint8_t numEdges = std::popcount(pathElement->GetEdges());
|
||||
uint8_t numEdges = std::popcount(pathElement->getEdges());
|
||||
|
||||
if (numEdges < 2)
|
||||
{
|
||||
@@ -872,14 +872,14 @@ namespace OpenRCT2::PathFinding
|
||||
}
|
||||
else
|
||||
{ // numEdges == 2
|
||||
if (pathElement->IsQueue() && pathElement->GetRideIndex() != state.queueRideIndex)
|
||||
if (pathElement->isQueue() && pathElement->getRideIndex() != state.queueRideIndex)
|
||||
{
|
||||
if (state.ignoreForeignQueues && !pathElement->GetRideIndex().IsNull())
|
||||
if (state.ignoreForeignQueues && !pathElement->getRideIndex().IsNull())
|
||||
{
|
||||
// Path is a queue we aren't interested in
|
||||
/* The rideIndex will be useful for
|
||||
* adding transport rides later. */
|
||||
rideIndex = pathElement->GetRideIndex();
|
||||
rideIndex = pathElement->getRideIndex();
|
||||
searchResult = PathSearchResult::rideQueue;
|
||||
}
|
||||
}
|
||||
@@ -1155,7 +1155,7 @@ namespace OpenRCT2::PathFinding
|
||||
uint8_t savedNumJunctions = state.junctionCount;
|
||||
|
||||
uint8_t height = loc.z;
|
||||
if (tileElement->asPath()->IsSloped() && tileElement->asPath()->GetSlopeDirection() == nextTestEdge)
|
||||
if (tileElement->asPath()->isSloped() && tileElement->asPath()->getSlopeDirection() == nextTestEdge)
|
||||
{
|
||||
height += 2;
|
||||
}
|
||||
@@ -1393,7 +1393,7 @@ namespace OpenRCT2::PathFinding
|
||||
edges &= ~(1 << testEdge);
|
||||
uint8_t height = loc.z;
|
||||
|
||||
if (firstTileElement->asPath()->IsSloped() && firstTileElement->asPath()->GetSlopeDirection() == testEdge)
|
||||
if (firstTileElement->asPath()->isSloped() && firstTileElement->asPath()->getSlopeDirection() == testEdge)
|
||||
{
|
||||
height += 0x2;
|
||||
}
|
||||
@@ -1736,9 +1736,9 @@ namespace OpenRCT2::PathFinding
|
||||
// Update the current queue end
|
||||
queueEnd = nextTile;
|
||||
// queueEnd.direction = direction;
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (tileElement->asPath()->GetSlopeDirection() == direction)
|
||||
if (tileElement->asPath()->getSlopeDirection() == direction)
|
||||
{
|
||||
baseZ += 2;
|
||||
}
|
||||
@@ -1760,9 +1760,9 @@ namespace OpenRCT2::PathFinding
|
||||
|
||||
if (baseZ == tileElement->baseHeight)
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (tileElement->asPath()->GetSlopeDirection() != direction)
|
||||
if (tileElement->asPath()->getSlopeDirection() != direction)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1773,10 +1773,10 @@ namespace OpenRCT2::PathFinding
|
||||
|
||||
if (baseZ - 2 == tileElement->baseHeight)
|
||||
{
|
||||
if (!tileElement->asPath()->IsSloped())
|
||||
if (!tileElement->asPath()->isSloped())
|
||||
break;
|
||||
|
||||
if (tileElement->asPath()->GetSlopeDirection() != DirectionReverse(direction))
|
||||
if (tileElement->asPath()->getSlopeDirection() != DirectionReverse(direction))
|
||||
break;
|
||||
|
||||
baseZ -= 2;
|
||||
@@ -1788,28 +1788,28 @@ namespace OpenRCT2::PathFinding
|
||||
if (!found)
|
||||
break;
|
||||
|
||||
if (!tileElement->asPath()->IsQueue())
|
||||
if (!tileElement->asPath()->isQueue())
|
||||
break;
|
||||
|
||||
if (!(tileElement->asPath()->GetEdges() & (1 << DirectionReverse(direction))))
|
||||
if (!(tileElement->asPath()->getEdges() & (1 << DirectionReverse(direction))))
|
||||
break;
|
||||
|
||||
if (firstPathElement == nullptr)
|
||||
firstPathElement = tileElement;
|
||||
|
||||
// More queue to go.
|
||||
if (tileElement->asPath()->GetEdges() & (1 << (direction)))
|
||||
if (tileElement->asPath()->getEdges() & (1 << (direction)))
|
||||
continue;
|
||||
|
||||
direction++;
|
||||
direction &= 3;
|
||||
// More queue to go.
|
||||
if (tileElement->asPath()->GetEdges() & (1 << (direction)))
|
||||
if (tileElement->asPath()->getEdges() & (1 << (direction)))
|
||||
continue;
|
||||
|
||||
direction = DirectionReverse(direction);
|
||||
// More queue to go.
|
||||
if (tileElement->asPath()->GetEdges() & (1 << (direction)))
|
||||
if (tileElement->asPath()->getEdges() & (1 << (direction)))
|
||||
continue;
|
||||
|
||||
break;
|
||||
@@ -1822,7 +1822,7 @@ namespace OpenRCT2::PathFinding
|
||||
if (tileElement == nullptr)
|
||||
return;
|
||||
|
||||
if (!tileElement->asPath()->IsQueue())
|
||||
if (!tileElement->asPath()->isQueue())
|
||||
return;
|
||||
|
||||
loc.x = queueEnd.x;
|
||||
|
||||
@@ -1673,32 +1673,32 @@ namespace OpenRCT2::RCT1
|
||||
auto dst2 = dst->asPath();
|
||||
auto src2 = src->asPath();
|
||||
|
||||
dst2->SetQueueBannerDirection(src2->GetQueueBannerDirection());
|
||||
dst2->SetSloped(src2->IsSloped());
|
||||
dst2->SetSlopeDirection(src2->GetSlopeDirection());
|
||||
dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex()));
|
||||
dst2->SetStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex()));
|
||||
dst2->SetWide(src2->IsWide());
|
||||
dst2->SetHasQueueBanner(src2->HasQueueBanner());
|
||||
dst2->SetEdges(src2->GetEdges());
|
||||
dst2->SetCorners(src2->GetCorners());
|
||||
dst2->SetAddition(0);
|
||||
dst2->SetAdditionIsGhost(false);
|
||||
dst2->SetAdditionStatus(src2->GetAdditionStatus());
|
||||
dst2->setQueueBannerDirection(src2->GetQueueBannerDirection());
|
||||
dst2->setSloped(src2->IsSloped());
|
||||
dst2->setSlopeDirection(src2->GetSlopeDirection());
|
||||
dst2->setRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex()));
|
||||
dst2->setStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex()));
|
||||
dst2->setWide(src2->IsWide());
|
||||
dst2->setHasQueueBanner(src2->HasQueueBanner());
|
||||
dst2->setEdges(src2->GetEdges());
|
||||
dst2->setCorners(src2->GetCorners());
|
||||
dst2->setAddition(0);
|
||||
dst2->setAdditionIsGhost(false);
|
||||
dst2->setAdditionStatus(src2->GetAdditionStatus());
|
||||
|
||||
// Type
|
||||
uint8_t pathType = src2->GetRCT1PathType();
|
||||
auto entryIndex = _footpathSurfaceTypeToEntryMap[pathType];
|
||||
|
||||
dst2->setDirection(0);
|
||||
dst2->SetIsBroken(false);
|
||||
dst2->SetIsBlockedByVehicle(false);
|
||||
dst2->setIsBroken(false);
|
||||
dst2->setIsBlockedByVehicle(false);
|
||||
|
||||
dst2->SetLegacyPathEntryIndex(entryIndex);
|
||||
dst2->SetShouldDrawPathOverSupports(true);
|
||||
dst2->setLegacyPathEntryIndex(entryIndex);
|
||||
dst2->setShouldDrawPathOverSupports(true);
|
||||
if (PathIsQueue(pathType))
|
||||
{
|
||||
dst2->SetIsQueue(true);
|
||||
dst2->setIsQueue(true);
|
||||
}
|
||||
|
||||
uint8_t railingsType = RCT1_PATH_SUPPORT_TYPE_TRUSS;
|
||||
@@ -1707,7 +1707,7 @@ namespace OpenRCT2::RCT1
|
||||
railingsType = src2->GetRCT1SupportType();
|
||||
}
|
||||
// All types are already loaded, in the same order as RCT1.
|
||||
dst2->SetRailingsEntryIndex(railingsType);
|
||||
dst2->setRailingsEntryIndex(railingsType);
|
||||
|
||||
// Additions
|
||||
ObjectEntryIndex additionType = src2->GetAddition();
|
||||
@@ -1717,9 +1717,9 @@ namespace OpenRCT2::RCT1
|
||||
entryIndex = _pathAdditionTypeToEntryMap[normalisedType];
|
||||
if (additionType != normalisedType)
|
||||
{
|
||||
dst2->SetIsBroken(true);
|
||||
dst2->setIsBroken(true);
|
||||
}
|
||||
dst2->SetAdditionEntryIndex(entryIndex);
|
||||
dst2->setAdditionEntryIndex(entryIndex);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -2557,10 +2557,10 @@ namespace OpenRCT2::RCT1
|
||||
continue;
|
||||
|
||||
auto* pathElement = it.element->asPath();
|
||||
if (pathElement->IsSloped())
|
||||
if (pathElement->isSloped())
|
||||
continue;
|
||||
|
||||
if (pathElement->IsQueue())
|
||||
if (pathElement->isQueue())
|
||||
continue;
|
||||
|
||||
auto* surface = MapGetSurfaceElementAt(TileCoordsXY(it.x, it.y));
|
||||
@@ -2576,7 +2576,7 @@ namespace OpenRCT2::RCT1
|
||||
// RCT1 would always draw supports around a path if it was flat on the ground.
|
||||
// In RCT2, this depends on the support type of the path, even though that isn’t even visible in this case.
|
||||
// As such, always import footpath that is on the ground with box supports.
|
||||
pathElement->SetRailingsEntryIndex(RCT1_PATH_SUPPORT_TYPE_TRUSS);
|
||||
pathElement->setRailingsEntryIndex(RCT1_PATH_SUPPORT_TYPE_TRUSS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1356,30 +1356,30 @@ namespace OpenRCT2::RCT2
|
||||
if (surfaceEntry == kObjectEntryIndexNull)
|
||||
{
|
||||
// Legacy footpath object
|
||||
dst2->SetLegacyPathEntryIndex(pathEntryIndex);
|
||||
dst2->setLegacyPathEntryIndex(pathEntryIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Surface / railing
|
||||
dst2->SetSurfaceEntryIndex(surfaceEntry);
|
||||
dst2->SetRailingsEntryIndex(_pathToRailingMap[pathEntryIndex]);
|
||||
dst2->setSurfaceEntryIndex(surfaceEntry);
|
||||
dst2->setRailingsEntryIndex(_pathToRailingMap[pathEntryIndex]);
|
||||
}
|
||||
|
||||
dst2->SetQueueBannerDirection(src2->GetQueueBannerDirection());
|
||||
dst2->SetSloped(src2->IsSloped());
|
||||
dst2->SetSlopeDirection(src2->GetSlopeDirection());
|
||||
dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex()));
|
||||
dst2->SetStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex()));
|
||||
dst2->SetWide(src2->IsWide());
|
||||
dst2->SetIsQueue(src2->IsQueue());
|
||||
dst2->SetHasQueueBanner(src2->HasQueueBanner());
|
||||
dst2->SetEdges(src2->GetEdges());
|
||||
dst2->SetCorners(src2->GetCorners());
|
||||
dst2->SetAddition(src2->GetAddition());
|
||||
dst2->SetAdditionIsGhost(src2->AdditionIsGhost());
|
||||
dst2->SetAdditionStatus(src2->GetAdditionStatus());
|
||||
dst2->SetIsBroken(src2->IsBroken());
|
||||
dst2->SetIsBlockedByVehicle(src2->IsBlockedByVehicle());
|
||||
dst2->setQueueBannerDirection(src2->GetQueueBannerDirection());
|
||||
dst2->setSloped(src2->IsSloped());
|
||||
dst2->setSlopeDirection(src2->GetSlopeDirection());
|
||||
dst2->setRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex()));
|
||||
dst2->setStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex()));
|
||||
dst2->setWide(src2->IsWide());
|
||||
dst2->setIsQueue(src2->IsQueue());
|
||||
dst2->setHasQueueBanner(src2->HasQueueBanner());
|
||||
dst2->setEdges(src2->GetEdges());
|
||||
dst2->setCorners(src2->GetCorners());
|
||||
dst2->setAddition(src2->GetAddition());
|
||||
dst2->setAdditionIsGhost(src2->AdditionIsGhost());
|
||||
dst2->setAdditionStatus(src2->GetAdditionStatus());
|
||||
dst2->setIsBroken(src2->IsBroken());
|
||||
dst2->setIsBlockedByVehicle(src2->IsBlockedByVehicle());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2169,7 +2169,7 @@ namespace OpenRCT2
|
||||
|
||||
static void RideQueueBannerSetMapTooltip(const PathElement& pathElement)
|
||||
{
|
||||
auto rideIndex = pathElement.GetRideIndex();
|
||||
auto rideIndex = pathElement.getRideIndex();
|
||||
auto ride = GetRide(rideIndex);
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
@@ -568,7 +568,7 @@ namespace OpenRCT2
|
||||
if (footpathElement == nullptr)
|
||||
continue;
|
||||
|
||||
footpathElement->SetIsBlockedByVehicle(false);
|
||||
footpathElement->setIsBlockedByVehicle(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ namespace OpenRCT2
|
||||
}
|
||||
break;
|
||||
case TileElementType::path:
|
||||
if (!tileElement->asPath()->IsQueue())
|
||||
if (!tileElement->asPath()->isQueue())
|
||||
{
|
||||
if (tileElement->getClearanceZ() == inputTileElement->getBaseZ())
|
||||
{
|
||||
|
||||
@@ -1236,7 +1236,7 @@ static GameActions::Result TrackDesignPlaceSceneryElement(
|
||||
if (tds.placeOperation == TrackPlaceOperation::placeTrackPreview
|
||||
|| tds.placeOperation == TrackPlaceOperation::place)
|
||||
{
|
||||
if (!pathElement->IsQueue() || FootpathQueueCountConnections(mapCoord, *pathElement) < 2)
|
||||
if (!pathElement->isQueue() || FootpathQueueCountConnections(mapCoord, *pathElement) < 2)
|
||||
{
|
||||
FootpathRemoveEdgesAt(mapCoord, reinterpret_cast<TileElement*>(pathElement));
|
||||
FootpathConnectEdges(mapCoord, reinterpret_cast<TileElement*>(pathElement), flags);
|
||||
|
||||
@@ -320,7 +320,7 @@ static TrackDesignAddStatus TrackDesignSaveAddWall(const CoordsXY& loc, WallElem
|
||||
|
||||
static std::optional<RCTObjectEntry> TrackDesignSaveFootpathGetBestEntry(const PathElement& pathElement)
|
||||
{
|
||||
auto legacyPathObj = pathElement.GetLegacyPathEntry();
|
||||
auto legacyPathObj = pathElement.getLegacyPathEntry();
|
||||
if (legacyPathObj != nullptr)
|
||||
{
|
||||
RCTObjectEntry pathEntry = legacyPathObj->GetObjectEntry();
|
||||
@@ -331,11 +331,11 @@ static std::optional<RCTObjectEntry> TrackDesignSaveFootpathGetBestEntry(const P
|
||||
}
|
||||
else
|
||||
{
|
||||
auto surfaceEntry = pathElement.GetSurfaceEntry();
|
||||
auto surfaceEntry = pathElement.getSurfaceEntry();
|
||||
if (surfaceEntry != nullptr)
|
||||
{
|
||||
auto surfaceId = surfaceEntry->GetIdentifier();
|
||||
auto railingsEntry = pathElement.GetRailingsEntry();
|
||||
auto railingsEntry = pathElement.getRailingsEntry();
|
||||
auto railingsId = railingsEntry == nullptr ? "" : railingsEntry->GetIdentifier();
|
||||
return RCT2::GetBestObjectEntryForSurface(surfaceId, railingsId);
|
||||
}
|
||||
@@ -347,10 +347,10 @@ static TrackDesignSceneryElement TrackDesignSaveCreateFootpathDesc(
|
||||
const RCTObjectEntry& pathEntry, const CoordsXY& loc, const PathElement& pathElement)
|
||||
{
|
||||
auto item = TrackDesignCreateTileElementDesc(pathEntry, { loc, pathElement.getBaseZ() });
|
||||
item.setEdges(pathElement.GetEdges());
|
||||
item.setHasSlope(pathElement.IsSloped());
|
||||
item.setSlopeDirection(pathElement.GetSlopeDirection());
|
||||
item.setIsQueue(pathElement.IsQueue());
|
||||
item.setEdges(pathElement.getEdges());
|
||||
item.setHasSlope(pathElement.isSloped());
|
||||
item.setSlopeDirection(pathElement.getSlopeDirection());
|
||||
item.setIsQueue(pathElement.isQueue());
|
||||
|
||||
return item;
|
||||
}
|
||||
@@ -555,7 +555,7 @@ static bool TrackDesignSaveShouldSelectSceneryAround(RideId rideIndex, TileEleme
|
||||
switch (tileElement->getType())
|
||||
{
|
||||
case TileElementType::path:
|
||||
if (tileElement->asPath()->IsQueue() && tileElement->asPath()->GetRideIndex() == rideIndex)
|
||||
if (tileElement->asPath()->isQueue() && tileElement->asPath()->getRideIndex() == rideIndex)
|
||||
return true;
|
||||
break;
|
||||
case TileElementType::track:
|
||||
@@ -594,9 +594,9 @@ static void TrackDesignSaveShouldSelectNearbySceneryForTile(RideId rideIndex, in
|
||||
switch (tileElement->getType())
|
||||
{
|
||||
case TileElementType::path:
|
||||
if (!tileElement->asPath()->IsQueue())
|
||||
if (!tileElement->asPath()->isQueue())
|
||||
interactionType = ViewportInteractionItem::footpath;
|
||||
else if (tileElement->asPath()->GetRideIndex() == rideIndex)
|
||||
else if (tileElement->asPath()->getRideIndex() == rideIndex)
|
||||
interactionType = ViewportInteractionItem::footpath;
|
||||
break;
|
||||
case TileElementType::smallScenery:
|
||||
|
||||
@@ -1363,13 +1363,13 @@ namespace OpenRCT2
|
||||
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->getBaseZ() }));
|
||||
if (pathElement != nullptr)
|
||||
{
|
||||
if (!playedClaxon && !pathElement->IsBlockedByVehicle())
|
||||
if (!playedClaxon && !pathElement->isBlockedByVehicle())
|
||||
{
|
||||
Claxon();
|
||||
playedClaxon = true;
|
||||
}
|
||||
crossingBonus = 4;
|
||||
pathElement->SetIsBlockedByVehicle(true);
|
||||
pathElement->setIsBlockedByVehicle(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1435,7 +1435,7 @@ namespace OpenRCT2
|
||||
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->getBaseZ() }));
|
||||
if (pathElement != nullptr)
|
||||
{
|
||||
pathElement->SetIsBlockedByVehicle(false);
|
||||
pathElement->setIsBlockedByVehicle(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,11 +367,11 @@ namespace OpenRCT2::Editor
|
||||
case TileElementType::path:
|
||||
{
|
||||
auto footpathEl = iter.element->asPath();
|
||||
auto legacyPathEntryIndex = footpathEl->GetLegacyPathEntryIndex();
|
||||
auto legacyPathEntryIndex = footpathEl->getLegacyPathEntryIndex();
|
||||
if (legacyPathEntryIndex == kObjectEntryIndexNull)
|
||||
{
|
||||
auto surfaceEntryIndex = footpathEl->GetSurfaceEntryIndex();
|
||||
auto railingEntryIndex = footpathEl->GetRailingsEntryIndex();
|
||||
auto surfaceEntryIndex = footpathEl->getSurfaceEntryIndex();
|
||||
auto railingEntryIndex = footpathEl->getRailingsEntryIndex();
|
||||
Editor::SetSelectedObject(ObjectType::footpathSurface, surfaceEntryIndex, ObjectSelectionFlags::InUse);
|
||||
Editor::SetSelectedObject(ObjectType::footpathRailings, railingEntryIndex, ObjectSelectionFlags::InUse);
|
||||
}
|
||||
@@ -379,9 +379,9 @@ namespace OpenRCT2::Editor
|
||||
{
|
||||
Editor::SetSelectedObject(ObjectType::paths, legacyPathEntryIndex, ObjectSelectionFlags::InUse);
|
||||
}
|
||||
if (footpathEl->HasAddition())
|
||||
if (footpathEl->hasAddition())
|
||||
{
|
||||
auto pathAdditionEntryIndex = footpathEl->GetAdditionEntryIndex();
|
||||
auto pathAdditionEntryIndex = footpathEl->getAdditionEntryIndex();
|
||||
SetSelectedObject(ObjectType::pathAdditions, pathAdditionEntryIndex, ObjectSelectionFlags::InUse);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -638,15 +638,15 @@ namespace OpenRCT2::Scripting
|
||||
case TileElementType::path:
|
||||
{
|
||||
auto* el = element->asPath();
|
||||
if (!el->IsQueue())
|
||||
if (!el->isQueue())
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
scriptEngine.LogPluginInfo("Cannot read 'ride' property, path is not a queue.");
|
||||
return JS_NULL;
|
||||
}
|
||||
|
||||
if (!el->GetRideIndex().IsNull())
|
||||
return JS_NewUint32(ctx, el->GetRideIndex().ToUnderlying());
|
||||
if (!el->getRideIndex().IsNull())
|
||||
return JS_NewUint32(ctx, el->getRideIndex().ToUnderlying());
|
||||
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -680,7 +680,7 @@ namespace OpenRCT2::Scripting
|
||||
case TileElementType::path:
|
||||
{
|
||||
auto* el = element->asPath();
|
||||
if (!el->IsQueue())
|
||||
if (!el->isQueue())
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
scriptEngine.LogPluginInfo("Cannot set ride property, path is not a queue.");
|
||||
@@ -690,11 +690,11 @@ namespace OpenRCT2::Scripting
|
||||
if (JS_IsNumber(jsValue))
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
el->SetRideIndex(RideId::FromUnderlying(value));
|
||||
el->setRideIndex(RideId::FromUnderlying(value));
|
||||
}
|
||||
else if (JS_IsNull(jsValue))
|
||||
{
|
||||
el->SetRideIndex(RideId::GetNull());
|
||||
el->setRideIndex(RideId::GetNull());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -755,22 +755,22 @@ namespace OpenRCT2::Scripting
|
||||
case TileElementType::path:
|
||||
{
|
||||
auto* el = element->asPath();
|
||||
if (!el->IsQueue())
|
||||
if (!el->isQueue())
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
scriptEngine.LogPluginInfo("Cannot read 'station' property, path is not a queue.");
|
||||
return JS_NULL;
|
||||
}
|
||||
|
||||
if (el->GetRideIndex().IsNull())
|
||||
if (el->getRideIndex().IsNull())
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
scriptEngine.LogPluginInfo("Cannot read 'station' property, queue is not linked to a ride.");
|
||||
return JS_NULL;
|
||||
}
|
||||
|
||||
if (!el->GetStationIndex().IsNull())
|
||||
return JS_NewUint32(ctx, el->GetStationIndex().ToUnderlying());
|
||||
if (!el->getStationIndex().IsNull())
|
||||
return JS_NewUint32(ctx, el->getStationIndex().ToUnderlying());
|
||||
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -814,11 +814,11 @@ namespace OpenRCT2::Scripting
|
||||
if (JS_IsNumber(jsValue))
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
el->SetStationIndex(StationIndex::FromUnderlying(value));
|
||||
el->setStationIndex(StationIndex::FromUnderlying(value));
|
||||
}
|
||||
else if (JS_IsNull(jsValue))
|
||||
{
|
||||
el->SetStationIndex(StationIndex::GetNull());
|
||||
el->setStationIndex(StationIndex::GetNull());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1262,7 +1262,7 @@ namespace OpenRCT2::Scripting
|
||||
case TileElementType::path:
|
||||
{
|
||||
auto* el = element->asPath();
|
||||
auto index = el->GetLegacyPathEntryIndex();
|
||||
auto index = el->getLegacyPathEntryIndex();
|
||||
if (index != kObjectEntryIndexNull)
|
||||
return JS_NewUint32(ctx, index);
|
||||
|
||||
@@ -1312,7 +1312,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
JS_UNPACK_UINT32(index, ctx, jsValue);
|
||||
auto* el = element->asPath();
|
||||
el->SetLegacyPathEntryIndex(index);
|
||||
el->setLegacyPathEntryIndex(index);
|
||||
Invalidate(data);
|
||||
}
|
||||
break;
|
||||
@@ -1730,7 +1730,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
return JS_NewUint32(ctx, el != nullptr ? el->GetEdgesAndCorners() : 0);
|
||||
return JS_NewUint32(ctx, el != nullptr ? el->getEdgesAndCorners() : 0);
|
||||
}
|
||||
JSValue ScTileElement::edgesAndCorners_set(JSContext* ctx, JSValue thisValue, JSValue jsValue)
|
||||
{
|
||||
@@ -1740,7 +1740,7 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
el->SetEdgesAndCorners(value);
|
||||
el->setEdgesAndCorners(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
return JS_UNDEFINED;
|
||||
@@ -1751,7 +1751,7 @@ namespace OpenRCT2::Scripting
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
return JS_NewUint32(ctx, el->GetEdges());
|
||||
return JS_NewUint32(ctx, el->getEdges());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1763,7 +1763,7 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
el->SetEdges(value);
|
||||
el->setEdges(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
return JS_UNDEFINED;
|
||||
@@ -1774,7 +1774,7 @@ namespace OpenRCT2::Scripting
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
return JS_NewUint32(ctx, el->GetCorners());
|
||||
return JS_NewUint32(ctx, el->getCorners());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1786,7 +1786,7 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
el->SetCorners(value);
|
||||
el->setCorners(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
return JS_UNDEFINED;
|
||||
@@ -1796,8 +1796,8 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr && el->IsSloped())
|
||||
return JS_NewUint32(ctx, el->GetSlopeDirection());
|
||||
if (el != nullptr && el->isSloped())
|
||||
return JS_NewUint32(ctx, el->getSlopeDirection());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1811,13 +1811,13 @@ namespace OpenRCT2::Scripting
|
||||
if (JS_IsNumber(jsValue))
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
el->SetSloped(true);
|
||||
el->SetSlopeDirection(value);
|
||||
el->setSloped(true);
|
||||
el->setSlopeDirection(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
el->SetSloped(false);
|
||||
el->SetSlopeDirection(0);
|
||||
el->setSloped(false);
|
||||
el->setSlopeDirection(0);
|
||||
}
|
||||
Invalidate(data);
|
||||
}
|
||||
@@ -1829,7 +1829,7 @@ namespace OpenRCT2::Scripting
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
return JS_NewBool(ctx, el->IsQueue());
|
||||
return JS_NewBool(ctx, el->isQueue());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1841,7 +1841,7 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
el->SetIsQueue(value);
|
||||
el->setIsQueue(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
return JS_UNDEFINED;
|
||||
@@ -1851,8 +1851,8 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr && el->HasQueueBanner())
|
||||
return JS_NewUint32(ctx, el->GetQueueBannerDirection());
|
||||
if (el != nullptr && el->hasQueueBanner())
|
||||
return JS_NewUint32(ctx, el->getQueueBannerDirection());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1866,13 +1866,13 @@ namespace OpenRCT2::Scripting
|
||||
if (JS_IsNumber(jsValue))
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
el->SetHasQueueBanner(true);
|
||||
el->SetQueueBannerDirection(value);
|
||||
el->setHasQueueBanner(true);
|
||||
el->setQueueBannerDirection(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
el->SetHasQueueBanner(false);
|
||||
el->SetQueueBannerDirection(0);
|
||||
el->setHasQueueBanner(false);
|
||||
el->setQueueBannerDirection(0);
|
||||
}
|
||||
Invalidate(data);
|
||||
}
|
||||
@@ -1884,7 +1884,7 @@ namespace OpenRCT2::Scripting
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
return JS_NewBool(ctx, el->IsBlockedByVehicle());
|
||||
return JS_NewBool(ctx, el->isBlockedByVehicle());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1896,7 +1896,7 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
el->SetIsBlockedByVehicle(value);
|
||||
el->setIsBlockedByVehicle(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
return JS_UNDEFINED;
|
||||
@@ -1907,7 +1907,7 @@ namespace OpenRCT2::Scripting
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
return JS_NewBool(ctx, el->IsWide());
|
||||
return JS_NewBool(ctx, el->isWide());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -1919,7 +1919,7 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
el->SetWide(value);
|
||||
el->setWide(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
return JS_UNDEFINED;
|
||||
@@ -1932,7 +1932,7 @@ namespace OpenRCT2::Scripting
|
||||
if (element->getType() == TileElementType::path)
|
||||
{
|
||||
auto* el = element->asPath();
|
||||
auto index = el->GetSurfaceEntryIndex();
|
||||
auto index = el->getSurfaceEntryIndex();
|
||||
if (index != kObjectEntryIndexNull)
|
||||
{
|
||||
return JS_NewUint32(ctx, index);
|
||||
@@ -1952,7 +1952,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
auto* el = element->asPath();
|
||||
el->SetSurfaceEntryIndex(value);
|
||||
el->setSurfaceEntryIndex(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
}
|
||||
@@ -1966,7 +1966,7 @@ namespace OpenRCT2::Scripting
|
||||
if (element->getType() == TileElementType::path)
|
||||
{
|
||||
auto* el = element->asPath();
|
||||
auto index = el->GetRailingsEntryIndex();
|
||||
auto index = el->getRailingsEntryIndex();
|
||||
if (index != kObjectEntryIndexNull)
|
||||
{
|
||||
return JS_NewUint32(ctx, index);
|
||||
@@ -1986,7 +1986,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
auto* el = element->asPath();
|
||||
el->SetRailingsEntryIndex(value);
|
||||
el->setRailingsEntryIndex(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
}
|
||||
@@ -1997,8 +1997,8 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr && el->HasAddition())
|
||||
return JS_NewUint32(ctx, el->GetAdditionEntryIndex());
|
||||
if (el != nullptr && el->hasAddition())
|
||||
return JS_NewUint32(ctx, el->getAdditionEntryIndex());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -2014,12 +2014,12 @@ namespace OpenRCT2::Scripting
|
||||
JS_UNPACK_UINT32(addition, ctx, jsValue);
|
||||
if (addition <= 254)
|
||||
{
|
||||
el->SetAdditionEntryIndex(addition);
|
||||
el->setAdditionEntryIndex(addition);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
el->SetAddition(0);
|
||||
el->setAddition(0);
|
||||
}
|
||||
Invalidate(data);
|
||||
}
|
||||
@@ -2030,8 +2030,8 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr && el->HasAddition() && !el->IsQueue())
|
||||
return JS_NewUint32(ctx, el->GetAdditionStatus());
|
||||
if (el != nullptr && el->hasAddition() && !el->isQueue())
|
||||
return JS_NewUint32(ctx, el->getAdditionStatus());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -2044,10 +2044,10 @@ namespace OpenRCT2::Scripting
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr)
|
||||
{
|
||||
if (el->HasAddition() && !el->IsQueue())
|
||||
if (el->hasAddition() && !el->isQueue())
|
||||
{
|
||||
JS_UNPACK_UINT32(value, ctx, jsValue);
|
||||
el->SetAdditionStatus(value);
|
||||
el->setAdditionStatus(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
}
|
||||
@@ -2059,8 +2059,8 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr && el->HasAddition())
|
||||
return JS_NewBool(ctx, el->IsBroken());
|
||||
if (el != nullptr && el->hasAddition())
|
||||
return JS_NewBool(ctx, el->isBroken());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -2074,7 +2074,7 @@ namespace OpenRCT2::Scripting
|
||||
if (el != nullptr)
|
||||
{
|
||||
JS_UNPACK_BOOL(value, ctx, jsValue);
|
||||
el->SetIsBroken(value);
|
||||
el->setIsBroken(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
}
|
||||
@@ -2085,17 +2085,17 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el == nullptr || !el->HasAddition() || el->IsQueue())
|
||||
if (el == nullptr || !el->hasAddition() || el->isQueue())
|
||||
return JS_NULL;
|
||||
|
||||
const auto* additionEntry = el->GetAdditionEntry();
|
||||
const auto* additionEntry = el->getAdditionEntry();
|
||||
if (additionEntry == nullptr || !(additionEntry->flags & PATH_ADDITION_FLAG_IS_BIN))
|
||||
return JS_NULL;
|
||||
|
||||
// Each path edge has a 2-bit slot (0 = full, 3 = empty); a bin is only "full" once a
|
||||
// slot on an open edge reaches 0. Matches Staff::updatePatrollingFindBin.
|
||||
uint8_t binEdges = el->GetEdges();
|
||||
uint8_t binStatus = el->GetAdditionStatus();
|
||||
uint8_t binEdges = el->getEdges();
|
||||
uint8_t binStatus = el->getAdditionStatus();
|
||||
for (int32_t i = 0; i < 4; ++i)
|
||||
{
|
||||
if (!(binEdges & 1) && !(binStatus & 3))
|
||||
@@ -2110,8 +2110,8 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
auto data = gScTileElement.GetOpaque<OpaqueTileElementData*>(thisValue);
|
||||
auto* el = data->element->asPath();
|
||||
if (el != nullptr && el->HasAddition())
|
||||
return JS_NewBool(ctx, el->AdditionIsGhost());
|
||||
if (el != nullptr && el->hasAddition())
|
||||
return JS_NewBool(ctx, el->additionIsGhost());
|
||||
else
|
||||
return JS_NULL;
|
||||
}
|
||||
@@ -2125,7 +2125,7 @@ namespace OpenRCT2::Scripting
|
||||
if (el != nullptr)
|
||||
{
|
||||
JS_UNPACK_BOOL(value, ctx, jsValue);
|
||||
el->SetAdditionIsGhost(value);
|
||||
el->setAdditionIsGhost(value);
|
||||
Invalidate(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ static bool landSlopeFitsUnderPath(int32_t baseZ, uint8_t slope, const PathEleme
|
||||
{
|
||||
const auto slopeCornerHeights = GetSlopeCornerHeights(baseZ, slope);
|
||||
|
||||
const uint8_t pathSlope = Numerics::rol4(kTileSlopeSWSideUp, pathElement.GetSlopeDirection());
|
||||
const uint8_t pathSlope = Numerics::rol4(kTileSlopeSWSideUp, pathElement.getSlopeDirection());
|
||||
const auto pathCornerHeights = GetSlopeCornerHeights(pathElement.getBaseZ(), pathSlope);
|
||||
|
||||
return (slopeCornerHeights <= pathCornerHeights);
|
||||
@@ -140,7 +140,7 @@ static bool MapLoc68BABCShouldContinue(
|
||||
}
|
||||
}
|
||||
|
||||
if (slope != kTileSlopeFlat && tileElement->getType() == TileElementType::path && tileElement->asPath()->IsSloped())
|
||||
if (slope != kTileSlopeFlat && tileElement->getType() == TileElementType::path && tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (landSlopeFitsUnderPath(pos.baseZ, slope, *tileElement->asPath()))
|
||||
{
|
||||
@@ -149,7 +149,7 @@ static bool MapLoc68BABCShouldContinue(
|
||||
}
|
||||
|
||||
if (crossingMode == CreateCrossingMode::trackOverPath && canBuildCrossing && tileElement->getType() == TileElementType::path
|
||||
&& tileElement->getBaseZ() == pos.baseZ && !tileElement->asPath()->IsQueue() && !tileElement->asPath()->IsSloped())
|
||||
&& tileElement->getBaseZ() == pos.baseZ && !tileElement->asPath()->isQueue() && !tileElement->asPath()->isSloped())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
+140
-140
@@ -185,11 +185,11 @@ namespace OpenRCT2
|
||||
if (tileElement->getType() != TileElementType::path)
|
||||
continue;
|
||||
auto pathElement = tileElement->asPath();
|
||||
if (pathElement->IsQueue())
|
||||
if (pathElement->isQueue())
|
||||
continue;
|
||||
if (tileElement->getBaseZ() != footpathPos.z)
|
||||
continue;
|
||||
if (!(pathElement->GetEdgesAndCorners() & requireEdges))
|
||||
if (!(pathElement->getEdgesAndCorners() & requireEdges))
|
||||
continue;
|
||||
|
||||
return pathElement;
|
||||
@@ -211,9 +211,9 @@ namespace OpenRCT2
|
||||
using PathElementCoordsPair = std::pair<PathElement*, CoordsXY>;
|
||||
std::array<PathElementCoordsPair, 4> tileElements;
|
||||
|
||||
if (initialTileElement->IsQueue())
|
||||
if (initialTileElement->isQueue())
|
||||
return;
|
||||
if (initialTileElement->IsSloped())
|
||||
if (initialTileElement->isSloped())
|
||||
return;
|
||||
|
||||
std::get<0>(tileElements) = { initialTileElement, footpathPos };
|
||||
@@ -252,24 +252,24 @@ namespace OpenRCT2
|
||||
continue;
|
||||
|
||||
direction = DirectionNext(direction);
|
||||
std::get<3>(tileElements).first->SetCorners(std::get<3>(tileElements).first->GetCorners() | (1 << (direction)));
|
||||
std::get<3>(tileElements).first->setCorners(std::get<3>(tileElements).first->getCorners() | (1 << (direction)));
|
||||
MapInvalidateElement(
|
||||
std::get<3>(tileElements).second, reinterpret_cast<TileElement*>(std::get<3>(tileElements).first));
|
||||
|
||||
direction = DirectionPrev(direction);
|
||||
std::get<2>(tileElements).first->SetCorners(std::get<2>(tileElements).first->GetCorners() | (1 << (direction)));
|
||||
std::get<2>(tileElements).first->setCorners(std::get<2>(tileElements).first->getCorners() | (1 << (direction)));
|
||||
|
||||
MapInvalidateElement(
|
||||
std::get<2>(tileElements).second, reinterpret_cast<TileElement*>(std::get<2>(tileElements).first));
|
||||
|
||||
direction = DirectionPrev(direction);
|
||||
std::get<1>(tileElements).first->SetCorners(std::get<1>(tileElements).first->GetCorners() | (1 << (direction)));
|
||||
std::get<1>(tileElements).first->setCorners(std::get<1>(tileElements).first->getCorners() | (1 << (direction)));
|
||||
|
||||
MapInvalidateElement(
|
||||
std::get<1>(tileElements).second, reinterpret_cast<TileElement*>(std::get<1>(tileElements).first));
|
||||
|
||||
direction = initialDirection;
|
||||
std::get<0>(tileElements).first->SetCorners(std::get<0>(tileElements).first->GetCorners() | (1 << (direction)));
|
||||
std::get<0>(tileElements).first->setCorners(std::get<0>(tileElements).first->getCorners() | (1 << (direction)));
|
||||
MapInvalidateElement(
|
||||
std::get<0>(tileElements).second, reinterpret_cast<TileElement*>(std::get<0>(tileElements).first));
|
||||
}
|
||||
@@ -363,9 +363,9 @@ namespace OpenRCT2
|
||||
|
||||
if (footpathPos.clearanceZ == tileElement->getBaseZ())
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
auto slope = tileElement->asPath()->GetSlopeDirection();
|
||||
auto slope = tileElement->asPath()->getSlopeDirection();
|
||||
if (slope != direction)
|
||||
break;
|
||||
}
|
||||
@@ -373,10 +373,10 @@ namespace OpenRCT2
|
||||
}
|
||||
if (footpathPos.baseZ == tileElement->getBaseZ())
|
||||
{
|
||||
if (!tileElement->asPath()->IsSloped())
|
||||
if (!tileElement->asPath()->isSloped())
|
||||
break;
|
||||
|
||||
auto slope = DirectionReverse(tileElement->asPath()->GetSlopeDirection());
|
||||
auto slope = DirectionReverse(tileElement->asPath()->getSlopeDirection());
|
||||
if (slope != direction)
|
||||
break;
|
||||
|
||||
@@ -392,7 +392,7 @@ namespace OpenRCT2
|
||||
static bool FootpathReconnectQueueToPath(
|
||||
const CoordsXY& footpathPos, TileElement* tileElement, int32_t action, int32_t direction)
|
||||
{
|
||||
if (((tileElement->asPath()->GetEdges() & (1 << direction)) == 0) ^ (action < 0))
|
||||
if (((tileElement->asPath()->getEdges() & (1 << direction)) == 0) ^ (action < 0))
|
||||
return false;
|
||||
|
||||
auto targetQueuePos = footpathPos + CoordsDirectionDelta[direction];
|
||||
@@ -409,21 +409,21 @@ namespace OpenRCT2
|
||||
|
||||
int32_t z = tileElement->getBaseZ();
|
||||
TileElement* targetFootpathElement = FootpathGetElement({ targetQueuePos, z - kLandHeightStep, z }, direction);
|
||||
if (targetFootpathElement != nullptr && !targetFootpathElement->asPath()->IsQueue())
|
||||
if (targetFootpathElement != nullptr && !targetFootpathElement->asPath()->isQueue())
|
||||
{
|
||||
auto targetQueueElement = targetFootpathElement->asPath();
|
||||
tileElement->asPath()->SetSlopeDirection(0);
|
||||
tileElement->asPath()->setSlopeDirection(0);
|
||||
if (action > 0)
|
||||
{
|
||||
tileElement->asPath()->SetEdges(tileElement->asPath()->GetEdges() & ~(1 << direction));
|
||||
targetQueueElement->SetEdges(targetQueueElement->GetEdges() & ~(1 << (DirectionReverse(direction) & 3)));
|
||||
tileElement->asPath()->setEdges(tileElement->asPath()->getEdges() & ~(1 << direction));
|
||||
targetQueueElement->setEdges(targetQueueElement->getEdges() & ~(1 << (DirectionReverse(direction) & 3)));
|
||||
if (action >= 2)
|
||||
tileElement->asPath()->SetSlopeDirection(direction);
|
||||
tileElement->asPath()->setSlopeDirection(direction);
|
||||
}
|
||||
else if (action < 0)
|
||||
{
|
||||
tileElement->asPath()->SetEdges(tileElement->asPath()->GetEdges() | (1 << direction));
|
||||
targetQueueElement->SetEdges(targetQueueElement->GetEdges() | (1 << (DirectionReverse(direction) & 3)));
|
||||
tileElement->asPath()->setEdges(tileElement->asPath()->getEdges() | (1 << direction));
|
||||
targetQueueElement->setEdges(targetQueueElement->getEdges() | (1 << (DirectionReverse(direction) & 3)));
|
||||
}
|
||||
if (action != 0)
|
||||
MapInvalidateTileFull(targetQueuePos);
|
||||
@@ -434,26 +434,26 @@ namespace OpenRCT2
|
||||
|
||||
static bool FootpathDisconnectQueueFromPath(const CoordsXY& footpathPos, TileElement* tileElement, int32_t action)
|
||||
{
|
||||
if (!tileElement->asPath()->IsQueue())
|
||||
if (!tileElement->asPath()->isQueue())
|
||||
return false;
|
||||
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
return false;
|
||||
|
||||
uint8_t c = connected_path_count[tileElement->asPath()->GetEdges()];
|
||||
uint8_t c = connected_path_count[tileElement->asPath()->getEdges()];
|
||||
if ((action < 0) ? (c >= 2) : (c < 2))
|
||||
return false;
|
||||
|
||||
if (action < 0)
|
||||
{
|
||||
uint8_t direction = tileElement->asPath()->GetSlopeDirection();
|
||||
uint8_t direction = tileElement->asPath()->getSlopeDirection();
|
||||
if (FootpathReconnectQueueToPath(footpathPos, tileElement, action, direction))
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Direction direction : kAllDirections)
|
||||
{
|
||||
if ((action < 0) && (direction == tileElement->asPath()->GetSlopeDirection()))
|
||||
if ((action < 0) && (direction == tileElement->asPath()->getSlopeDirection()))
|
||||
continue;
|
||||
if (FootpathReconnectQueueToPath(footpathPos, tileElement, action, direction))
|
||||
return true;
|
||||
@@ -474,7 +474,7 @@ namespace OpenRCT2
|
||||
{
|
||||
if (!query)
|
||||
{
|
||||
initialTileElement->asPath()->SetEdges(initialTileElement->asPath()->GetEdges() | (1 << direction));
|
||||
initialTileElement->asPath()->setEdges(initialTileElement->asPath()->getEdges() | (1 << direction));
|
||||
MapInvalidateElement(initialTileElementPos, initialTileElement);
|
||||
}
|
||||
}
|
||||
@@ -490,23 +490,23 @@ namespace OpenRCT2
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
{
|
||||
if (connected_path_count[tileElement->asPath()->GetEdges()] < 2)
|
||||
if (connected_path_count[tileElement->asPath()->getEdges()] < 2)
|
||||
{
|
||||
FootpathNeighbourListPush(
|
||||
neighbourList, 4, direction, tileElement->asPath()->GetRideIndex(),
|
||||
tileElement->asPath()->GetStationIndex());
|
||||
neighbourList, 4, direction, tileElement->asPath()->getRideIndex(),
|
||||
tileElement->asPath()->getStationIndex());
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((initialTileElement)->getType() == TileElementType::path && initialTileElement->asPath()->IsQueue())
|
||||
if ((initialTileElement)->getType() == TileElementType::path && initialTileElement->asPath()->isQueue())
|
||||
{
|
||||
if (FootpathDisconnectQueueFromPath(targetPos, tileElement, 0))
|
||||
{
|
||||
FootpathNeighbourListPush(
|
||||
neighbourList, 3, direction, tileElement->asPath()->GetRideIndex(),
|
||||
tileElement->asPath()->GetStationIndex());
|
||||
neighbourList, 3, direction, tileElement->asPath()->getRideIndex(),
|
||||
tileElement->asPath()->getStationIndex());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -520,10 +520,10 @@ namespace OpenRCT2
|
||||
{
|
||||
const bool isGhost = flags.has(CommandFlag::ghost);
|
||||
FootpathDisconnectQueueFromPath(targetPos, tileElement, isGhost ? 2 : 1);
|
||||
tileElement->asPath()->SetEdges(tileElement->asPath()->GetEdges() | (1 << DirectionReverse(direction)));
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
tileElement->asPath()->setEdges(tileElement->asPath()->getEdges() | (1 << DirectionReverse(direction)));
|
||||
if (tileElement->asPath()->isQueue())
|
||||
{
|
||||
FootpathQueueChainPush(tileElement->asPath()->GetRideIndex());
|
||||
FootpathQueueChainPush(tileElement->asPath()->getRideIndex());
|
||||
}
|
||||
}
|
||||
if (!flags.hasAny(CommandFlag::ghost, CommandFlag::allowDuringPaused))
|
||||
@@ -559,7 +559,7 @@ namespace OpenRCT2
|
||||
case TileElementType::path:
|
||||
if (tileElement->getBaseZ() == initialTileElementPos.z)
|
||||
{
|
||||
if (!tileElement->asPath()->IsSloped() || tileElement->asPath()->GetSlopeDirection() == direction)
|
||||
if (!tileElement->asPath()->isSloped() || tileElement->asPath()->getSlopeDirection() == direction)
|
||||
{
|
||||
Loc6A6F1F(
|
||||
initialTileElementPos, direction, tileElement, initialTileElement, targetPos, flags, query,
|
||||
@@ -569,8 +569,8 @@ namespace OpenRCT2
|
||||
}
|
||||
if (tileElement->getBaseZ() == initialTileElementPos.z - kLandHeightStep)
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped()
|
||||
&& tileElement->asPath()->GetSlopeDirection() == DirectionReverse(direction))
|
||||
if (tileElement->asPath()->isSloped()
|
||||
&& tileElement->asPath()->getSlopeDirection() == DirectionReverse(direction))
|
||||
{
|
||||
Loc6A6F1F(
|
||||
initialTileElementPos, direction, tileElement, initialTileElement, targetPos, flags, query,
|
||||
@@ -700,13 +700,13 @@ namespace OpenRCT2
|
||||
auto pos = CoordsXYZ{ tileElementPos, tileElementPos.element->getBaseZ() };
|
||||
if (tileElementPos.element->getType() == TileElementType::path)
|
||||
{
|
||||
if (tileElementPos.element->asPath()->IsSloped())
|
||||
if (tileElementPos.element->asPath()->isSloped())
|
||||
{
|
||||
if ((tileElementPos.element->asPath()->GetSlopeDirection() - direction) & 1)
|
||||
if ((tileElementPos.element->asPath()->getSlopeDirection() - direction) & 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tileElementPos.element->asPath()->GetSlopeDirection() == direction)
|
||||
if (tileElementPos.element->asPath()->getSlopeDirection() == direction)
|
||||
{
|
||||
pos.z += kLandHeightStep;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ namespace OpenRCT2
|
||||
|
||||
FoopathNeighbourListSort(&neighbourList);
|
||||
|
||||
if (tileElement->getType() == TileElementType::path && tileElement->asPath()->IsQueue())
|
||||
if (tileElement->getType() == TileElementType::path && tileElement->asPath()->isQueue())
|
||||
{
|
||||
RideId rideIndex = RideId::GetNull();
|
||||
StationIndex entranceIndex = StationIndex::GetNull();
|
||||
@@ -809,9 +809,9 @@ namespace OpenRCT2
|
||||
lastPathElement = tileElement;
|
||||
lastPath = curQueuePos;
|
||||
lastPathDirection = direction;
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (tileElement->asPath()->GetSlopeDirection() == direction)
|
||||
if (tileElement->asPath()->getSlopeDirection() == direction)
|
||||
{
|
||||
baseZ += kLandHeightStep;
|
||||
}
|
||||
@@ -831,9 +831,9 @@ namespace OpenRCT2
|
||||
continue;
|
||||
if (tileElement->getBaseZ() == baseZ)
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (tileElement->asPath()->GetSlopeDirection() != direction)
|
||||
if (tileElement->asPath()->getSlopeDirection() != direction)
|
||||
break;
|
||||
}
|
||||
foundQueue = true;
|
||||
@@ -841,10 +841,10 @@ namespace OpenRCT2
|
||||
}
|
||||
if (tileElement->getBaseZ() == baseZ - kLandHeightStep)
|
||||
{
|
||||
if (!tileElement->asPath()->IsSloped())
|
||||
if (!tileElement->asPath()->isSloped())
|
||||
break;
|
||||
|
||||
if (DirectionReverse(tileElement->asPath()->GetSlopeDirection()) != direction)
|
||||
if (DirectionReverse(tileElement->asPath()->getSlopeDirection()) != direction)
|
||||
break;
|
||||
|
||||
baseZ -= kLandHeightStep;
|
||||
@@ -856,11 +856,11 @@ namespace OpenRCT2
|
||||
if (!foundQueue)
|
||||
break;
|
||||
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
{
|
||||
// Fix #2051: Stop queue paths that are already connected to two other tiles
|
||||
// from connecting to the tile we are coming from.
|
||||
uint32_t edges = tileElement->asPath()->GetEdges();
|
||||
uint32_t edges = tileElement->asPath()->getEdges();
|
||||
uint32_t numEdges = std::popcount(edges);
|
||||
if (numEdges >= 2)
|
||||
{
|
||||
@@ -871,10 +871,10 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
|
||||
tileElement->asPath()->SetHasQueueBanner(false);
|
||||
tileElement->asPath()->SetEdges(tileElement->asPath()->GetEdges() | (1 << DirectionReverse(direction)));
|
||||
tileElement->asPath()->SetRideIndex(rideIndex);
|
||||
tileElement->asPath()->SetStationIndex(entranceIndex);
|
||||
tileElement->asPath()->setHasQueueBanner(false);
|
||||
tileElement->asPath()->setEdges(tileElement->asPath()->getEdges() | (1 << DirectionReverse(direction)));
|
||||
tileElement->asPath()->setRideIndex(rideIndex);
|
||||
tileElement->asPath()->setStationIndex(entranceIndex);
|
||||
|
||||
curQueuePos = targetQueuePos;
|
||||
MapInvalidateElement(targetQueuePos, tileElement);
|
||||
@@ -884,15 +884,15 @@ namespace OpenRCT2
|
||||
lastQueuePathElement = tileElement;
|
||||
}
|
||||
|
||||
if (tileElement->asPath()->GetEdges() & (1 << direction))
|
||||
if (tileElement->asPath()->getEdges() & (1 << direction))
|
||||
continue;
|
||||
|
||||
direction = (direction + 1) & 3;
|
||||
if (tileElement->asPath()->GetEdges() & (1 << direction))
|
||||
if (tileElement->asPath()->getEdges() & (1 << direction))
|
||||
continue;
|
||||
|
||||
direction = DirectionReverse(direction);
|
||||
if (tileElement->asPath()->GetEdges() & (1 << direction))
|
||||
if (tileElement->asPath()->getEdges() & (1 << direction))
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@@ -900,10 +900,10 @@ namespace OpenRCT2
|
||||
|
||||
if (!rideIndex.IsNull() && lastPathElement != nullptr)
|
||||
{
|
||||
if (lastPathElement->asPath()->IsQueue())
|
||||
if (lastPathElement->asPath()->isQueue())
|
||||
{
|
||||
lastPathElement->asPath()->SetHasQueueBanner(true);
|
||||
lastPathElement->asPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction
|
||||
lastPathElement->asPath()->setHasQueueBanner(true);
|
||||
lastPathElement->asPath()->setQueueBannerDirection(lastPathDirection); // set the ride sign direction
|
||||
|
||||
MapAnimations::MarkTileForInvalidation(TileCoordsXY(lastPath));
|
||||
}
|
||||
@@ -976,7 +976,7 @@ namespace OpenRCT2
|
||||
for (const Direction direction : kAllDirections)
|
||||
{
|
||||
const uint8_t edge = 1 << direction;
|
||||
if (pathElement.GetEdges() & edge)
|
||||
if (pathElement.getEdges() & edge)
|
||||
{
|
||||
const CoordsXY adjacentPathPosition = position + CoordsDirectionDelta[direction];
|
||||
const int32_t z = pathElement.getBaseZ();
|
||||
@@ -1009,7 +1009,7 @@ namespace OpenRCT2
|
||||
|
||||
const PathElement& adjacentPath = *tileElement->asPath();
|
||||
|
||||
if (adjacentPath.GetEdges() & Numerics::rol4(edge, 2))
|
||||
if (adjacentPath.getEdges() & Numerics::rol4(edge, 2))
|
||||
{
|
||||
connectionCount++;
|
||||
}
|
||||
@@ -1137,8 +1137,8 @@ namespace OpenRCT2
|
||||
if (ste_tileElement->getType() != TileElementType::path)
|
||||
return true;
|
||||
|
||||
if (ste_tileElement->asPath()->IsSloped()
|
||||
&& (ste_slopeDirection = ste_tileElement->asPath()->GetSlopeDirection()) != ste_direction)
|
||||
if (ste_tileElement->asPath()->isSloped()
|
||||
&& (ste_slopeDirection = ste_tileElement->asPath()->getSlopeDirection()) != ste_direction)
|
||||
{
|
||||
if (DirectionReverse(ste_slopeDirection) != ste_direction)
|
||||
return true;
|
||||
@@ -1149,7 +1149,7 @@ namespace OpenRCT2
|
||||
return true;
|
||||
|
||||
if (!(ste_flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_QUEUES))
|
||||
if (ste_tileElement->asPath()->IsQueue())
|
||||
if (ste_tileElement->asPath()->isQueue())
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
@@ -1191,7 +1191,7 @@ namespace OpenRCT2
|
||||
if (flags & FOOTPATH_CONNECTED_MAP_EDGE_UNOWN)
|
||||
FootpathFixOwnership(targetPos);
|
||||
|
||||
edges = tileElement->asPath()->GetEdges();
|
||||
edges = tileElement->asPath()->getEdges();
|
||||
currentTile.direction = DirectionReverse(currentTile.direction);
|
||||
if (!tileElement->isLastForTile() && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY))
|
||||
{
|
||||
@@ -1220,8 +1220,8 @@ namespace OpenRCT2
|
||||
if (edges == 0)
|
||||
{
|
||||
// Only possible direction to go
|
||||
if (tileElement->asPath()->IsSloped()
|
||||
&& tileElement->asPath()->GetSlopeDirection() == currentTile.direction)
|
||||
if (tileElement->asPath()->isSloped()
|
||||
&& tileElement->asPath()->getSlopeDirection() == currentTile.direction)
|
||||
targetPos.z += kPathHeightStep;
|
||||
|
||||
// Prepare the next iteration
|
||||
@@ -1248,8 +1248,8 @@ namespace OpenRCT2
|
||||
do
|
||||
{
|
||||
edges &= ~(1 << currentTile.direction);
|
||||
if (tileElement->asPath()->IsSloped()
|
||||
&& tileElement->asPath()->GetSlopeDirection() == currentTile.direction)
|
||||
if (tileElement->asPath()->isSloped()
|
||||
&& tileElement->asPath()->getSlopeDirection() == currentTile.direction)
|
||||
{
|
||||
targetPos.z += kPathHeightStep;
|
||||
}
|
||||
@@ -1294,7 +1294,7 @@ namespace OpenRCT2
|
||||
{
|
||||
if (tileElement->getType() != TileElementType::path)
|
||||
continue;
|
||||
tileElement->asPath()->SetWide(false);
|
||||
tileElement->asPath()->setWide(false);
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
}
|
||||
|
||||
@@ -1315,9 +1315,9 @@ namespace OpenRCT2
|
||||
continue;
|
||||
if (footpathPos.z != tileElement->getBaseZ())
|
||||
continue;
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
continue;
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
continue;
|
||||
return tileElement;
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
@@ -1366,13 +1366,13 @@ namespace OpenRCT2
|
||||
if (tileElement->getType() != TileElementType::path)
|
||||
continue;
|
||||
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
continue;
|
||||
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
continue;
|
||||
|
||||
if (tileElement->asPath()->GetEdges() == 0)
|
||||
if (tileElement->asPath()->getEdges() == 0)
|
||||
continue;
|
||||
|
||||
auto height = tileElement->getBaseZ();
|
||||
@@ -1387,27 +1387,27 @@ namespace OpenRCT2
|
||||
}
|
||||
|
||||
uint8_t pathConnections = 0;
|
||||
if (tileElement->asPath()->GetEdges() & EDGE_NW)
|
||||
if (tileElement->asPath()->getEdges() & EDGE_NW)
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_NW;
|
||||
const auto* pathElement = std::get<3>(pathList);
|
||||
if (pathElement != nullptr && pathElement->asPath()->IsWide())
|
||||
if (pathElement != nullptr && pathElement->asPath()->isWide())
|
||||
{
|
||||
pathConnections &= ~FOOTPATH_CONNECTION_NW;
|
||||
}
|
||||
}
|
||||
|
||||
if (tileElement->asPath()->GetEdges() & EDGE_NE)
|
||||
if (tileElement->asPath()->getEdges() & EDGE_NE)
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_NE;
|
||||
const auto* pathElement = std::get<0>(pathList);
|
||||
if (pathElement != nullptr && pathElement->asPath()->IsWide())
|
||||
if (pathElement != nullptr && pathElement->asPath()->isWide())
|
||||
{
|
||||
pathConnections &= ~FOOTPATH_CONNECTION_NE;
|
||||
}
|
||||
}
|
||||
|
||||
if (tileElement->asPath()->GetEdges() & EDGE_SE)
|
||||
if (tileElement->asPath()->getEdges() & EDGE_SE)
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_SE;
|
||||
/* In the following:
|
||||
@@ -1422,7 +1422,7 @@ namespace OpenRCT2
|
||||
//}
|
||||
}
|
||||
|
||||
if (tileElement->asPath()->GetEdges() & EDGE_SW)
|
||||
if (tileElement->asPath()->getEdges() & EDGE_SW)
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_SW;
|
||||
/* In the following:
|
||||
@@ -1438,14 +1438,14 @@ namespace OpenRCT2
|
||||
}
|
||||
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_NW) && std::get<3>(pathList) != nullptr
|
||||
&& !std::get<3>(pathList)->asPath()->IsWide())
|
||||
&& !std::get<3>(pathList)->asPath()->isWide())
|
||||
{
|
||||
constexpr uint8_t edgeMask1 = EDGE_SE | EDGE_SW;
|
||||
const auto* pathElement0 = std::get<0>(pathList);
|
||||
const auto* pathElement7 = std::get<7>(pathList);
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_NE) && pathElement7 != nullptr && !pathElement7->asPath()->IsWide()
|
||||
&& (pathElement7->asPath()->GetEdges() & edgeMask1) == edgeMask1 && pathElement0 != nullptr
|
||||
&& !pathElement0->asPath()->IsWide())
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_NE) && pathElement7 != nullptr && !pathElement7->asPath()->isWide()
|
||||
&& (pathElement7->asPath()->getEdges() & edgeMask1) == edgeMask1 && pathElement0 != nullptr
|
||||
&& !pathElement0->asPath()->isWide())
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_S;
|
||||
}
|
||||
@@ -1458,8 +1458,8 @@ namespace OpenRCT2
|
||||
constexpr uint8_t edgeMask2 = EDGE_NE | EDGE_SE;
|
||||
const auto* pathElement2 = std::get<2>(pathList);
|
||||
const auto* pathElement6 = std::get<6>(pathList);
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_SW) && pathElement6 != nullptr && !(pathElement6)->asPath()->IsWide()
|
||||
&& (pathElement6->asPath()->GetEdges() & edgeMask2) == edgeMask2 && pathElement2 != nullptr)
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_SW) && pathElement6 != nullptr && !(pathElement6)->asPath()->isWide()
|
||||
&& (pathElement6->asPath()->getEdges() & edgeMask2) == edgeMask2 && pathElement2 != nullptr)
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_E;
|
||||
}
|
||||
@@ -1477,8 +1477,8 @@ namespace OpenRCT2
|
||||
const auto* pathElement0 = std::get<0>(pathList);
|
||||
const auto* pathElement4 = std::get<4>(pathList);
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_NE) && (pathElement4 != nullptr)
|
||||
&& (pathElement4->asPath()->GetEdges() & edgeMask1) == edgeMask1 && pathElement0 != nullptr
|
||||
&& !pathElement0->asPath()->IsWide())
|
||||
&& (pathElement4->asPath()->getEdges() & edgeMask1) == edgeMask1 && pathElement0 != nullptr
|
||||
&& !pathElement0->asPath()->isWide())
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_W;
|
||||
}
|
||||
@@ -1493,7 +1493,7 @@ namespace OpenRCT2
|
||||
const auto* pathElement2 = std::get<2>(pathList);
|
||||
const auto* pathElement5 = std::get<5>(pathList);
|
||||
if ((pathConnections & FOOTPATH_CONNECTION_SW) && pathElement5 != nullptr
|
||||
&& (pathElement5->asPath()->GetEdges() & edgeMask2) == edgeMask2 && pathElement2 != nullptr)
|
||||
&& (pathElement5->asPath()->getEdges() & edgeMask2) == edgeMask2 && pathElement2 != nullptr)
|
||||
{
|
||||
pathConnections |= FOOTPATH_CONNECTION_N;
|
||||
}
|
||||
@@ -1526,9 +1526,9 @@ namespace OpenRCT2
|
||||
if (!(pathConnections
|
||||
& (FOOTPATH_CONNECTION_NE | FOOTPATH_CONNECTION_SE | FOOTPATH_CONNECTION_SW | FOOTPATH_CONNECTION_NW)))
|
||||
{
|
||||
uint8_t e = tileElement->asPath()->GetEdgesAndCorners();
|
||||
uint8_t e = tileElement->asPath()->getEdgesAndCorners();
|
||||
if ((e != 0b10101111) && (e != 0b01011111) && (e != 0b11101111))
|
||||
tileElement->asPath()->SetWide(true);
|
||||
tileElement->asPath()->setWide(true);
|
||||
}
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
}
|
||||
@@ -1536,7 +1536,7 @@ namespace OpenRCT2
|
||||
bool FootpathIsBlockedByVehicle(const TileCoordsXYZ& position)
|
||||
{
|
||||
auto pathElement = MapGetFirstTileElementWithBaseHeightBetween<PathElement>({ position, position.z + kPathHeightStep });
|
||||
return pathElement != nullptr && pathElement->IsBlockedByVehicle();
|
||||
return pathElement != nullptr && pathElement->isBlockedByVehicle();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1548,18 +1548,18 @@ namespace OpenRCT2
|
||||
const auto elementType = tileElement->getType();
|
||||
if (elementType == TileElementType::path)
|
||||
{
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
{
|
||||
FootpathQueueChainPush(tileElement->asPath()->GetRideIndex());
|
||||
FootpathQueueChainPush(tileElement->asPath()->getRideIndex());
|
||||
for (int32_t direction = 0; direction < kNumOrthogonalDirections; direction++)
|
||||
{
|
||||
if (tileElement->asPath()->GetEdges() & (1 << direction))
|
||||
if (tileElement->asPath()->getEdges() & (1 << direction))
|
||||
{
|
||||
FootpathChainRideQueue(
|
||||
RideId::GetNull(), StationIndex::FromUnderlying(0), footpathPos, tileElement, direction);
|
||||
}
|
||||
}
|
||||
tileElement->asPath()->SetRideIndex(RideId::GetNull());
|
||||
tileElement->asPath()->setRideIndex(RideId::GetNull());
|
||||
}
|
||||
}
|
||||
else if (elementType == TileElementType::entrance)
|
||||
@@ -1581,17 +1581,17 @@ namespace OpenRCT2
|
||||
static void FootpathRemoveEdgesTowardsHere(
|
||||
const CoordsXYZ& footpathPos, int32_t direction, TileElement* tileElement, bool isQueue)
|
||||
{
|
||||
if (tileElement->asPath()->IsQueue())
|
||||
if (tileElement->asPath()->isQueue())
|
||||
{
|
||||
FootpathQueueChainPush(tileElement->asPath()->GetRideIndex());
|
||||
FootpathQueueChainPush(tileElement->asPath()->getRideIndex());
|
||||
}
|
||||
|
||||
auto d = DirectionReverse(direction);
|
||||
tileElement->asPath()->SetEdges(tileElement->asPath()->GetEdges() & ~(1 << d));
|
||||
tileElement->asPath()->setEdges(tileElement->asPath()->getEdges() & ~(1 << d));
|
||||
int32_t cd = ((d - 1) & 3);
|
||||
tileElement->asPath()->SetCorners(tileElement->asPath()->GetCorners() & ~(1 << cd));
|
||||
tileElement->asPath()->setCorners(tileElement->asPath()->getCorners() & ~(1 << cd));
|
||||
cd = ((cd + 1) & 3);
|
||||
tileElement->asPath()->SetCorners(tileElement->asPath()->GetCorners() & ~(1 << cd));
|
||||
tileElement->asPath()->setCorners(tileElement->asPath()->getCorners() & ~(1 << cd));
|
||||
MapInvalidateTile({ footpathPos, tileElement->getBaseZ(), tileElement->getClearanceZ() });
|
||||
|
||||
if (isQueue)
|
||||
@@ -1610,11 +1610,11 @@ namespace OpenRCT2
|
||||
if (tileElement->getBaseZ() != targetFootPathPos.z)
|
||||
continue;
|
||||
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
break;
|
||||
|
||||
cd = ((shiftedDirection + 1) & 3);
|
||||
tileElement->asPath()->SetCorners(tileElement->asPath()->GetCorners() & ~(1 << cd));
|
||||
tileElement->asPath()->setCorners(tileElement->asPath()->getCorners() & ~(1 << cd));
|
||||
MapInvalidateTile({ targetFootPathPos, tileElement->getBaseZ(), tileElement->getClearanceZ() });
|
||||
break;
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
@@ -1641,9 +1641,9 @@ namespace OpenRCT2
|
||||
|
||||
if (footPathPos.clearanceZ == tileElement->getBaseZ())
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
uint8_t slope = tileElement->asPath()->GetSlopeDirection();
|
||||
uint8_t slope = tileElement->asPath()->getSlopeDirection();
|
||||
if (slope != direction)
|
||||
break;
|
||||
}
|
||||
@@ -1653,10 +1653,10 @@ namespace OpenRCT2
|
||||
|
||||
if (footPathPos.baseZ == tileElement->getBaseZ())
|
||||
{
|
||||
if (!tileElement->asPath()->IsSloped())
|
||||
if (!tileElement->asPath()->isSloped())
|
||||
break;
|
||||
|
||||
uint8_t slope = DirectionReverse(tileElement->asPath()->GetSlopeDirection());
|
||||
uint8_t slope = DirectionReverse(tileElement->asPath()->getSlopeDirection());
|
||||
if (slope != direction)
|
||||
break;
|
||||
|
||||
@@ -1684,16 +1684,16 @@ namespace OpenRCT2
|
||||
case TileElementType::path:
|
||||
if (tileElement->baseHeight == coords.z)
|
||||
{
|
||||
if (!tileElement->asPath()->IsSloped())
|
||||
if (!tileElement->asPath()->isSloped())
|
||||
// The footpath is flat, it can be connected to from any direction
|
||||
return true;
|
||||
if (tileElement->asPath()->GetSlopeDirection() == DirectionReverse(coords.direction))
|
||||
if (tileElement->asPath()->getSlopeDirection() == DirectionReverse(coords.direction))
|
||||
// The footpath is sloped and its lowest point matches the edge connection
|
||||
return true;
|
||||
}
|
||||
else if (tileElement->baseHeight + 2 == coords.z)
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped() && tileElement->asPath()->GetSlopeDirection() == coords.direction)
|
||||
if (tileElement->asPath()->isSloped() && tileElement->asPath()->getSlopeDirection() == coords.direction)
|
||||
// The footpath is sloped and its higher point matches the edge connection
|
||||
return true;
|
||||
}
|
||||
@@ -1768,9 +1768,9 @@ namespace OpenRCT2
|
||||
int32_t z1 = tileElement->baseHeight;
|
||||
if (tileElement->getType() == TileElementType::path)
|
||||
{
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
int32_t slope = tileElement->asPath()->GetSlopeDirection();
|
||||
int32_t slope = tileElement->asPath()->getSlopeDirection();
|
||||
// Sloped footpaths don't connect sideways
|
||||
if ((slope - direction) & 1)
|
||||
continue;
|
||||
@@ -1785,7 +1785,7 @@ namespace OpenRCT2
|
||||
// connected to.
|
||||
if (!TileElementWantsPathConnectionTowards({ TileCoordsXY{ footpathPos }, z1, direction }, tileElement))
|
||||
{
|
||||
bool isQueue = tileElement->getType() == TileElementType::path ? tileElement->asPath()->IsQueue() : false;
|
||||
bool isQueue = tileElement->getType() == TileElementType::path ? tileElement->asPath()->isQueue() : false;
|
||||
int32_t z0 = z1 - 2;
|
||||
FootpathRemoveEdgesTowards(
|
||||
{ footpathPos + CoordsDirectionDelta[direction], z0 * kCoordsZStep, z1 * kCoordsZStep }, direction,
|
||||
@@ -1794,7 +1794,7 @@ namespace OpenRCT2
|
||||
}
|
||||
|
||||
if (tileElement->getType() == TileElementType::path)
|
||||
tileElement->asPath()->SetEdgesAndCorners(0);
|
||||
tileElement->asPath()->setEdgesAndCorners(0);
|
||||
}
|
||||
|
||||
const FootpathObject* GetLegacyFootpathEntry(ObjectEntryIndex entryIndex)
|
||||
@@ -1815,59 +1815,59 @@ namespace OpenRCT2
|
||||
return objMgr.GetLoadedObject<FootpathRailingsObject>(entryIndex);
|
||||
}
|
||||
|
||||
RideId PathElement::GetRideIndex() const
|
||||
RideId PathElement::getRideIndex() const
|
||||
{
|
||||
return rideIndex;
|
||||
}
|
||||
|
||||
void PathElement::SetRideIndex(RideId newRideIndex)
|
||||
void PathElement::setRideIndex(RideId newRideIndex)
|
||||
{
|
||||
rideIndex = newRideIndex;
|
||||
}
|
||||
|
||||
uint8_t PathElement::GetAdditionStatus() const
|
||||
uint8_t PathElement::getAdditionStatus() const
|
||||
{
|
||||
return AdditionStatus;
|
||||
return additionStatus;
|
||||
}
|
||||
|
||||
void PathElement::SetAdditionStatus(uint8_t newStatus)
|
||||
void PathElement::setAdditionStatus(uint8_t newStatus)
|
||||
{
|
||||
AdditionStatus = newStatus;
|
||||
additionStatus = newStatus;
|
||||
}
|
||||
|
||||
uint8_t PathElement::GetEdges() const
|
||||
uint8_t PathElement::getEdges() const
|
||||
{
|
||||
return EdgesAndCorners & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
|
||||
return edgesAndCorners & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
|
||||
}
|
||||
|
||||
void PathElement::SetEdges(uint8_t newEdges)
|
||||
void PathElement::setEdges(uint8_t newEdges)
|
||||
{
|
||||
EdgesAndCorners &= ~FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
|
||||
EdgesAndCorners |= (newEdges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK);
|
||||
edgesAndCorners &= ~FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
|
||||
edgesAndCorners |= (newEdges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK);
|
||||
}
|
||||
|
||||
uint8_t PathElement::GetCorners() const
|
||||
uint8_t PathElement::getCorners() const
|
||||
{
|
||||
return EdgesAndCorners >> 4;
|
||||
return edgesAndCorners >> 4;
|
||||
}
|
||||
|
||||
void PathElement::SetCorners(uint8_t newCorners)
|
||||
void PathElement::setCorners(uint8_t newCorners)
|
||||
{
|
||||
EdgesAndCorners &= ~FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK;
|
||||
EdgesAndCorners |= (newCorners << 4);
|
||||
edgesAndCorners &= ~FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK;
|
||||
edgesAndCorners |= (newCorners << 4);
|
||||
}
|
||||
|
||||
uint8_t PathElement::GetEdgesAndCorners() const
|
||||
uint8_t PathElement::getEdgesAndCorners() const
|
||||
{
|
||||
return EdgesAndCorners;
|
||||
return edgesAndCorners;
|
||||
}
|
||||
|
||||
void PathElement::SetEdgesAndCorners(uint8_t newEdgesAndCorners)
|
||||
void PathElement::setEdgesAndCorners(uint8_t newEdgesAndCorners)
|
||||
{
|
||||
EdgesAndCorners = newEdgesAndCorners;
|
||||
edgesAndCorners = newEdgesAndCorners;
|
||||
}
|
||||
|
||||
bool PathElement::IsLevelCrossing(const CoordsXY& coords) const
|
||||
bool PathElement::isLevelCrossing(const CoordsXY& coords) const
|
||||
{
|
||||
auto trackElement = MapGetTrackElementAt({ coords, getBaseZ() });
|
||||
if (trackElement == nullptr)
|
||||
@@ -1891,9 +1891,9 @@ namespace OpenRCT2
|
||||
|
||||
bool FootpathIsZAndDirectionValid(const PathElement& pathElement, int32_t currentZ, int32_t currentDirection)
|
||||
{
|
||||
if (pathElement.IsSloped())
|
||||
if (pathElement.isSloped())
|
||||
{
|
||||
int32_t slopeDirection = pathElement.GetSlopeDirection();
|
||||
int32_t slopeDirection = pathElement.getSlopeDirection();
|
||||
if (slopeDirection == currentDirection)
|
||||
{
|
||||
if (currentZ != pathElement.baseHeight)
|
||||
|
||||
@@ -698,9 +698,9 @@ namespace OpenRCT2
|
||||
if (tileElement->getType() != TileElementType::path)
|
||||
continue;
|
||||
|
||||
uint8_t slopeDirection = tileElement->asPath()->GetSlopeDirection();
|
||||
uint8_t slopeDirection = tileElement->asPath()->getSlopeDirection();
|
||||
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
if (slopeDirection == faceDirection)
|
||||
{
|
||||
@@ -714,7 +714,7 @@ namespace OpenRCT2
|
||||
}
|
||||
else
|
||||
{
|
||||
if (loc.z == tileElement->baseHeight && (tileElement->asPath()->GetEdges() & (1 << faceDirection)))
|
||||
if (loc.z == tileElement->baseHeight && (tileElement->asPath()->getEdges() & (1 << faceDirection)))
|
||||
return true;
|
||||
}
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
@@ -1020,10 +1020,10 @@ namespace OpenRCT2
|
||||
switch (it.element->getType())
|
||||
{
|
||||
case TileElementType::path:
|
||||
if (it.element->asPath()->IsQueue())
|
||||
if (it.element->asPath()->isQueue())
|
||||
{
|
||||
it.element->asPath()->SetHasQueueBanner(false);
|
||||
it.element->asPath()->SetRideIndex(RideId::GetNull());
|
||||
it.element->asPath()->setHasQueueBanner(false);
|
||||
it.element->asPath()->setRideIndex(RideId::GetNull());
|
||||
}
|
||||
break;
|
||||
case TileElementType::entrance:
|
||||
|
||||
@@ -128,11 +128,11 @@ template<bool invalidate, bool invalidateAllViewports>
|
||||
static bool UpdatePathAnimation(
|
||||
const PathElement& path, const CoordsXYZ& loc, const int32_t baseZ, const Viewport* const viewport)
|
||||
{
|
||||
if (path.IsQueue() && path.HasQueueBanner())
|
||||
if (path.isQueue() && path.hasQueueBanner())
|
||||
{
|
||||
if constexpr (invalidate)
|
||||
{
|
||||
const int32_t direction = (path.GetQueueBannerDirection() + GetCurrentRotation()) & 3;
|
||||
const int32_t direction = (path.getQueueBannerDirection() + GetCurrentRotation()) & 3;
|
||||
if (direction == TILE_ELEMENT_DIRECTION_NORTH || direction == TILE_ELEMENT_DIRECTION_EAST)
|
||||
{
|
||||
Invalidate<invalidateAllViewports>(viewport, loc.x, loc.y, baseZ + 16, baseZ + 30, kMaxScrollingTextZoom);
|
||||
@@ -550,7 +550,7 @@ static std::optional<UpdateType> IsElementAnimated(const TileElementBase& elemen
|
||||
case TileElementType::path:
|
||||
{
|
||||
const auto* const path = element.asPath();
|
||||
if (path->HasQueueBanner())
|
||||
if (path->hasQueueBanner())
|
||||
{
|
||||
return std::optional(UpdateType::invalidate);
|
||||
}
|
||||
|
||||
@@ -140,9 +140,9 @@ void SceneryUpdateTile(const CoordsXY& sceneryPos)
|
||||
}
|
||||
else if (tileElement->getType() == TileElementType::path)
|
||||
{
|
||||
if (tileElement->asPath()->HasAddition() && !tileElement->asPath()->AdditionIsGhost())
|
||||
if (tileElement->asPath()->hasAddition() && !tileElement->asPath()->additionIsGhost())
|
||||
{
|
||||
auto* pathAddEntry = tileElement->asPath()->GetAdditionEntry();
|
||||
auto* pathAddEntry = tileElement->asPath()->getAdditionEntry();
|
||||
if (pathAddEntry != nullptr)
|
||||
{
|
||||
if (pathAddEntry->flags & PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_WATER)
|
||||
|
||||
@@ -217,15 +217,15 @@ namespace OpenRCT2::TileInspector
|
||||
switch (tileElement->getType())
|
||||
{
|
||||
case TileElementType::path:
|
||||
if (tileElement->asPath()->IsSloped())
|
||||
if (tileElement->asPath()->isSloped())
|
||||
{
|
||||
newRotation = (tileElement->asPath()->GetSlopeDirection() + 1) & kTileElementDirectionMask;
|
||||
tileElement->asPath()->SetSlopeDirection(newRotation);
|
||||
newRotation = (tileElement->asPath()->getSlopeDirection() + 1) & kTileElementDirectionMask;
|
||||
tileElement->asPath()->setSlopeDirection(newRotation);
|
||||
}
|
||||
pathEdges = tileElement->asPath()->GetEdges();
|
||||
pathCorners = tileElement->asPath()->GetCorners();
|
||||
tileElement->asPath()->SetEdges((pathEdges << 1) | (pathEdges >> 3));
|
||||
tileElement->asPath()->SetCorners((pathCorners << 1) | (pathCorners >> 3));
|
||||
pathEdges = tileElement->asPath()->getEdges();
|
||||
pathCorners = tileElement->asPath()->getCorners();
|
||||
tileElement->asPath()->setEdges((pathEdges << 1) | (pathEdges >> 3));
|
||||
tileElement->asPath()->setCorners((pathCorners << 1) | (pathCorners >> 3));
|
||||
break;
|
||||
case TileElementType::entrance:
|
||||
{
|
||||
@@ -583,7 +583,7 @@ namespace OpenRCT2::TileInspector
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
pathElement->asPath()->SetSloped(sloped);
|
||||
pathElement->asPath()->setSloped(sloped);
|
||||
}
|
||||
|
||||
return GameActions::Result();
|
||||
@@ -599,7 +599,7 @@ namespace OpenRCT2::TileInspector
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
pathElement->asPath()->SetJunctionRailings(hasJunctionRailings);
|
||||
pathElement->asPath()->setJunctionRailings(hasJunctionRailings);
|
||||
}
|
||||
|
||||
return GameActions::Result();
|
||||
@@ -614,7 +614,7 @@ namespace OpenRCT2::TileInspector
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
pathElement->asPath()->SetIsBroken(broken);
|
||||
pathElement->asPath()->setIsBroken(broken);
|
||||
}
|
||||
|
||||
return GameActions::Result();
|
||||
@@ -629,8 +629,8 @@ namespace OpenRCT2::TileInspector
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
uint8_t newEdges = pathElement->asPath()->GetEdgesAndCorners() ^ (1 << edgeIndex);
|
||||
pathElement->asPath()->SetEdgesAndCorners(newEdges);
|
||||
uint8_t newEdges = pathElement->asPath()->getEdgesAndCorners() ^ (1 << edgeIndex);
|
||||
pathElement->asPath()->setEdgesAndCorners(newEdges);
|
||||
}
|
||||
|
||||
return GameActions::Result();
|
||||
|
||||
@@ -21,289 +21,289 @@
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
bool PathElement::IsSloped() const
|
||||
bool PathElement::isSloped() const
|
||||
{
|
||||
return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED) != 0;
|
||||
return (flags2 & FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetSloped(bool isSloped)
|
||||
void PathElement::setSloped(bool isSloped)
|
||||
{
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED;
|
||||
if (isSloped)
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED;
|
||||
}
|
||||
|
||||
bool PathElement::HasJunctionRailings() const
|
||||
bool PathElement::hasJunctionRailings() const
|
||||
{
|
||||
return Flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS;
|
||||
return flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS;
|
||||
}
|
||||
|
||||
void PathElement::SetJunctionRailings(bool hasJunctionRailings)
|
||||
void PathElement::setJunctionRailings(bool hasJunctionRailings)
|
||||
{
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS;
|
||||
if (hasJunctionRailings)
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS;
|
||||
}
|
||||
|
||||
Direction PathElement::GetSlopeDirection() const
|
||||
Direction PathElement::getSlopeDirection() const
|
||||
{
|
||||
return SlopeDirection;
|
||||
return slopeDirection;
|
||||
}
|
||||
|
||||
void PathElement::SetSlopeDirection(Direction newSlope)
|
||||
void PathElement::setSlopeDirection(Direction newSlope)
|
||||
{
|
||||
SlopeDirection = newSlope;
|
||||
slopeDirection = newSlope;
|
||||
}
|
||||
|
||||
bool PathElement::IsQueue() const
|
||||
bool PathElement::isQueue() const
|
||||
{
|
||||
return (type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetIsQueue(bool isQueue)
|
||||
void PathElement::setIsQueue(bool isQueue)
|
||||
{
|
||||
type &= ~FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE;
|
||||
if (isQueue)
|
||||
type |= FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE;
|
||||
}
|
||||
|
||||
bool PathElement::HasQueueBanner() const
|
||||
bool PathElement::hasQueueBanner() const
|
||||
{
|
||||
return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER) != 0;
|
||||
return (flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetHasQueueBanner(bool hasQueueBanner)
|
||||
void PathElement::setHasQueueBanner(bool hasQueueBanner)
|
||||
{
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER;
|
||||
if (hasQueueBanner)
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER;
|
||||
}
|
||||
|
||||
bool PathElement::IsBroken() const
|
||||
bool PathElement::isBroken() const
|
||||
{
|
||||
return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN) != 0;
|
||||
return (flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetIsBroken(bool isBroken)
|
||||
void PathElement::setIsBroken(bool isBroken)
|
||||
{
|
||||
if (isBroken)
|
||||
{
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN;
|
||||
}
|
||||
}
|
||||
|
||||
bool PathElement::IsBlockedByVehicle() const
|
||||
bool PathElement::isBlockedByVehicle() const
|
||||
{
|
||||
return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE) != 0;
|
||||
return (flags2 & FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetIsBlockedByVehicle(bool isBlocked)
|
||||
void PathElement::setIsBlockedByVehicle(bool isBlocked)
|
||||
{
|
||||
if (isBlocked)
|
||||
{
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE;
|
||||
}
|
||||
}
|
||||
|
||||
::StationIndex PathElement::GetStationIndex() const
|
||||
::StationIndex PathElement::getStationIndex() const
|
||||
{
|
||||
return StationIndex;
|
||||
return stationIndex;
|
||||
}
|
||||
|
||||
void PathElement::SetStationIndex(::StationIndex newStationIndex)
|
||||
void PathElement::setStationIndex(::StationIndex newStationIndex)
|
||||
{
|
||||
StationIndex = newStationIndex;
|
||||
stationIndex = newStationIndex;
|
||||
}
|
||||
|
||||
bool PathElement::IsWide() const
|
||||
bool PathElement::isWide() const
|
||||
{
|
||||
return (type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetWide(bool isWide)
|
||||
void PathElement::setWide(bool isWide)
|
||||
{
|
||||
type &= ~FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE;
|
||||
if (isWide)
|
||||
type |= FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE;
|
||||
}
|
||||
|
||||
bool PathElement::HasAddition() const
|
||||
bool PathElement::hasAddition() const
|
||||
{
|
||||
return Additions != 0;
|
||||
return additions != 0;
|
||||
}
|
||||
|
||||
uint8_t PathElement::GetAddition() const
|
||||
uint8_t PathElement::getAddition() const
|
||||
{
|
||||
return Additions;
|
||||
return additions;
|
||||
}
|
||||
|
||||
ObjectEntryIndex PathElement::GetAdditionEntryIndex() const
|
||||
ObjectEntryIndex PathElement::getAdditionEntryIndex() const
|
||||
{
|
||||
// `Additions` is set to 0 when there is no addition, so the value 1 corresponds with path addition slot 0, etc.
|
||||
return GetAddition() - 1;
|
||||
return getAddition() - 1;
|
||||
}
|
||||
|
||||
const PathAdditionEntry* PathElement::GetAdditionEntry() const
|
||||
const PathAdditionEntry* PathElement::getAdditionEntry() const
|
||||
{
|
||||
if (!HasAddition())
|
||||
if (!hasAddition())
|
||||
return nullptr;
|
||||
return ObjectEntryManager::GetObjectEntry<PathAdditionEntry>(GetAdditionEntryIndex());
|
||||
return ObjectEntryManager::GetObjectEntry<PathAdditionEntry>(getAdditionEntryIndex());
|
||||
}
|
||||
|
||||
void PathElement::SetAddition(uint8_t newAddition)
|
||||
void PathElement::setAddition(uint8_t newAddition)
|
||||
{
|
||||
Additions = newAddition;
|
||||
additions = newAddition;
|
||||
}
|
||||
|
||||
void PathElement::SetAdditionEntryIndex(ObjectEntryIndex entryIndex)
|
||||
void PathElement::setAdditionEntryIndex(ObjectEntryIndex entryIndex)
|
||||
{
|
||||
// `Additions` is set to 0 when there is no addition, so the value 1 corresponds with path addition slot 0, etc.
|
||||
Additions = entryIndex + 1;
|
||||
additions = entryIndex + 1;
|
||||
}
|
||||
|
||||
bool PathElement::AdditionIsGhost() const
|
||||
bool PathElement::additionIsGhost() const
|
||||
{
|
||||
return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST) != 0;
|
||||
return (flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST) != 0;
|
||||
}
|
||||
|
||||
void PathElement::SetAdditionIsGhost(bool isGhost)
|
||||
void PathElement::setAdditionIsGhost(bool isGhost)
|
||||
{
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST;
|
||||
if (isGhost)
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST;
|
||||
}
|
||||
|
||||
ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const
|
||||
ObjectEntryIndex PathElement::getLegacyPathEntryIndex() const
|
||||
{
|
||||
if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY)
|
||||
return SurfaceIndex;
|
||||
if (flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY)
|
||||
return surfaceIndex;
|
||||
|
||||
return kObjectEntryIndexNull;
|
||||
}
|
||||
|
||||
const FootpathObject* PathElement::GetLegacyPathEntry() const
|
||||
const FootpathObject* PathElement::getLegacyPathEntry() const
|
||||
{
|
||||
return GetLegacyFootpathEntry(GetLegacyPathEntryIndex());
|
||||
return GetLegacyFootpathEntry(getLegacyPathEntryIndex());
|
||||
}
|
||||
|
||||
void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex)
|
||||
void PathElement::setLegacyPathEntryIndex(ObjectEntryIndex newIndex)
|
||||
{
|
||||
SurfaceIndex = newIndex;
|
||||
RailingsIndex = kObjectEntryIndexNull;
|
||||
Flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY;
|
||||
surfaceIndex = newIndex;
|
||||
railingsIndex = kObjectEntryIndexNull;
|
||||
flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY;
|
||||
}
|
||||
|
||||
bool PathElement::HasLegacyPathEntry() const
|
||||
bool PathElement::hasLegacyPathEntry() const
|
||||
{
|
||||
return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0;
|
||||
return (flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0;
|
||||
}
|
||||
|
||||
const PathSurfaceDescriptor* PathElement::GetSurfaceDescriptor() const
|
||||
const PathSurfaceDescriptor* PathElement::getSurfaceDescriptor() const
|
||||
{
|
||||
if (HasLegacyPathEntry())
|
||||
if (hasLegacyPathEntry())
|
||||
{
|
||||
const auto* legacyPathEntry = GetLegacyPathEntry();
|
||||
const auto* legacyPathEntry = getLegacyPathEntry();
|
||||
if (legacyPathEntry == nullptr)
|
||||
return nullptr;
|
||||
|
||||
if (IsQueue())
|
||||
if (isQueue())
|
||||
return &legacyPathEntry->GetQueueSurfaceDescriptor();
|
||||
|
||||
return &legacyPathEntry->GetPathSurfaceDescriptor();
|
||||
}
|
||||
|
||||
const auto* surfaceEntry = GetSurfaceEntry();
|
||||
const auto* surfaceEntry = getSurfaceEntry();
|
||||
if (surfaceEntry == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return &surfaceEntry->GetDescriptor();
|
||||
}
|
||||
|
||||
const PathRailingsDescriptor* PathElement::GetRailingsDescriptor() const
|
||||
const PathRailingsDescriptor* PathElement::getRailingsDescriptor() const
|
||||
{
|
||||
if (HasLegacyPathEntry())
|
||||
if (hasLegacyPathEntry())
|
||||
{
|
||||
const auto* legacyPathEntry = GetLegacyPathEntry();
|
||||
const auto* legacyPathEntry = getLegacyPathEntry();
|
||||
if (legacyPathEntry == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return &legacyPathEntry->GetPathRailingsDescriptor();
|
||||
}
|
||||
|
||||
const auto* railingsEntry = GetRailingsEntry();
|
||||
const auto* railingsEntry = getRailingsEntry();
|
||||
if (railingsEntry == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return &railingsEntry->GetDescriptor();
|
||||
}
|
||||
|
||||
ObjectEntryIndex PathElement::GetSurfaceEntryIndex() const
|
||||
ObjectEntryIndex PathElement::getSurfaceEntryIndex() const
|
||||
{
|
||||
if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY)
|
||||
if (flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY)
|
||||
return kObjectEntryIndexNull;
|
||||
|
||||
return SurfaceIndex;
|
||||
return surfaceIndex;
|
||||
}
|
||||
|
||||
const FootpathSurfaceObject* PathElement::GetSurfaceEntry() const
|
||||
const FootpathSurfaceObject* PathElement::getSurfaceEntry() const
|
||||
{
|
||||
auto& objMgr = GetContext()->GetObjectManager();
|
||||
return objMgr.GetLoadedObject<FootpathSurfaceObject>(GetSurfaceEntryIndex());
|
||||
return objMgr.GetLoadedObject<FootpathSurfaceObject>(getSurfaceEntryIndex());
|
||||
}
|
||||
|
||||
void PathElement::SetSurfaceEntryIndex(ObjectEntryIndex newIndex)
|
||||
void PathElement::setSurfaceEntryIndex(ObjectEntryIndex newIndex)
|
||||
{
|
||||
SurfaceIndex = newIndex;
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY;
|
||||
surfaceIndex = newIndex;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY;
|
||||
}
|
||||
|
||||
ObjectEntryIndex PathElement::GetRailingsEntryIndex() const
|
||||
ObjectEntryIndex PathElement::getRailingsEntryIndex() const
|
||||
{
|
||||
if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY)
|
||||
if (flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY)
|
||||
return kObjectEntryIndexNull;
|
||||
|
||||
return RailingsIndex;
|
||||
return railingsIndex;
|
||||
}
|
||||
|
||||
const FootpathRailingsObject* PathElement::GetRailingsEntry() const
|
||||
const FootpathRailingsObject* PathElement::getRailingsEntry() const
|
||||
{
|
||||
auto& objMgr = GetContext()->GetObjectManager();
|
||||
return objMgr.GetLoadedObject<FootpathRailingsObject>(GetRailingsEntryIndex());
|
||||
return objMgr.GetLoadedObject<FootpathRailingsObject>(getRailingsEntryIndex());
|
||||
}
|
||||
|
||||
void PathElement::SetRailingsEntryIndex(ObjectEntryIndex newIndex)
|
||||
void PathElement::setRailingsEntryIndex(ObjectEntryIndex newIndex)
|
||||
{
|
||||
RailingsIndex = newIndex;
|
||||
Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY;
|
||||
railingsIndex = newIndex;
|
||||
flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY;
|
||||
}
|
||||
|
||||
uint8_t PathElement::GetQueueBannerDirection() const
|
||||
uint8_t PathElement::getQueueBannerDirection() const
|
||||
{
|
||||
return ((type & FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK) >> 6);
|
||||
}
|
||||
|
||||
void PathElement::SetQueueBannerDirection(uint8_t direction)
|
||||
void PathElement::setQueueBannerDirection(uint8_t direction)
|
||||
{
|
||||
type &= ~FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK;
|
||||
type |= (direction << 6);
|
||||
}
|
||||
|
||||
bool PathElement::ShouldDrawPathOverSupports() const
|
||||
bool PathElement::shouldDrawPathOverSupports() const
|
||||
{
|
||||
// TODO: make this an actual decision of the tile element.
|
||||
const auto* const railings = GetRailingsDescriptor();
|
||||
const auto* const railings = getRailingsDescriptor();
|
||||
return railings != nullptr ? railings->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS : false;
|
||||
}
|
||||
|
||||
void PathElement::SetShouldDrawPathOverSupports(bool on)
|
||||
void PathElement::setShouldDrawPathOverSupports(bool on)
|
||||
{
|
||||
LOG_VERBOSE("Setting 'draw path over supports' to %d", static_cast<size_t>(on));
|
||||
}
|
||||
|
||||
@@ -55,92 +55,92 @@ namespace OpenRCT2
|
||||
static constexpr TileElementType kElementType = TileElementType::path;
|
||||
|
||||
private:
|
||||
ObjectEntryIndex SurfaceIndex; // 5
|
||||
ObjectEntryIndex RailingsIndex; // 7
|
||||
uint8_t Additions; // 9 (0 means no addition)
|
||||
uint8_t EdgesAndCorners; // 10 (edges in lower 4 bits, corners in upper 4)
|
||||
uint8_t Flags2; // 11
|
||||
uint8_t SlopeDirection; // 12
|
||||
ObjectEntryIndex surfaceIndex; // 5
|
||||
ObjectEntryIndex railingsIndex; // 7
|
||||
uint8_t additions; // 9 (0 means no addition)
|
||||
uint8_t edgesAndCorners; // 10 (edges in lower 4 bits, corners in upper 4)
|
||||
uint8_t flags2; // 11
|
||||
uint8_t slopeDirection; // 12
|
||||
union
|
||||
{
|
||||
uint8_t AdditionStatus; // 13, only used for litter bins
|
||||
uint8_t additionStatus; // 13, only used for litter bins
|
||||
RideId rideIndex; // 13
|
||||
};
|
||||
::StationIndex StationIndex; // 15
|
||||
::StationIndex stationIndex; // 15
|
||||
|
||||
public:
|
||||
ObjectEntryIndex GetLegacyPathEntryIndex() const;
|
||||
const FootpathObject* GetLegacyPathEntry() const;
|
||||
void SetLegacyPathEntryIndex(ObjectEntryIndex newIndex);
|
||||
bool HasLegacyPathEntry() const;
|
||||
ObjectEntryIndex getLegacyPathEntryIndex() const;
|
||||
const FootpathObject* getLegacyPathEntry() const;
|
||||
void setLegacyPathEntryIndex(ObjectEntryIndex newIndex);
|
||||
bool hasLegacyPathEntry() const;
|
||||
|
||||
ObjectEntryIndex GetSurfaceEntryIndex() const;
|
||||
const FootpathSurfaceObject* GetSurfaceEntry() const;
|
||||
void SetSurfaceEntryIndex(ObjectEntryIndex newIndex);
|
||||
ObjectEntryIndex getSurfaceEntryIndex() const;
|
||||
const FootpathSurfaceObject* getSurfaceEntry() const;
|
||||
void setSurfaceEntryIndex(ObjectEntryIndex newIndex);
|
||||
|
||||
ObjectEntryIndex GetRailingsEntryIndex() const;
|
||||
const FootpathRailingsObject* GetRailingsEntry() const;
|
||||
void SetRailingsEntryIndex(ObjectEntryIndex newIndex);
|
||||
ObjectEntryIndex getRailingsEntryIndex() const;
|
||||
const FootpathRailingsObject* getRailingsEntry() const;
|
||||
void setRailingsEntryIndex(ObjectEntryIndex newIndex);
|
||||
|
||||
const PathSurfaceDescriptor* GetSurfaceDescriptor() const;
|
||||
const PathRailingsDescriptor* GetRailingsDescriptor() const;
|
||||
const PathSurfaceDescriptor* getSurfaceDescriptor() const;
|
||||
const PathRailingsDescriptor* getRailingsDescriptor() const;
|
||||
|
||||
uint8_t GetQueueBannerDirection() const;
|
||||
void SetQueueBannerDirection(uint8_t direction);
|
||||
uint8_t getQueueBannerDirection() const;
|
||||
void setQueueBannerDirection(uint8_t direction);
|
||||
|
||||
bool IsSloped() const;
|
||||
void SetSloped(bool isSloped);
|
||||
bool isSloped() const;
|
||||
void setSloped(bool isSloped);
|
||||
|
||||
bool HasJunctionRailings() const;
|
||||
void SetJunctionRailings(bool hasJunctionRailings);
|
||||
bool hasJunctionRailings() const;
|
||||
void setJunctionRailings(bool hasJunctionRailings);
|
||||
|
||||
Direction GetSlopeDirection() const;
|
||||
void SetSlopeDirection(Direction newSlope);
|
||||
Direction getSlopeDirection() const;
|
||||
void setSlopeDirection(Direction newSlope);
|
||||
|
||||
RideId GetRideIndex() const;
|
||||
void SetRideIndex(RideId newRideIndex);
|
||||
RideId getRideIndex() const;
|
||||
void setRideIndex(RideId newRideIndex);
|
||||
|
||||
::StationIndex GetStationIndex() const;
|
||||
void SetStationIndex(::StationIndex newStationIndex);
|
||||
::StationIndex getStationIndex() const;
|
||||
void setStationIndex(::StationIndex newStationIndex);
|
||||
|
||||
bool IsWide() const;
|
||||
void SetWide(bool isWide);
|
||||
bool isWide() const;
|
||||
void setWide(bool isWide);
|
||||
|
||||
bool IsQueue() const;
|
||||
void SetIsQueue(bool isQueue);
|
||||
bool HasQueueBanner() const;
|
||||
void SetHasQueueBanner(bool hasQueueBanner);
|
||||
bool isQueue() const;
|
||||
void setIsQueue(bool isQueue);
|
||||
bool hasQueueBanner() const;
|
||||
void setHasQueueBanner(bool hasQueueBanner);
|
||||
|
||||
bool IsBroken() const;
|
||||
void SetIsBroken(bool isBroken);
|
||||
bool isBroken() const;
|
||||
void setIsBroken(bool isBroken);
|
||||
|
||||
bool IsBlockedByVehicle() const;
|
||||
void SetIsBlockedByVehicle(bool isBlocked);
|
||||
bool isBlockedByVehicle() const;
|
||||
void setIsBlockedByVehicle(bool isBlocked);
|
||||
|
||||
uint8_t GetEdges() const;
|
||||
void SetEdges(uint8_t newEdges);
|
||||
uint8_t GetCorners() const;
|
||||
void SetCorners(uint8_t newCorners);
|
||||
uint8_t GetEdgesAndCorners() const;
|
||||
void SetEdgesAndCorners(uint8_t newEdgesAndCorners);
|
||||
uint8_t getEdges() const;
|
||||
void setEdges(uint8_t newEdges);
|
||||
uint8_t getCorners() const;
|
||||
void setCorners(uint8_t newCorners);
|
||||
uint8_t getEdgesAndCorners() const;
|
||||
void setEdgesAndCorners(uint8_t newEdgesAndCorners);
|
||||
|
||||
bool HasAddition() const;
|
||||
uint8_t GetAddition() const;
|
||||
ObjectEntryIndex GetAdditionEntryIndex() const;
|
||||
const PathAdditionEntry* GetAdditionEntry() const;
|
||||
void SetAddition(uint8_t newAddition);
|
||||
void SetAdditionEntryIndex(ObjectEntryIndex entryIndex);
|
||||
bool hasAddition() const;
|
||||
uint8_t getAddition() const;
|
||||
ObjectEntryIndex getAdditionEntryIndex() const;
|
||||
const PathAdditionEntry* getAdditionEntry() const;
|
||||
void setAddition(uint8_t newAddition);
|
||||
void setAdditionEntryIndex(ObjectEntryIndex entryIndex);
|
||||
|
||||
bool AdditionIsGhost() const;
|
||||
void SetAdditionIsGhost(bool isGhost);
|
||||
bool additionIsGhost() const;
|
||||
void setAdditionIsGhost(bool isGhost);
|
||||
|
||||
uint8_t GetAdditionStatus() const;
|
||||
void SetAdditionStatus(uint8_t newStatus);
|
||||
uint8_t getAdditionStatus() const;
|
||||
void setAdditionStatus(uint8_t newStatus);
|
||||
|
||||
bool ShouldDrawPathOverSupports() const;
|
||||
void SetShouldDrawPathOverSupports(bool on);
|
||||
bool shouldDrawPathOverSupports() const;
|
||||
void setShouldDrawPathOverSupports(bool on);
|
||||
|
||||
bool IsLevelCrossing(const CoordsXY& coords) const;
|
||||
bool isLevelCrossing(const CoordsXY& coords) const;
|
||||
};
|
||||
static_assert(sizeof(PathElement) == kTileElementSize);
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace OpenRCT2
|
||||
case TileElementType::entrance:
|
||||
return asEntrance()->getRideIndex();
|
||||
case TileElementType::path:
|
||||
return asPath()->GetRideIndex();
|
||||
return asPath()->getRideIndex();
|
||||
default:
|
||||
return RideId::GetNull();
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ TEST_F(TileElementWantsFootpathConnection, SlopedPath)
|
||||
// Sloped paths only want to connect in two directions, of which is one at a higher offset
|
||||
const auto* slopedPathElement = MapGetFootpathElement(TileCoordsXYZ{ 18, 18, 14 }.ToCoordsXYZ());
|
||||
ASSERT_NE(slopedPathElement, nullptr);
|
||||
ASSERT_TRUE(slopedPathElement->asPath()->IsSloped());
|
||||
ASSERT_TRUE(slopedPathElement->asPath()->isSloped());
|
||||
// Bottom and top of sloped path want a path connection
|
||||
EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 18, 18, 14, 2 }, nullptr));
|
||||
EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 18, 18, 16, 0 }, nullptr));
|
||||
@@ -161,7 +161,7 @@ TEST_F(TileElementWantsFootpathConnection, MapEdge)
|
||||
// Calculate the connected edges and set the appropriate edge flags
|
||||
// FIXME: The footpath functions should only take PathElement and not TileElement.
|
||||
FootpathConnectEdges({ 16, 64 }, pathElement->as<TileElement>(), {});
|
||||
auto edges = pathElement->GetEdges();
|
||||
auto edges = pathElement->getEdges();
|
||||
|
||||
// The tiles alongside in the Y direction are both on the map edge so should be marked as an edge
|
||||
EXPECT_TRUE(edges & (1 << 1));
|
||||
|
||||
Reference in new issue
Block a user