Add a minimum visible height and no ground tile parameter to DrawTileProc.

Filter out tile parts which are entirely outside the drawing area.
This commit is contained in:
Jonathan G Rennison
2020-02-26 21:15:42 +00:00
parent 8ef367b126
commit 7949de2c05
13 changed files with 41 additions and 27 deletions

View File

@@ -1587,8 +1587,9 @@ static void ViewportAddLandscape()
_vd.last_foundation_child[0] = nullptr;
_vd.last_foundation_child[1] = nullptr;
_tile_type_procs[tile_type]->draw_tile_proc(&tile_info);
if (tile_info.tile != INVALID_TILE && min_visible_height <= (int)(ZOOM_LVL_BASE * 2 * TILE_HEIGHT)) {
bool no_ground_tiles = (column == left_column || column == right_column) || min_visible_height > 0;
_tile_type_procs[tile_type]->draw_tile_proc(&tile_info, { min_visible_height, no_ground_tiles });
if (tile_info.tile != INVALID_TILE && min_visible_height <= 0) {
DrawTileSelection(&tile_info);
DrawTileZoning(&tile_info);
}