Rename IsPassedSurface to PassedSurface and cleanup values

This commit is contained in:
ζeh Matt 2022-02-25 01:21:36 +02:00
parent 9b6b5220bf
commit d9bdc1441f
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
7 changed files with 14 additions and 15 deletions

View File

@ -477,7 +477,7 @@ bool wooden_a_supports_paint_setup(
return false;
}
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
return false;
}
@ -636,7 +636,7 @@ bool wooden_b_supports_paint_setup(
return false;
}
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
return false;
}
@ -806,7 +806,7 @@ bool metal_a_supports_paint_setup(
return false;
}
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
return false;
}
@ -1005,7 +1005,7 @@ bool metal_b_supports_paint_setup(
return false; // AND
}
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
return false; // AND
}
@ -1185,7 +1185,7 @@ bool path_a_supports_paint_setup(
return false;
}
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
return false;
}
@ -1335,7 +1335,7 @@ bool path_b_supports_paint_setup(
return false; // AND
}
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
return false; // AND
}

View File

@ -1099,7 +1099,7 @@ void path_paint_box_support(
surfaceBaseImageIndex += byte_98D6E0[edi];
}
const bool hasPassedSurface = (session.Flags & PaintSessionFlags::IsPassedSurface) != 0;
const bool hasPassedSurface = (session.Flags & PaintSessionFlags::PassedSurface) != 0;
if (!hasPassedSurface)
{
boundBoxOffset.x = 3;
@ -1239,7 +1239,7 @@ void path_paint_pole_support(
}
// Below Surface
const bool hasPassedSurface = (session.Flags & PaintSessionFlags::IsPassedSurface) != 0;
const bool hasPassedSurface = (session.Flags & PaintSessionFlags::PassedSurface) != 0;
if (!hasPassedSurface)
{
boundBoxOffset.x = 3;

View File

@ -978,7 +978,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co
rct_drawpixelinfo* dpi = &session.DPI;
session.InteractionType = ViewportInteractionItem::Terrain;
session.Flags |= PaintSessionFlags::IsPassedSurface;
session.Flags |= PaintSessionFlags::PassedSurface;
session.SurfaceElement = reinterpret_cast<const TileElement*>(&tileElement);
const auto zoomLevel = dpi->zoom_level;

View File

@ -218,7 +218,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo
session.SpritePosition.x = coords.x;
session.SpritePosition.y = coords.y;
session.Flags &= ~PaintSessionFlags::IsPassedSurface;
session.Flags &= ~PaintSessionFlags::PassedSurface;
int32_t previousBaseZ = 0;
do

View File

@ -73,9 +73,8 @@ enum
namespace PaintSessionFlags
{
// Unsure as to why this exists and DidPassSurface
constexpr uint8_t IsPassedSurface = 1;
constexpr uint8_t IsTrackPiecePreview = 2;
constexpr uint8_t PassedSurface = 1u << 0;
constexpr uint8_t IsTrackPiecePreview = 1u << 1;
} // namespace PaintSessionFlags
#ifdef __TESTPAINT__

View File

@ -783,7 +783,7 @@ bool track_paint_util_draw_station_covers_2(
return false;
}
if (!(session.Flags & (PaintSessionFlags::IsPassedSurface | PaintSessionFlags::IsTrackPiecePreview)))
if (!(session.Flags & (PaintSessionFlags::PassedSurface | PaintSessionFlags::IsTrackPiecePreview)))
{
return false;
}

View File

@ -462,7 +462,7 @@ static paint_struct* mini_golf_paint_util_7c(
static bool mini_golf_paint_util_should_draw_fence(paint_session& session, const TrackElement& trackElement)
{
if (!(session.Flags & PaintSessionFlags::IsPassedSurface))
if (!(session.Flags & PaintSessionFlags::PassedSurface))
{
// Should be above ground (have passed surface rendering)
return false;