Minor code cleanups.

Adjusted sprite trimming.
This commit is contained in:
zaxcav 2017-01-07 23:15:44 +01:00
parent d17c435c0e
commit 87a80ac956
5 changed files with 10 additions and 8 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;