diff --git a/src/openrct2/interface/viewport.h b/src/openrct2/interface/viewport.h index 0ddbd55640..23d3f54b46 100644 --- a/src/openrct2/interface/viewport.h +++ b/src/openrct2/interface/viewport.h @@ -40,7 +40,7 @@ enum { VIEWPORT_FLAG_INVISIBLE_SPRITES = (1 << 14), VIEWPORT_FLAG_15 = (1 << 15), VIEWPORT_FLAG_SEETHROUGH_PATHS = (1 << 16), - VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT = (1 << 17) // zax + VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT = (1 << 17) }; enum { diff --git a/src/openrct2/paint/map_element/map_element.c b/src/openrct2/paint/map_element/map_element.c index 30505e9662..1b0e748d1e 100644 --- a/src/openrct2/paint/map_element/map_element.c +++ b/src/openrct2/paint/map_element/map_element.c @@ -319,7 +319,7 @@ static void sub_68B3FB(sint32 x, sint32 y) imageColourFlats = 0b111011 << 19 | 0x40000000; } - // Only draw supports above the clipping height. + // Only draw supports below the clipping height. if ((gCurrentViewportFlags & VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT) && (segmentHeight > gClipHeight)) continue; sint32 xOffset = sy * 10; diff --git a/src/openrct2/paint/paint.c b/src/openrct2/paint/paint.c index b92ea5d8b6..95121d63ca 100644 --- a/src/openrct2/paint/paint.c +++ b/src/openrct2/paint/paint.c @@ -23,8 +23,8 @@ #include "sprite/sprite.h" #include "supports.h" -// zax: globals for paint clipping height -uint8 gClipHeight = 255; +// Global for paint clipping height +uint8 gClipHeight = 128; // Default to middle value const uint32 construction_markers[] = { COLOUR_DARK_GREEN << 19 | COLOUR_GREY << 24 | IMAGE_TYPE_REMAP, // White diff --git a/src/openrct2/paint/paint.h b/src/openrct2/paint/paint.h index 2475b70d69..2defef1976 100644 --- a/src/openrct2/paint/paint.h +++ b/src/openrct2/paint/paint.h @@ -23,7 +23,7 @@ #include "../interface/colour.h" #include "../drawing/drawing.h" -// zax: Global paint clipping height. +// Global for paint clipping height. extern uint8 gClipHeight; diff --git a/src/openrct2/paint/sprite/sprite.c b/src/openrct2/paint/sprite/sprite.c index 07e25b06cb..cf9482bf1a 100644 --- a/src/openrct2/paint/sprite/sprite.c +++ b/src/openrct2/paint/sprite/sprite.c @@ -21,7 +21,7 @@ #include "../../ride/ride_data.h" #include "../../interface/viewport.h" #include "../../ride/vehicle_paint.h" -#include "../../localisation/localisation.h" // zax +#include "../../localisation/localisation.h" /** * Paint Quadrant @@ -47,9 +47,11 @@ void sprite_paint_setup(const uint16 eax, const uint16 ecx) { for (rct_sprite* spr = get_sprite(sprite_idx); sprite_idx != SPRITE_INDEX_NULL; sprite_idx = spr->unknown.next_in_quadrant) { spr = get_sprite(sprite_idx); - // zax: Only paint sprites that are below the clip height. + // Only paint sprites that are below the clip height. // Here converting from land/path/etc height scale to pixel height scale. - if ((gCurrentViewportFlags & VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT) && (spr->unknown.z >= ((gClipHeight+2) * 8))) continue; + // Note: peeps/scenery on slopes will be above the base + // height of the slope element, and consequently clipped. + if ((gCurrentViewportFlags & VIEWPORT_FLAG_PAINT_CLIP_TO_HEIGHT) && (spr->unknown.z > (gClipHeight * 8) )) continue; dpi = unk_140E9A8;