mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 16:24:35 +01:00
Merge pull request #21468 from AaronVanGeffen/cpp20
Compile project as C++20
This commit is contained in:
@@ -1034,18 +1034,28 @@ private:
|
||||
|
||||
auto footpathPlaceAction = FootpathPlaceAction(
|
||||
footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags);
|
||||
footpathPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) {
|
||||
|
||||
footpathPlaceAction.SetCallback([footpathLoc](const GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
{
|
||||
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position);
|
||||
Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position);
|
||||
}
|
||||
|
||||
auto* self = static_cast<FootpathWindow*>(WindowFindByClass(WindowClass::Footpath));
|
||||
if (self == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
{
|
||||
if (gFootpathConstructSlope == 0)
|
||||
{
|
||||
_footpathConstructValidDirections = INVALID_DIRECTION;
|
||||
self->_footpathConstructValidDirections = INVALID_DIRECTION;
|
||||
}
|
||||
else
|
||||
{
|
||||
_footpathConstructValidDirections = _footpathConstructDirection;
|
||||
self->_footpathConstructValidDirections = self->_footpathConstructDirection;
|
||||
}
|
||||
|
||||
if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND)
|
||||
@@ -1062,7 +1072,7 @@ private:
|
||||
gFootpathConstructFromPosition.z += PATH_HEIGHT_STEP;
|
||||
}
|
||||
}
|
||||
WindowFootpathSetEnabledAndPressedWidgets();
|
||||
self->WindowFootpathSetEnabledAndPressedWidgets();
|
||||
});
|
||||
GameActions::Execute(&footpathPlaceAction);
|
||||
}
|
||||
|
||||
@@ -104,11 +104,11 @@ private:
|
||||
return firstStrId;
|
||||
}
|
||||
|
||||
bool operator==(const FilterArguments& other)
|
||||
bool operator==(const FilterArguments& other) const
|
||||
{
|
||||
return std::memcmp(args, other.args, sizeof(args)) == 0;
|
||||
}
|
||||
bool operator!=(const FilterArguments& other)
|
||||
bool operator!=(const FilterArguments& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ private:
|
||||
size_t Count{};
|
||||
size_t Total{};
|
||||
|
||||
bool operator==(const DownloadStatusInfo& rhs)
|
||||
bool operator==(const DownloadStatusInfo& rhs) const
|
||||
{
|
||||
return Name == rhs.Name && Source == rhs.Source && Count == rhs.Count && Total == rhs.Total;
|
||||
}
|
||||
bool operator!=(const DownloadStatusInfo& rhs)
|
||||
bool operator!=(const DownloadStatusInfo& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
@@ -3230,9 +3230,10 @@ public:
|
||||
// Draw an overlay if clearance checks are disabled
|
||||
if (gCheatsDisableClearanceChecks)
|
||||
{
|
||||
auto colour = static_cast<colour_t>(EnumValue(COLOUR_DARK_ORANGE) | EnumValue(COLOUR_FLAG_OUTLINE));
|
||||
DrawTextBasic(
|
||||
dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {},
|
||||
{ COLOUR_DARK_ORANGE | COLOUR_FLAG_OUTLINE, TextAlignment::RIGHT });
|
||||
{ colour, TextAlignment::RIGHT });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3295,9 +3296,8 @@ public:
|
||||
// Draw number of players.
|
||||
auto ft = Formatter();
|
||||
ft.Add<int32_t>(NetworkGetNumVisiblePlayers());
|
||||
DrawTextBasic(
|
||||
dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft,
|
||||
{ COLOUR_WHITE | COLOUR_FLAG_OUTLINE, TextAlignment::RIGHT });
|
||||
auto colour = static_cast<colour_t>(EnumValue(COLOUR_WHITE) | EnumValue(COLOUR_FLAG_OUTLINE));
|
||||
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft, { colour, TextAlignment::RIGHT });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,18 +30,9 @@ void GfxFillRectInset(DrawPixelInfo& dpi, const ScreenRect& rect, int32_t colour
|
||||
const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() };
|
||||
const auto rightTop = ScreenCoordsXY{ rect.GetRight(), rect.GetTop() };
|
||||
const auto rightBottom = ScreenCoordsXY{ rect.GetRight(), rect.GetBottom() };
|
||||
if (colour & (COLOUR_FLAG_TRANSLUCENT | COLOUR_FLAG_8))
|
||||
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
||||
{
|
||||
TranslucentWindowPalette palette;
|
||||
if (colour & COLOUR_FLAG_8)
|
||||
{
|
||||
// TODO: This can't be added up
|
||||
// palette = NOT_TRANSLUCENT(colour);
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
palette = TranslucentWindowPalettes[BASE_COLOUR(colour)];
|
||||
auto palette = TranslucentWindowPalettes[BASE_COLOUR(colour)];
|
||||
|
||||
if (flags & INSET_RECT_FLAG_BORDER_NONE)
|
||||
{
|
||||
|
||||
@@ -212,12 +212,11 @@ constexpr uint8_t COLOUR_NUM_NORMAL = 54;
|
||||
#define TEXT_COLOUR_254 (254)
|
||||
#define TEXT_COLOUR_255 (255)
|
||||
|
||||
enum
|
||||
enum : colour_t
|
||||
{
|
||||
COLOUR_FLAG_OUTLINE = (1 << 5),
|
||||
COLOUR_FLAG_INSET = (1 << 6), // 64, 0x40
|
||||
COLOUR_FLAG_TRANSLUCENT = (1 << 7),
|
||||
COLOUR_FLAG_8 = (1 << 8)
|
||||
};
|
||||
|
||||
#define TRANSLUCENT(x) ((x) | static_cast<uint8_t>(COLOUR_FLAG_TRANSLUCENT))
|
||||
|
||||
Reference in New Issue
Block a user