forked from rosebudai/OpenRCT2-Web
Remove redundant parentheses around FlagHolder method invocations (#25695)
This commit is contained in:
1 parent
d8ad249b0a
commit
490bf3ec30
16 files changed
+19
-21
No files matched your search
@@ -490,9 +490,7 @@ namespace OpenRCT2
|
||||
static void InputWindowPositionContinue(
|
||||
WindowBase& w, const ScreenCoordsXY& lastScreenCoords, const ScreenCoordsXY& newScreenCoords)
|
||||
{
|
||||
int32_t snapProximity;
|
||||
|
||||
snapProximity = (w.flags.has(WindowFlag::noSnapping)) ? 0 : Config::Get().general.windowSnapProximity;
|
||||
int32_t snapProximity = w.flags.has(WindowFlag::noSnapping) ? 0 : Config::Get().general.windowSnapProximity;
|
||||
WindowMoveAndSnap(w, newScreenCoords - lastScreenCoords, snapProximity);
|
||||
}
|
||||
|
||||
@@ -1603,7 +1601,7 @@ namespace OpenRCT2
|
||||
mainWindow = WindowGetMain();
|
||||
if (mainWindow == nullptr)
|
||||
return;
|
||||
if ((mainWindow->flags.has(WindowFlag::noScrolling))
|
||||
if (mainWindow->flags.has(WindowFlag::noScrolling)
|
||||
|| (gLegacyScene == LegacyScene::trackDesignsManager || gLegacyScene == LegacyScene::titleSequence))
|
||||
return;
|
||||
if (mainWindow->viewport == nullptr)
|
||||
|
||||
@@ -1024,7 +1024,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
*/
|
||||
void WindowDrawWidgets(WindowBase& w, RenderTarget& rt)
|
||||
{
|
||||
if ((w.flags.has(WindowFlag::transparent)) && !w.flags.has(WindowFlag::noBackground))
|
||||
if (w.flags.has(WindowFlag::transparent) && !w.flags.has(WindowFlag::noBackground))
|
||||
Rectangle::filter(
|
||||
rt, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::palette51);
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ namespace OpenRCT2::Scripting
|
||||
if (IsCustomWindow())
|
||||
{
|
||||
auto widget = GetWidget();
|
||||
if (widget != nullptr && (widget->flags.has(WidgetFlag::textIsString)) && widget->string != nullptr)
|
||||
if (widget != nullptr && widget->flags.has(WidgetFlag::textIsString) && widget->string != nullptr)
|
||||
{
|
||||
return widget->string;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace OpenRCT2::Scripting
|
||||
auto w = GetWindow();
|
||||
if (w != nullptr)
|
||||
{
|
||||
return (w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront));
|
||||
return w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
case WIDX_BACKGROUND:
|
||||
{
|
||||
auto* windowMgr = GetWindowManager();
|
||||
if (windowMgr->FindByClass(WindowClass::error) == nullptr && (gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (windowMgr->FindByClass(WindowClass::error) == nullptr && gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
auto action = GetClearAction();
|
||||
GameActions::Execute(&action, getGameState());
|
||||
|
||||
@@ -655,8 +655,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
const auto objectSelectResult = WindowEditorObjectSelectionSelectObject(0, inputFlags, listItem->repositoryItem);
|
||||
if (!objectSelectResult.Successful)
|
||||
{
|
||||
StringId error_title = (inputFlags.has(EditorInputFlag::select)) ? STR_UNABLE_TO_SELECT_THIS_OBJECT
|
||||
: STR_UNABLE_TO_DE_SELECT_THIS_OBJECT;
|
||||
StringId error_title = inputFlags.has(EditorInputFlag::select) ? STR_UNABLE_TO_SELECT_THIS_OBJECT
|
||||
: STR_UNABLE_TO_DE_SELECT_THIS_OBJECT;
|
||||
|
||||
ContextShowError(error_title, objectSelectResult.Message, {});
|
||||
return;
|
||||
|
||||
@@ -1057,7 +1057,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
|
||||
// Check for change
|
||||
if ((_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) && _provisionalFootpath.positionA == mapPos
|
||||
if (_provisionalFootpath.flags.has(ProvisionalPathFlag::placed) && _provisionalFootpath.positionA == mapPos
|
||||
&& _provisionalFootpath.startZ == _footpathPlaceZ)
|
||||
{
|
||||
return;
|
||||
@@ -1118,7 +1118,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gMapSelectFlags.unset(MapSelectFlag::enableArrow);
|
||||
|
||||
// Check for change
|
||||
if ((_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) && range.Point1 == _provisionalFootpath.positionA
|
||||
if (_provisionalFootpath.flags.has(ProvisionalPathFlag::placed) && range.Point1 == _provisionalFootpath.positionA
|
||||
&& range.Point2 == _provisionalFootpath.positionB && baseZ == _provisionalFootpath.startZ)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// Check for cursor movement
|
||||
_cursorHoldDuration++;
|
||||
if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (gInputFlags.has(InputFlag::rightMousePressed))
|
||||
if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || gInputFlags.has(InputFlag::rightMousePressed)
|
||||
|| InputGetState() == InputState::ViewportRight)
|
||||
_cursorHoldDuration = 0;
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
}
|
||||
|
||||
if ((ted.sequences[0].flags.has(SequenceFlag::trackOrigin)) && blockIndex == 0)
|
||||
if (ted.sequences[0].flags.has(SequenceFlag::trackOrigin) && blockIndex == 0)
|
||||
{
|
||||
const auto addElementResult = TrackAddStationElement(
|
||||
{ mapLoc, baseZ, _origin.direction }, _rideIndex, {}, _fromTrackDesign);
|
||||
|
||||
@@ -178,7 +178,7 @@ void JumpingFountain::Update()
|
||||
switch (FountainType)
|
||||
{
|
||||
case JumpingFountainType::Water:
|
||||
if (frame == 11 && (fountainFlags.has(FountainFlag::fast)))
|
||||
if (frame == 11 && fountainFlags.has(FountainFlag::fast))
|
||||
{
|
||||
AdvanceAnimation();
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ namespace OpenRCT2
|
||||
for (; it != gWindowList.end(); it++)
|
||||
{
|
||||
auto w = it->get();
|
||||
if (!w->flags.has(WindowFlag::transparent) || (w->flags.has(WindowFlag::dead)))
|
||||
if (!w->flags.has(WindowFlag::transparent) || w->flags.has(WindowFlag::dead))
|
||||
continue;
|
||||
if (w->viewport == window->viewport)
|
||||
continue;
|
||||
|
||||
@@ -562,7 +562,7 @@ static constexpr float kWindowScrollLocations[][2] = {
|
||||
auto* v = (*it).get();
|
||||
if (v->flags.has(WindowFlag::dead))
|
||||
continue;
|
||||
if ((&w == v || (v->flags.has(WindowFlag::transparent))) && v->isVisible)
|
||||
if ((&w == v || v->flags.has(WindowFlag::transparent)) && v->isVisible)
|
||||
{
|
||||
WindowDrawSingle(rt, *v, left, top, right, bottom);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ static void VirtualFloorGetTileProperties(
|
||||
*tileOwned = false;
|
||||
|
||||
// See if we are a selected tile
|
||||
if ((gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
if (loc >= gMapSelectPositionA && loc <= gMapSelectPositionB)
|
||||
{
|
||||
|
||||
@@ -163,7 +163,7 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor
|
||||
int32_t screenMinY = Translate3DTo2DWithZ(rotation, { coords, 0 }).y;
|
||||
|
||||
// Display little yellow arrow when building footpaths?
|
||||
if ((gMapSelectFlags.has(MapSelectFlag::enableArrow)) && session.MapPosition.x == gMapSelectArrowPosition.x
|
||||
if (gMapSelectFlags.has(MapSelectFlag::enableArrow) && session.MapPosition.x == gMapSelectArrowPosition.x
|
||||
&& session.MapPosition.y == gMapSelectArrowPosition.y)
|
||||
{
|
||||
uint8_t arrowRotation = (rotation + (gMapSelectArrowDirection & 3)) & 3;
|
||||
|
||||
@@ -507,7 +507,7 @@ bool RideTryGetOriginElement(const Ride& ride, CoordsXYE* output)
|
||||
bool specialTrackPiece
|
||||
= (it.element->AsTrack()->GetTrackType() != TrackElemType::BeginStation
|
||||
&& it.element->AsTrack()->GetTrackType() != TrackElemType::MiddleStation
|
||||
&& (ted.sequences[0].flags.has(SequenceFlag::trackOrigin)));
|
||||
&& ted.sequences[0].flags.has(SequenceFlag::trackOrigin));
|
||||
|
||||
// Set result tile to this track piece if first found track or a ???
|
||||
if (resultTileElement == nullptr || specialTrackPiece)
|
||||
|
||||
@@ -389,7 +389,7 @@ void UnlinkAllBannersForRide(RideId rideId)
|
||||
auto& gameState = getGameState();
|
||||
for (auto& banner : gameState.banners)
|
||||
{
|
||||
if (!banner.isNull() && (banner.flags.has(BannerFlag::linkedToRide)) && banner.rideIndex == rideId)
|
||||
if (!banner.isNull() && banner.flags.has(BannerFlag::linkedToRide) && banner.rideIndex == rideId)
|
||||
{
|
||||
banner.flags.unset(BannerFlag::linkedToRide);
|
||||
banner.rideIndex = RideId::GetNull();
|
||||
|
||||
Reference in new issue
Block a user