From 6b7fee86bbdc83651c35b5fb2e8d70dc6ff5ad7f Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 16 Jun 2019 16:42:21 +0200 Subject: [PATCH] Don't clear the screen to black for giant screenshots When certain viewport flags were set (underground view, hide base land, hide vetical faces, clip view), the viewport would always be cleared, including for giant screenshots. --- src/openrct2/interface/Viewport.cpp | 8 +++++--- src/openrct2/paint/tile_element/Paint.TileElement.cpp | 2 +- src/openrct2/sprites.h | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 7c661bdabb..4063fe882b 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -845,12 +845,14 @@ static void viewport_fill_column(paint_session* session) static void viewport_paint_column(paint_session* session) { if (session->ViewFlags - & (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_CLIP_VIEW)) + & (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_UNDERGROUND_INSIDE + | VIEWPORT_FLAG_CLIP_VIEW) + && (~session->ViewFlags & VIEWPORT_FLAG_TRANSPARENT_BACKGROUND)) { - uint8_t colour = 10; + uint8_t colour = COLOUR_AQUAMARINE; if (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) { - colour = 0; + colour = COLOUR_BLACK; } gfx_clear(&session->DPI, colour); } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index baab66d438..619c421b4b 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -125,7 +125,7 @@ static void blank_tiles_paint(paint_session* session, int32_t x, int32_t y) session->SpritePosition.x = x; session->SpritePosition.y = y; session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; - sub_98196C(session, 3123, 0, 0, 32, 32, -1, 16); + sub_98196C(session, SPR_BLANK_TILE, 0, 0, 32, 32, -1, 16); } bool gShowSupportSegmentHeights = false; diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index cc108d0dc4..8c37667de7 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -39,6 +39,8 @@ enum PEEP_SPAWN_ARROW_2 = 3113, PEEP_SPAWN_ARROW_3 = 3114, + SPR_BLANK_TILE = 3123, + // This is the start of every character there are // 224 characters per font (first 32 are control codes hence why it doesn't go to 255) // 4 fonts