1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Implement #1260: --transparent switch for screenshot command

This commit is contained in:
Hielke Morsink
2019-05-30 14:34:20 +02:00
parent f5ac98c1e2
commit bffc012d16
5 changed files with 12 additions and 2 deletions

View File

@@ -562,6 +562,8 @@ int32_t cmdline_for_screenshot(const char** argv, int32_t argc, ScreenshotOption
dpi.bits = (uint8_t*)malloc(dpi.width * dpi.height);
dpi.DrawingEngine = context->GetDrawingEngine();
std::memset(dpi.bits, PALETTE_INDEX_0, dpi.width * dpi.height);
if (options->hide_guests)
{
viewport.flags |= VIEWPORT_FLAG_INVISIBLE_PEEPS;
@@ -597,6 +599,11 @@ int32_t cmdline_for_screenshot(const char** argv, int32_t argc, ScreenshotOption
CheatsSet(CheatType::RemoveLitter);
}
if (options->transparent)
{
viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND;
}
viewport_render(&dpi, &viewport, 0, 0, viewport.width, viewport.height);
rct_palette renderedPalette;