Name some path drawing variables

This commit is contained in:
Michael Steenbeek 2019-01-18 20:35:43 +01:00 committed by GitHub
parent b4bef2fe7d
commit 6ef01b3cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -30,8 +30,12 @@
bool gPaintWidePathsAsGhost = false;
// clang-format off
const uint8_t byte_98D800[] = {
12, 9, 3, 6
const uint8_t PathSlopeToLandSlope[] =
{
TILE_ELEMENT_SLOPE_SW_SIDE_UP,
TILE_ELEMENT_SLOPE_NW_SIDE_UP,
TILE_ELEMENT_SLOPE_NE_SIDE_UP,
TILE_ELEMENT_SLOPE_SE_SIDE_UP
};
static constexpr const uint8_t byte_98D6E0[] = {
@ -794,7 +798,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
{
session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH;
bool word_F3F038 = false;
bool hasSupports = false;
uint32_t sceneryImageFlags = 0;
uint32_t imageFlags = 0;
@ -851,11 +855,11 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
uint16_t bl = height / 8;
if (surface == nullptr)
{
word_F3F038 = true;
hasSupports = true;
}
else if (surface->base_height != bl)
{
word_F3F038 = true;
hasSupports = true;
}
else
{
@ -863,16 +867,16 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
{
// Diagonal path
if (surface->AsSurface()->GetSlope() != byte_98D800[tile_element->AsPath()->GetSlopeDirection()])
if (surface->AsSurface()->GetSlope() != PathSlopeToLandSlope[tile_element->AsPath()->GetSlopeDirection()])
{
word_F3F038 = true;
hasSupports = true;
}
}
else
{
if (surface->AsSurface()->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)
{
word_F3F038 = true;
hasSupports = true;
}
}
}
@ -932,12 +936,12 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
if (railingEntry->support_type == FOOTPATH_ENTRY_SUPPORT_TYPE_POLE)
{
path_paint_pole_support(
session, tile_element, height, footpathEntry, railingEntry, word_F3F038, imageFlags, sceneryImageFlags);
session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags);
}
else
{
path_paint_box_support(
session, tile_element, height, footpathEntry, railingEntry, word_F3F038, imageFlags, sceneryImageFlags);
session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags);
}
}

View File

@ -87,7 +87,7 @@ extern bool gShowSupportSegmentHeights;
extern const LocationXY16 BannerBoundBoxes[][2];
extern const uint8_t byte_98D800[4];
extern const uint8_t PathSlopeToLandSlope[4];
void paint_util_push_tunnel_left(paint_session* session, uint16_t height, uint8_t type);
void paint_util_push_tunnel_right(paint_session* session, uint16_t height, uint8_t type);

View File

@ -951,7 +951,7 @@ static uint8_t staff_handyman_direction_to_uncut_grass(rct_peep* peep, uint8_t v
if (peep->GetNextIsSloped())
{
if (tileElement->AsSurface()->GetSlope() != byte_98D800[peep->GetNextDirection()])
if (tileElement->AsSurface()->GetSlope() != PathSlopeToLandSlope[peep->GetNextDirection()])
return 0xFF;
}
else if (tileElement->AsSurface()->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)