Move 'should draw path over supports' to tile element

This commit is contained in:
Gymnasiast 2019-01-20 12:26:57 +01:00
parent 1f6d4caf7c
commit ad2698df0d
3 changed files with 16 additions and 3 deletions

View File

@ -488,7 +488,7 @@ static void sub_6A4101(
uint32_t drawnEdges = connectedEdges;
// If the path is not drawn over the supports, then no corner sprites will be drawn (making double-width paths
// look like connected series of intersections).
if (!(railingEntry->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
if (!tile_element->AsPath()->ShouldDrawPathOverSupports())
{
drawnEdges &= FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
}
@ -1062,7 +1062,7 @@ void path_paint_box_support(
height + boundingBoxZOffset);
// TODO: Revert this when path import works correctly.
if (!pathElement->IsQueue() && !(railingEntry->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
if (!pathElement->IsQueue() && !pathElement->ShouldDrawPathOverSupports())
{
// don't draw
}
@ -1217,7 +1217,7 @@ void path_paint_pole_support(
boundBoxOffset.y, height + boundingBoxZOffset);
// TODO: Revert this when path import works correctly.
if (pathElement->IsQueue() || (railingEntry->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS))
if (pathElement->IsQueue() || pathElement->ShouldDrawPathOverSupports())
{
sub_98199C(
session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x,

View File

@ -2135,6 +2135,16 @@ void PathElement::SetQueueBannerDirection(uint8_t direction)
type |= (direction << 6);
}
bool PathElement::ShouldDrawPathOverSupports()
{
return (GetRailingEntry()->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS);
}
void PathElement::SetShouldDrawPathOverSupports(bool on)
{
log_verbose("Setting 'draw path over supports' to %d", (size_t)on);
}
/**
*
* rct2: 0x006A8B12

View File

@ -228,6 +228,9 @@ public:
void SetAdditionStatus(uint8_t newStatus);
uint8_t GetRCT1PathType() const;
bool ShouldDrawPathOverSupports();
void SetShouldDrawPathOverSupports(bool on);
};
assert_struct_size(PathElement, 8);