mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Update TrackDefinition field names
This commit is contained in:
@@ -62,19 +62,19 @@ namespace OpenRCT2
|
||||
for (track_type_t trackType : DropdownOrder)
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!IsTrackEnabled(ted.definition.Type))
|
||||
if (!IsTrackEnabled(ted.definition.group))
|
||||
continue;
|
||||
bool entryIsDisabled;
|
||||
|
||||
// If the current build orientation (slope, bank, diagonal) matches the track element's, show the piece as enabled
|
||||
if (state == RideConstructionState::Back)
|
||||
{
|
||||
entryIsDisabled = ted.definition.PitchEnd != buildSlope || ted.definition.RollEnd != buildBank
|
||||
entryIsDisabled = ted.definition.pitchEnd != buildSlope || ted.definition.rollEnd != buildBank
|
||||
|| TrackPieceDirectionIsDiagonal(ted.coordinates.rotation_end) != buildDirectionIsDiagonal;
|
||||
}
|
||||
else
|
||||
{
|
||||
entryIsDisabled = ted.definition.PitchStart != buildSlope || ted.definition.RollStart != buildBank
|
||||
entryIsDisabled = ted.definition.pitchStart != buildSlope || ted.definition.rollStart != buildBank
|
||||
|| TrackPieceDirectionIsDiagonal(ted.coordinates.rotation_begin) != buildDirectionIsDiagonal;
|
||||
}
|
||||
|
||||
|
||||
@@ -2618,7 +2618,7 @@ static Widget _rideConstructionWidgets[] = {
|
||||
mapCoords.y = 4112 + (rotatedMapCoords.y / 2);
|
||||
mapCoords.z = 1024 + mapCoords.z;
|
||||
|
||||
auto previewZOffset = ted.definition.PreviewZOffset;
|
||||
auto previewZOffset = ted.definition.previewZOffset;
|
||||
mapCoords.z -= previewZOffset;
|
||||
|
||||
const ScreenCoordsXY rotatedScreenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), mapCoords);
|
||||
|
||||
@@ -453,7 +453,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ted.definition.RollStart == TrackRoll::None)
|
||||
if (ted.definition.rollStart == TrackRoll::None)
|
||||
{
|
||||
if (!(ted.coordinates.rotation_begin & 4))
|
||||
{
|
||||
@@ -478,7 +478,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ted.definition.RollEnd != TrackRoll::None)
|
||||
if (ted.definition.rollEnd != TrackRoll::None)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -680,8 +680,8 @@ void RideConstructionSetDefaultNextPiece()
|
||||
|
||||
ted = &GetTrackElementDescriptor(trackType);
|
||||
curve = ted->curveChain.next;
|
||||
auto bank = ted->definition.RollEnd;
|
||||
auto slope = ted->definition.PitchEnd;
|
||||
auto bank = ted->definition.rollEnd;
|
||||
auto slope = ted->definition.pitchEnd;
|
||||
|
||||
// Set track curve
|
||||
_currentTrackCurve = curve;
|
||||
@@ -729,8 +729,8 @@ void RideConstructionSetDefaultNextPiece()
|
||||
|
||||
ted = &GetTrackElementDescriptor(trackType);
|
||||
curve = ted->curveChain.previous;
|
||||
auto bank = ted->definition.RollStart;
|
||||
auto slope = ted->definition.PitchStart;
|
||||
auto bank = ted->definition.rollStart;
|
||||
auto slope = ted->definition.pitchStart;
|
||||
|
||||
// Set track curve
|
||||
_currentTrackCurve = curve;
|
||||
|
||||
@@ -44,13 +44,13 @@ using namespace OpenRCT2::TrackMetaData;
|
||||
PitchAndRoll TrackPitchAndRollStart(track_type_t trackType)
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
return { ted.definition.PitchStart, ted.definition.RollStart };
|
||||
return { ted.definition.pitchStart, ted.definition.rollStart };
|
||||
}
|
||||
|
||||
PitchAndRoll TrackPitchAndRollEnd(track_type_t trackType)
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
return { ted.definition.PitchEnd, ted.definition.RollEnd };
|
||||
return { ted.definition.pitchEnd, ted.definition.rollEnd };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,14 +60,14 @@ int32_t TrackIsConnectedByShape(TileElement* a, TileElement* b)
|
||||
{
|
||||
auto trackType = a->AsTrack()->GetTrackType();
|
||||
const auto* ted = &GetTrackElementDescriptor(trackType);
|
||||
auto aBank = ted->definition.RollEnd;
|
||||
auto aAngle = ted->definition.PitchEnd;
|
||||
auto aBank = ted->definition.rollEnd;
|
||||
auto aAngle = ted->definition.pitchEnd;
|
||||
aBank = TrackGetActualBank(a, aBank);
|
||||
|
||||
trackType = b->AsTrack()->GetTrackType();
|
||||
ted = &GetTrackElementDescriptor(trackType);
|
||||
auto bBank = ted->definition.RollStart;
|
||||
auto bAngle = ted->definition.PitchStart;
|
||||
auto bBank = ted->definition.rollStart;
|
||||
auto bAngle = ted->definition.pitchStart;
|
||||
bBank = TrackGetActualBank(b, bBank);
|
||||
|
||||
return aBank == bBank && aAngle == bAngle;
|
||||
@@ -601,7 +601,7 @@ TrackRoll TrackGetActualBank3(bool useInvertedSprites, TileElement* tileElement)
|
||||
{
|
||||
auto trackType = tileElement->AsTrack()->GetTrackType();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
auto bankStart = ted.definition.RollStart;
|
||||
auto bankStart = ted.definition.rollStart;
|
||||
auto ride = GetRide(tileElement->AsTrack()->GetRideIndex());
|
||||
if (ride == nullptr)
|
||||
return bankStart;
|
||||
|
||||
@@ -148,12 +148,12 @@ enum TrackGroup : uint8_t
|
||||
|
||||
struct TrackDefinition
|
||||
{
|
||||
TrackGroup Type;
|
||||
TrackPitch PitchEnd;
|
||||
TrackPitch PitchStart;
|
||||
TrackRoll RollEnd;
|
||||
TrackRoll RollStart;
|
||||
int8_t PreviewZOffset;
|
||||
TrackGroup group;
|
||||
TrackPitch pitchEnd;
|
||||
TrackPitch pitchStart;
|
||||
TrackRoll rollEnd;
|
||||
TrackRoll rollStart;
|
||||
int8_t previewZOffset;
|
||||
};
|
||||
|
||||
struct PitchAndRoll
|
||||
|
||||
@@ -6358,7 +6358,7 @@ static PitchAndRoll PitchAndRollStart(bool useInvertedSprites, TileElement* tile
|
||||
{
|
||||
auto trackType = tileElement->AsTrack()->GetTrackType();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
return PitchAndRoll{ ted.definition.PitchStart, TrackGetActualBank3(useInvertedSprites, tileElement) };
|
||||
return PitchAndRoll{ ted.definition.pitchStart, TrackGetActualBank3(useInvertedSprites, tileElement) };
|
||||
}
|
||||
|
||||
void Vehicle::UpdateGoKartAttemptSwitchLanes()
|
||||
@@ -7303,7 +7303,7 @@ static PitchAndRoll PitchAndRollEnd(const Ride& curRide, bool useInvertedSprites
|
||||
{
|
||||
bool isInverted = useInvertedSprites ^ tileElement->AsTrack()->IsInverted();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
return { ted.definition.PitchEnd, TrackGetActualBank2(curRide.type, isInverted, ted.definition.RollEnd) };
|
||||
return { ted.definition.pitchEnd, TrackGetActualBank2(curRide.type, isInverted, ted.definition.rollEnd) };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,13 +96,13 @@ int32_t ScTrackSegment::beginDirection_get() const
|
||||
int32_t ScTrackSegment::beginSlope_get() const
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(_type);
|
||||
return EnumValue(ted.definition.PitchStart);
|
||||
return EnumValue(ted.definition.pitchStart);
|
||||
}
|
||||
|
||||
int32_t ScTrackSegment::beginBank_get() const
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(_type);
|
||||
return EnumValue(ted.definition.RollStart);
|
||||
return EnumValue(ted.definition.rollStart);
|
||||
}
|
||||
|
||||
int32_t ScTrackSegment::endX_get() const
|
||||
@@ -132,13 +132,13 @@ int32_t ScTrackSegment::endDirection_get() const
|
||||
int32_t ScTrackSegment::endSlope_get() const
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(_type);
|
||||
return EnumValue(ted.definition.PitchEnd);
|
||||
return EnumValue(ted.definition.pitchEnd);
|
||||
}
|
||||
|
||||
int32_t ScTrackSegment::endBank_get() const
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(_type);
|
||||
return EnumValue(ted.definition.RollEnd);
|
||||
return EnumValue(ted.definition.rollEnd);
|
||||
}
|
||||
|
||||
int32_t ScTrackSegment::length_get() const
|
||||
@@ -268,7 +268,7 @@ int32_t ScTrackSegment::getTrackGroup() const
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(_type);
|
||||
|
||||
return ted.definition.Type;
|
||||
return ted.definition.group;
|
||||
}
|
||||
|
||||
std::string ScTrackSegment::getTrackCurvature() const
|
||||
|
||||
Reference in New Issue
Block a user