Rename fields of TrackDefinition

This commit is contained in:
Gymnasiast 2024-01-14 23:44:22 +01:00
parent 44d547a4bc
commit cffc55e165
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
10 changed files with 34 additions and 34 deletions

View File

@ -54,19 +54,19 @@ SpecialElementsDropdownState BuildSpecialElementsList(
for (track_type_t trackType : DropdownOrder)
{
const auto& ted = GetTrackElementDescriptor(trackType);
if (!IsTrackEnabled(ted.Definition.type))
if (!IsTrackEnabled(ted.Definition.Type))
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.vangle_end != buildSlope || ted.Definition.bank_end != buildBank
entryIsDisabled = ted.Definition.PitchEnd != buildSlope || ted.Definition.RollEnd != buildBank
|| TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_end) != buildDirectionIsDiagonal;
}
else
{
entryIsDisabled = ted.Definition.vangle_start != buildSlope || ted.Definition.bank_start != buildBank
entryIsDisabled = ted.Definition.PitchStart != buildSlope || ted.Definition.RollStart != buildBank
|| TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_begin) != buildDirectionIsDiagonal;
}

View File

@ -2562,7 +2562,7 @@ private:
mapCoords.y = 4112 + (rotatedMapCoords.y / 2);
mapCoords.z = 1024 + mapCoords.z;
int16_t previewZOffset = ted.Definition.preview_z_offset;
auto previewZOffset = ted.Definition.PreviewZOffset;
mapCoords.z -= previewZOffset;
const ScreenCoordsXY rotatedScreenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), mapCoords);

View File

@ -442,7 +442,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack(
return false;
}
if (ted.Definition.bank_start == TrackBank::None)
if (ted.Definition.RollStart == TrackBank::None)
{
if (!(ted.Coordinates.rotation_begin & 4))
{
@ -467,7 +467,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack(
return false;
}
if (ted.Definition.bank_end != TrackBank::None)
if (ted.Definition.RollEnd != TrackBank::None)
{
return false;
}

View File

@ -675,8 +675,8 @@ void RideConstructionSetDefaultNextPiece()
ted = &GetTrackElementDescriptor(trackType);
curve = ted->CurveChain.next;
auto bank = ted->Definition.bank_end;
auto slope = ted->Definition.vangle_end;
auto bank = ted->Definition.RollEnd;
auto slope = ted->Definition.PitchEnd;
// Set track curve
_currentTrackCurve = curve;
@ -723,8 +723,8 @@ void RideConstructionSetDefaultNextPiece()
ted = &GetTrackElementDescriptor(trackType);
curve = ted->CurveChain.previous;
auto bank = ted->Definition.bank_start;
auto slope = ted->Definition.vangle_start;
auto bank = ted->Definition.RollStart;
auto slope = ted->Definition.PitchStart;
// Set track curve
_currentTrackCurve = curve;

View File

@ -39,13 +39,13 @@ using namespace OpenRCT2::TrackMetaData;
PitchAndRoll TrackPitchAndRollStart(track_type_t trackType)
{
const auto& ted = GetTrackElementDescriptor(trackType);
return { ted.Definition.vangle_start, ted.Definition.bank_start };
return { ted.Definition.PitchStart, ted.Definition.RollStart };
}
PitchAndRoll TrackPitchAndRollEnd(track_type_t trackType)
{
const auto& ted = GetTrackElementDescriptor(trackType);
return { ted.Definition.vangle_end, ted.Definition.bank_end };
return { ted.Definition.PitchEnd, ted.Definition.RollEnd };
}
/**
@ -55,14 +55,14 @@ int32_t TrackIsConnectedByShape(TileElement* a, TileElement* b)
{
auto trackType = a->AsTrack()->GetTrackType();
const auto* ted = &GetTrackElementDescriptor(trackType);
auto aBank = ted->Definition.bank_end;
auto aAngle = ted->Definition.vangle_end;
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.bank_start;
auto bAngle = ted->Definition.vangle_start;
auto bBank = ted->Definition.RollStart;
auto bAngle = ted->Definition.PitchStart;
bBank = TrackGetActualBank(b, bBank);
return aBank == bBank && aAngle == bAngle;
@ -596,7 +596,7 @@ TrackBank TrackGetActualBank3(bool useInvertedSprites, TileElement* tileElement)
{
auto trackType = tileElement->AsTrack()->GetTrackType();
const auto& ted = GetTrackElementDescriptor(trackType);
auto bankStart = ted.Definition.bank_start;
auto bankStart = ted.Definition.RollStart;
auto ride = GetRide(tileElement->AsTrack()->GetRideIndex());
if (ride == nullptr)
return bankStart;

View File

@ -50,12 +50,12 @@ enum class TrackPitch : uint8_t
struct TrackDefinition
{
track_type_t type;
TrackPitch vangle_end;
TrackPitch vangle_start;
TrackBank bank_end;
TrackBank bank_start;
int8_t preview_z_offset;
track_type_t Type;
TrackPitch PitchEnd;
TrackPitch PitchStart;
TrackBank RollEnd;
TrackBank RollStart;
int8_t PreviewZOffset;
};
struct PitchAndRoll

View File

@ -27,10 +27,10 @@ struct TrackDescriptor
{
bool starts_diagonal;
TrackPitch slope_start;
TrackBank bank_start;
TrackBank RollStart;
TrackCurve track_curve;
TrackPitch slope_end;
TrackBank bank_end;
TrackBank RollEnd;
track_type_t track_element;
};

View File

@ -6931,7 +6931,7 @@ static PitchAndRoll PitchAndRollStart(bool useInvertedSprites, TileElement* tile
{
auto trackType = tileElement->AsTrack()->GetTrackType();
const auto& ted = GetTrackElementDescriptor(trackType);
return PitchAndRoll{ ted.Definition.vangle_start, TrackGetActualBank3(useInvertedSprites, tileElement) };
return PitchAndRoll{ ted.Definition.PitchStart, TrackGetActualBank3(useInvertedSprites, tileElement) };
}
void Vehicle::UpdateGoKartAttemptSwitchLanes()
@ -7873,7 +7873,7 @@ static PitchAndRoll PitchAndRollEnd(const Ride& curRide, bool useInvertedSprites
{
bool isInverted = useInvertedSprites ^ tileElement->AsTrack()->IsInverted();
const auto& ted = GetTrackElementDescriptor(trackType);
return { ted.Definition.vangle_end, TrackGetActualBank2(curRide.type, isInverted, ted.Definition.bank_end) };
return { ted.Definition.PitchEnd, TrackGetActualBank2(curRide.type, isInverted, ted.Definition.RollEnd) };
}
/**

View File

@ -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.vangle_start);
return EnumValue(ted.Definition.PitchStart);
}
int32_t ScTrackSegment::beginBank_get() const
{
const auto& ted = GetTrackElementDescriptor(_type);
return EnumValue(ted.Definition.bank_start);
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.vangle_end);
return EnumValue(ted.Definition.PitchEnd);
}
int32_t ScTrackSegment::endBank_get() const
{
const auto& ted = GetTrackElementDescriptor(_type);
return EnumValue(ted.Definition.bank_end);
return EnumValue(ted.Definition.RollEnd);
}
int32_t ScTrackSegment::length_get() const
@ -269,7 +269,7 @@ int32_t ScTrackSegment::getTrackGroup() const
{
const auto& ted = GetTrackElementDescriptor(_type);
return ted.Definition.type;
return ted.Definition.Type;
}
std::string ScTrackSegment::getTrackCurvature() const

View File

@ -167,9 +167,9 @@ static std::tuple<bool, track_type_t> window_ride_construction_update_state_get_
continue;
if (trackDescriptor->slope_end != endSlope)
continue;
if (trackDescriptor->bank_start != startBank)
if (trackDescriptor->RollStart != startBank)
continue;
if (trackDescriptor->bank_end != endBank)
if (trackDescriptor->RollEnd != endBank)
continue;
return std::make_tuple(true, trackDescriptor->track_element);