mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add TrackTypeIsBooster method (#21033)
This commit is contained in:
parent
baf88ef490
commit
ccb3fa172c
|
@ -1480,8 +1480,8 @@ public:
|
||||||
if (_currentlyShowingBrakeOrBoosterSpeed)
|
if (_currentlyShowingBrakeOrBoosterSpeed)
|
||||||
{
|
{
|
||||||
uint16_t brakeSpeed2 = ((_currentBrakeSpeed2 * 9) >> 2) & 0xFFFF;
|
uint16_t brakeSpeed2 = ((_currentBrakeSpeed2 * 9) >> 2) & 0xFFFF;
|
||||||
if (_selectedTrackType == TrackElemType::Booster
|
if (TrackTypeIsBooster(_selectedTrackType)
|
||||||
|| _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::Booster))
|
|| TrackTypeIsBooster(_currentTrackCurve & ~RideConstructionSpecialPieceSelected))
|
||||||
{
|
{
|
||||||
brakeSpeed2 = GetBoosterSpeed(currentRide->type, brakeSpeed2);
|
brakeSpeed2 = GetBoosterSpeed(currentRide->type, brakeSpeed2);
|
||||||
}
|
}
|
||||||
|
@ -1837,8 +1837,8 @@ public:
|
||||||
|
|
||||||
bool trackHasSpeedSetting = TrackTypeHasSpeedSetting(_selectedTrackType)
|
bool trackHasSpeedSetting = TrackTypeHasSpeedSetting(_selectedTrackType)
|
||||||
|| TrackTypeHasSpeedSetting(_currentTrackCurve & ~RideConstructionSpecialPieceSelected);
|
|| TrackTypeHasSpeedSetting(_currentTrackCurve & ~RideConstructionSpecialPieceSelected);
|
||||||
bool boosterTrackSelected = _selectedTrackType == TrackElemType::Booster
|
bool boosterTrackSelected = TrackTypeIsBooster(_selectedTrackType)
|
||||||
|| _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::Booster);
|
|| TrackTypeIsBooster(_currentTrackCurve & ~RideConstructionSpecialPieceSelected);
|
||||||
|
|
||||||
// Only necessary because TD6 writes speed and seat rotation to the same bits. Remove for new track design format.
|
// Only necessary because TD6 writes speed and seat rotation to the same bits. Remove for new track design format.
|
||||||
bool trackHasSpeedAndSeatRotation = _selectedTrackType == TrackElemType::BlockBrakes
|
bool trackHasSpeedAndSeatRotation = _selectedTrackType == TrackElemType::BlockBrakes
|
||||||
|
|
|
@ -635,6 +635,11 @@ bool TrackTypeIsBlockBrakes(track_type_t trackType)
|
||||||
return (trackType == TrackElemType::BlockBrakes) || (trackType == TrackElemType::DiagBlockBrakes);
|
return (trackType == TrackElemType::BlockBrakes) || (trackType == TrackElemType::DiagBlockBrakes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TrackTypeIsBooster(track_type_t trackType)
|
||||||
|
{
|
||||||
|
return trackType == TrackElemType::Booster;
|
||||||
|
}
|
||||||
|
|
||||||
bool TrackElementIsCovered(track_type_t trackElementType)
|
bool TrackElementIsCovered(track_type_t trackElementType)
|
||||||
{
|
{
|
||||||
switch (trackElementType)
|
switch (trackElementType)
|
||||||
|
@ -666,7 +671,7 @@ bool TrackElementIsCovered(track_type_t trackElementType)
|
||||||
|
|
||||||
bool TrackTypeHasSpeedSetting(track_type_t trackType)
|
bool TrackTypeHasSpeedSetting(track_type_t trackType)
|
||||||
{
|
{
|
||||||
return trackType == TrackElemType::Booster || TrackTypeIsBrakes(trackType) || TrackTypeIsBlockBrakes(trackType);
|
return TrackTypeIsBooster(trackType) || TrackTypeIsBrakes(trackType) || TrackTypeIsBlockBrakes(trackType);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TrackTypeIsHelix(track_type_t trackType)
|
bool TrackTypeIsHelix(track_type_t trackType)
|
||||||
|
|
|
@ -682,6 +682,7 @@ bool TrackElementIsCovered(track_type_t trackElementType);
|
||||||
bool TrackTypeIsStation(track_type_t trackType);
|
bool TrackTypeIsStation(track_type_t trackType);
|
||||||
bool TrackTypeIsBrakes(track_type_t trackType);
|
bool TrackTypeIsBrakes(track_type_t trackType);
|
||||||
bool TrackTypeIsBlockBrakes(track_type_t trackType);
|
bool TrackTypeIsBlockBrakes(track_type_t trackType);
|
||||||
|
bool TrackTypeIsBooster(track_type_t trackType);
|
||||||
|
|
||||||
std::optional<CoordsXYZ> GetTrackElementOriginAndApplyChanges(
|
std::optional<CoordsXYZ> GetTrackElementOriginAndApplyChanges(
|
||||||
const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags);
|
const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags);
|
||||||
|
|
Loading…
Reference in New Issue