Rename GetBrakeClosed() to IsBrakeClosed()

This commit is contained in:
spacek531 authored and GitHub committed 2022-12-31 14:06:22 +01:00
1 parent 0ce84204b7
commit 09c8e4755f
27 files changed
+72 -60

No files matched your search

+1
View File
@@ -3641,6 +3641,7 @@ STR_6535 :{WINDOW_COLOUR_2}Nausea Factor: {BLACK}-{COMMA16}%
STR_6536 :This park was saved in a later version of OpenRCT2. The park was saved in v{INT32}, you are currently on v{INT32}.
STR_6537 :Allow using regular paths as queue
STR_6538 :Shows regular paths in the queues dropdown of the Footpaths window.
STR_6539 :Brake Closed
#############
# Scenarios #
+12 -9
View File
@@ -121,7 +121,7 @@ enum WindowTileInspectorWidgetIdx
WIDX_TRACK_SPINNER_HEIGHT_INCREASE,
WIDX_TRACK_SPINNER_HEIGHT_DECREASE,
WIDX_TRACK_CHECK_CHAIN_LIFT,
WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED,
WIDX_TRACK_CHECK_BRAKE_CLOSED,
WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE,
// Scenery
@@ -316,7 +316,7 @@ static rct_widget TrackWidgets[] = {
MakeWidget(PropertyRowCol({ 12, 0}, 0, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_ENTIRE_TRACK_PIECE), // WIDX_TRACK_CHECK_APPLY_TO_ALL
MakeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 1, 1), PropertyButtonSize, WindowWidgetType::Spinner, WindowColour::Secondary), // WIDX_TRACK_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
MakeWidget(PropertyRowCol({ 12, 0}, 2, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_CHAIN_LIFT), // WIDX_TRACK_CHECK_CHAIN_LIFT
MakeWidget(PropertyRowCol({ 12, 0}, 3, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_BLOCK_BRAKE), // WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED
MakeWidget(PropertyRowCol({ 12, 0}, 3, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED), // WIDX_TRACK_CHECK_BRAKE_CLOSED
MakeWidget(PropertyRowCol({ 12, 0}, 4, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_IS_INDESTRUCTIBLE), // WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE
WIDGETS_END,
};
@@ -644,8 +644,8 @@ public:
break;
}
case WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED:
TrackSetBlockBrake(windowTileInspectorSelectedIndex, !tileElement->AsTrack()->BlockBrakeClosed());
case WIDX_TRACK_CHECK_BRAKE_CLOSED:
TrackSetBrakeClosed(windowTileInspectorSelectedIndex, !tileElement->AsTrack()->IsBrakeClosed());
break;
case WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE:
@@ -1916,9 +1916,9 @@ private:
GameActions::Execute(&modifyTile);
}
void TrackSetBlockBrake(int32_t elementIndex, bool blockBrake)
void TrackSetBrakeClosed(int32_t elementIndex, bool isClosed)
{
auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackSetBlockBrake, elementIndex, blockBrake);
auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackSetBrake, elementIndex, isClosed);
GameActions::Execute(&modifyTile);
}
@@ -2176,13 +2176,16 @@ private:
widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 1) - 4;
widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].top = GBBT(propertiesAnchor, 2);
widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].bottom = GBBB(propertiesAnchor, 2);
widgets[WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED].top = GBBT(propertiesAnchor, 3);
widgets[WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED].bottom = GBBB(propertiesAnchor, 3);
widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].top = GBBT(propertiesAnchor, 3);
widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].bottom = GBBB(propertiesAnchor, 3);
widgets[WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE].top = GBBT(propertiesAnchor, 4);
widgets[WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE].bottom = GBBB(propertiesAnchor, 4);
SetCheckboxValue(WIDX_TRACK_CHECK_APPLY_TO_ALL, _applyToAll);
SetCheckboxValue(WIDX_TRACK_CHECK_CHAIN_LIFT, tileElement->AsTrack()->HasChain());
SetCheckboxValue(WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED, tileElement->AsTrack()->BlockBrakeClosed());
SetCheckboxValue(WIDX_TRACK_CHECK_BRAKE_CLOSED, tileElement->AsTrack()->IsBrakeClosed());
widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].content = tileElement->AsTrack()->IsBlockStart()
? STR_TILE_INSPECTOR_TRACK_BLOCK_BRAKE
: STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED;
SetCheckboxValue(WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE, tileElement->AsTrack()->IsIndestructible());
break;
+3 -3
View File
@@ -183,11 +183,11 @@ GameActions::Result TileModifyAction::QueryExecute(bool isExecuting) const
res = TileInspector::TrackSetChain(_loc, elementIndex, false, setChain, isExecuting);
break;
}
case TileModifyType::TrackSetBlockBrake:
case TileModifyType::TrackSetBrake:
{
const auto elementIndex = _value1;
const bool blockBrake = _value2;
res = TileInspector::TrackSetBlockBrake(_loc, elementIndex, blockBrake, isExecuting);
const bool isClosed = _value2;
res = TileInspector::TrackSetBrakeClosed(_loc, elementIndex, isClosed, isExecuting);
break;
}
case TileModifyType::TrackSetIndestructible:
+1 -1
View File
@@ -32,7 +32,7 @@ enum class TileModifyType : uint8_t
TrackBaseHeightOffset,
TrackSetChain,
TrackSetChainBlock,
TrackSetBlockBrake,
TrackSetBrake,
TrackSetIndestructible,
ScenerySetQuarterLocation,
ScenerySetQuarterCollision,
+2
View File
@@ -3931,6 +3931,8 @@ enum : uint16_t
STR_CHEAT_ALLOW_PATH_AS_QUEUE = 6537,
STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP = 6538,
STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED = 6539,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
};
+1 -1
View File
@@ -466,7 +466,7 @@ private:
struct
{
// The lower 4 bits are the track sequence.
// The upper 4 bits are either station bits or on-ride photo bits.
// The upper 4 bits are either station bits, brake speed bits, or on-ride photo bits.
//
// Station bits:
// - Bit 8 marks green light
+1 -1
View File
@@ -1414,7 +1414,7 @@ namespace RCT2
dst2->SetInverted(src2->IsInverted());
dst2->SetStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex()));
dst2->SetHasGreenLight(src2->HasGreenLight());
dst2->SetBlockBrakeClosed(src2->BlockBrakeClosed());
dst2->SetBrakeClosed(src2->BlockBrakeClosed());
dst2->SetIsIndestructible(src2->IsIndestructible());
// Skipping IsHighlighted()
+8 -3
View File
@@ -3033,7 +3033,7 @@ static void RideOpenBlockBrakes(const CoordsXYE& startElement)
case TrackElemType::DiagUp25ToFlat:
case TrackElemType::DiagUp60ToFlat:
case TrackElemType::BlockBrakes:
currentElement.element->AsTrack()->SetBlockBrakeClosed(false);
currentElement.element->AsTrack()->SetBrakeClosed(false);
break;
}
} while (track_block_get_next(&currentElement, &currentElement, nullptr, nullptr)
@@ -3559,6 +3559,10 @@ void Ride::MoveTrainsToBlockBrakes(TrackElement* firstBlock)
if (train == nullptr)
continue;
// At this point, all vehicles have state of MovingToEndOfStation, which slowly moves forward at a constant speed
// regardless of incline. The first vehicle stops at the station immediately, while all other vehicles seek forward
// until they reach a closed block brake. The block brake directly before the station is set to closed every frame
// because the trains will open the block brake when the tail leaves the station.
train->UpdateTrackMotion(nullptr);
if (i == 0)
@@ -3577,7 +3581,7 @@ void Ride::MoveTrainsToBlockBrakes(TrackElement* firstBlock)
break;
}
firstBlock->SetBlockBrakeClosed(true);
firstBlock->SetBrakeClosed(true);
for (Vehicle* car = train; car != nullptr; car = GetEntity<Vehicle>(car->next_vehicle_on_train))
{
car->velocity = 0;
@@ -3587,7 +3591,8 @@ void Ride::MoveTrainsToBlockBrakes(TrackElement* firstBlock)
}
} while (!(train->UpdateTrackMotion(nullptr) & VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_AT_BLOCK_BRAKE));
firstBlock->SetBlockBrakeClosed(true);
// All vehicles are in position, set the block brake directly before the station one last time
firstBlock->SetBrakeClosed(true);
for (Vehicle* car = train; car != nullptr; car = GetEntity<Vehicle>(car->next_vehicle_on_train))
{
car->ClearUpdateFlag(VEHICLE_UPDATE_FLAG_COLLISION_DISABLED);
+1 -1
View File
@@ -61,7 +61,7 @@ static void ride_update_station_blocksection(Ride* ride, StationIndex stationInd
auto& station = ride->GetStation(stationIndex);
if ((ride->status == RideStatus::Closed && ride->num_riders == 0)
|| (tileElement != nullptr && tileElement->AsTrack()->BlockBrakeClosed()))
|| (tileElement != nullptr && tileElement->AsTrack()->IsBrakeClosed()))
{
station.Depart &= ~STATION_DEPART_FLAG;
+5 -5
View File
@@ -852,20 +852,20 @@ void TrackElement::SetInverted(bool inverted)
}
}
bool TrackElement::BlockBrakeClosed() const
bool TrackElement::IsBrakeClosed() const
{
return (Flags2 & TRACK_ELEMENT_FLAGS2_BLOCK_BRAKE_CLOSED) != 0;
return (Flags2 & TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED) != 0;
}
void TrackElement::SetBlockBrakeClosed(bool isClosed)
void TrackElement::SetBrakeClosed(bool isClosed)
{
if (isClosed)
{
Flags2 |= TRACK_ELEMENT_FLAGS2_BLOCK_BRAKE_CLOSED;
Flags2 |= TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED;
}
else
{
Flags2 &= ~TRACK_ELEMENT_FLAGS2_BLOCK_BRAKE_CLOSED;
Flags2 &= ~TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED;
}
}
+1 -1
View File
@@ -94,7 +94,7 @@ enum
TRACK_ELEMENT_FLAGS2_CABLE_LIFT = 1 << 2,
TRACK_ELEMENT_FLAGS2_HIGHLIGHT = 1 << 3,
TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT = 1 << 4,
TRACK_ELEMENT_FLAGS2_BLOCK_BRAKE_CLOSED = 1 << 5,
TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED = 1 << 5,
TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE = 1 << 6,
};
+6 -5
View File
@@ -6128,14 +6128,14 @@ void Vehicle::CheckAndApplyBlockSectionStopSite()
switch (trackType)
{
case TrackElemType::BlockBrakes:
if (curRide->IsBlockSectioned() && trackElement->AsTrack()->BlockBrakeClosed())
if (curRide->IsBlockSectioned() && trackElement->AsTrack()->IsBrakeClosed())
ApplyStopBlockBrake();
else
ApplyNonStopBlockBrake();
break;
case TrackElemType::EndStation:
if (trackElement->AsTrack()->BlockBrakeClosed())
if (trackElement->AsTrack()->IsBrakeClosed())
_vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_AT_BLOCK_BRAKE;
break;
@@ -6148,7 +6148,7 @@ void Vehicle::CheckAndApplyBlockSectionStopSite()
{
if (trackType == TrackElemType::CableLiftHill || trackElement->AsTrack()->HasChain())
{
if (trackElement->AsTrack()->BlockBrakeClosed())
if (trackElement->AsTrack()->IsBrakeClosed())
{
ApplyStopBlockBrake();
}
@@ -6236,7 +6236,7 @@ static void block_brakes_open_previous_section(Ride& ride, const CoordsXYZ& vehi
{
return;
}
trackElement->SetBlockBrakeClosed(false);
trackElement->SetBrakeClosed(false);
MapInvalidateElement(location, reinterpret_cast<TileElement*>(trackElement));
auto trackType = trackElement->GetTrackType();
@@ -7411,7 +7411,8 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, Ride* cur
{
if (next_vehicle_on_train.IsNull())
{
tileElement->AsTrack()->SetBlockBrakeClosed(true);
tileElement->AsTrack()->SetBrakeClosed(true);
if (trackType == TrackElemType::BlockBrakes || trackType == TrackElemType::EndStation)
{
if (!(rideEntry->Cars[0].flags & CAR_ENTRY_FLAG_POWERED))
@@ -3772,7 +3772,7 @@ static void bobsleigh_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
switch (direction)
{
case 0:
@@ -92,7 +92,7 @@ static void bolliger_mabillard_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction,
session.TrackColours[SCHEME_TRACK].WithIndex(_BolligerMabillardBlockBrakeImages[direction][isClosed]),
@@ -9221,7 +9221,7 @@ static void bolliger_mabillard_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
switch (direction)
{
case 0:
@@ -107,7 +107,7 @@ static void corkscrew_rc_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_CorkscrewRCBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 3 });
@@ -8901,7 +8901,7 @@ static void corkscrew_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_CorkscrewRCBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 3 }, { 0, 6, height });
+2 -2
View File
@@ -137,7 +137,7 @@ static void giga_rc_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_GigaCoasterBrakeImages[direction][isClosed][0]),
{ 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 3 });
@@ -8100,7 +8100,7 @@ static void giga_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_GigaCoasterBrakeImages[direction][isClosed][0]),
{ 0, 0, height }, { 32, 20, 3 }, { 0, 6, height });
@@ -1838,7 +1838,7 @@ void junior_rc_paint_station(
{
ImageId imageId;
bool isBraked = trackElement.BlockBrakeClosed();
bool isBraked = trackElement.IsBrakeClosed();
if (direction == 0 || direction == 2)
{
@@ -3877,7 +3877,7 @@ static void junior_rc_block_brake_paint_setup(
{
ImageId image_id;
bool isBraked = trackElement.BlockBrakeClosed();
bool isBraked = trackElement.IsBrakeClosed();
image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_block_brake[isBraked][direction]);
if (direction & 1)
@@ -44,7 +44,7 @@ static void lim_launched_rc_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_LimLauncherBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 3 });
@@ -1748,7 +1748,7 @@ static void lim_launched_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_LimLauncherBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 3 }, { 0, 6, height });
@@ -107,7 +107,7 @@ static void mine_train_rc_track_station(
{ 32, 28, 1 }, { 0, 2, height });
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsChildRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_MineTrainBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 1 }, { 0, 0, height });
@@ -7505,7 +7505,7 @@ static void mine_train_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_MineTrainBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 1 }, { 0, 6, height });
@@ -125,7 +125,7 @@ static void mini_rc_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_MiniRCBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 3 });
@@ -7704,7 +7704,7 @@ static void mini_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_MiniRCBlockBrakeImages[direction][isClosed]),
{ 0, 0, height }, { 32, 20, 3 }, { 0, 6, height });
@@ -135,7 +135,7 @@ static void multi_dimension_rc_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
uint8_t offset = isClosed ? 2 : 1;
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][offset]), { 0, 0, height },
@@ -12442,7 +12442,7 @@ static void multi_dimension_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
if (!trackElement.IsInverted())
{
@@ -101,7 +101,7 @@ static void stand_up_rc_track_station(
if (trackElement.GetTrackType() == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_StandUpBlockBrakeImages[direction][isClosed]),
{ 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 });
@@ -8754,7 +8754,7 @@ static void stand_up_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsParentRotated(
session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_StandUpBlockBrakeImages[direction][isClosed]),
{ 0, 6, height }, { 32, 20, 3 });
+2 -2
View File
@@ -205,7 +205,7 @@ static void wild_mouse_track_station(
{ 32, 28, 2 }, { 0, 2, height });
if (trackType == TrackElemType::EndStation)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
PaintAddImageAsChildRotated(
session, direction,
session.TrackColours[SCHEME_TRACK].WithIndex(_wild_mouse_block_brakes_image_ids[direction][isClosed]),
@@ -921,7 +921,7 @@ static void wild_mouse_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
bool isClosed = trackElement.BlockBrakeClosed();
bool isClosed = trackElement.IsBrakeClosed();
auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(_wild_mouse_block_brakes_image_ids[direction][isClosed]);
PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height });
if (track_paint_util_should_paint_supports(session.MapPosition))
@@ -497,8 +497,8 @@ static void wooden_rc_track_station(
int32_t trackType = trackElement.GetTrackType();
if (trackType == TrackElemType::EndStation)
{
const auto brakeImg = trackElement.BlockBrakeClosed() ? _wooden_rc_station_block_brakes_image_ids[direction][1]
: _wooden_rc_station_block_brakes_image_ids[direction][0];
const auto brakeImg = trackElement.IsBrakeClosed() ? _wooden_rc_station_block_brakes_image_ids[direction][1]
: _wooden_rc_station_block_brakes_image_ids[direction][0];
wooden_rc_track_paint<isClassic>(session, brakeImg, SPR_G2_EMPTY, direction, 0, 2, 32, 27, 2, height, 0, 2, height);
}
else
@@ -12833,8 +12833,8 @@ static void wooden_rc_track_block_brakes(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
const auto brakeImg = trackElement.BlockBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1]
: _wooden_rc_block_brakes_image_ids[direction][0];
const auto brakeImg = trackElement.IsBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1]
: _wooden_rc_block_brakes_image_ids[direction][0];
wooden_rc_track_paint<isClassic>(
session, brakeImg, _wooden_rc_block_brakes_image_ids[direction][2], direction, 0, 2, 32, 25, 2, height, 0, 3, height);
WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]);
+2 -2
View File
@@ -382,8 +382,8 @@ public:
bool IsInverted() const;
void SetInverted(bool inverted);
bool BlockBrakeClosed() const;
void SetBlockBrakeClosed(bool isClosed);
bool IsBrakeClosed() const;
void SetBrakeClosed(bool isClosed);
bool IsIndestructible() const;
void SetIsIndestructible(bool isIndestructible);
+2 -2
View File
@@ -916,7 +916,7 @@ namespace OpenRCT2::TileInspector
return GameActions::Result();
}
GameActions::Result TrackSetBlockBrake(const CoordsXY& loc, int32_t elementIndex, bool blockBrake, bool isExecuting)
GameActions::Result TrackSetBrakeClosed(const CoordsXY& loc, int32_t elementIndex, bool isClosed, bool isExecuting)
{
TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex);
if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track)
@@ -924,7 +924,7 @@ namespace OpenRCT2::TileInspector
if (isExecuting)
{
trackElement->AsTrack()->SetBlockBrakeClosed(blockBrake);
trackElement->AsTrack()->SetBrakeClosed(isClosed);
MapInvalidateTileFull(loc);
+1 -1
View File
@@ -41,7 +41,7 @@ namespace OpenRCT2::TileInspector
GameActions::Result WallAnimationFrameOffset(
const CoordsXY& loc, int16_t elementIndex, int8_t animationFrameOffset, bool isExecuting);
GameActions::Result TrackBaseHeightOffset(const CoordsXY& loc, int32_t elementIndex, int8_t offset, bool isExecuting);
GameActions::Result TrackSetBlockBrake(const CoordsXY& loc, int32_t elementIndex, bool blockBrake, bool isExecuting);
GameActions::Result TrackSetBrakeClosed(const CoordsXY& loc, int32_t elementIndex, bool isClosed, bool isExecuting);
GameActions::Result TrackSetIndestructible(
const CoordsXY& loc, int32_t elementIndex, bool isIndestructible, bool isExecuting);
GameActions::Result TrackSetChain(