From e4958e731488e9cbf193e006bae1af88dbdcd9f5 Mon Sep 17 00:00:00 2001 From: mix <167040362+mixiate@users.noreply.github.com> Date: Tue, 21 Oct 2025 20:01:01 +0100 Subject: [PATCH] Add option to command line screenshot to draw debug segment heights --- distribution/changelog.txt | 1 + .../command_line/ScreenshotCommands.cpp | 23 ++++++++++--------- src/openrct2/interface/Screenshot.cpp | 6 +++++ src/openrct2/interface/Screenshot.h | 1 + 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ea3afa998a..860e8bac42 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.28 (in development) ------------------------------------------------------------------------ - Feature: [#25286] Footpath area dragging tool. +- Feature: [#25379] Add an option to the command line screenshot function to draw debug segment heights. - Improved: [#25349] ‘Recent Messages’ window can now be fully themed. - Change: [#25089] Peep actions and animations that cause them to stop moving no longer trigger when they are on a level crossing. - Change: [#25337] Placing track designs with scenery that is obstructed no longer disables all of the scenery. diff --git a/src/openrct2/command_line/ScreenshotCommands.cpp b/src/openrct2/command_line/ScreenshotCommands.cpp index f4f07b6131..215f622a7e 100644 --- a/src/openrct2/command_line/ScreenshotCommands.cpp +++ b/src/openrct2/command_line/ScreenshotCommands.cpp @@ -17,17 +17,18 @@ namespace OpenRCT2 // clang-format off static constexpr CommandLineOptionDefinition kScreenshotOptionsDef[] { - { CMDLINE_TYPE_INTEGER, &_options.weather, kNAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, - { CMDLINE_TYPE_SWITCH, &_options.hide_guests, kNAC, "no-peeps", "hide peeps" }, - { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, kNAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, - { CMDLINE_TYPE_SWITCH, &_options.clear_grass, kNAC, "clear-grass", "set all grass to be clear of weeds" }, - { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, kNAC, "mowed-grass", "set all grass to be mowed" }, - { CMDLINE_TYPE_SWITCH, &_options.water_plants, kNAC, "water-plants", "water plants for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, kNAC, "fix-vandalism", "fix vandalism for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.remove_litter, kNAC, "remove-litter", "remove litter for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, kNAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, - { CMDLINE_TYPE_SWITCH, &_options.transparent, kNAC, "transparent", "make the background transparent" }, - { CMDLINE_TYPE_SWITCH, &_options.draw_bounding_boxes, kNAC, "draw-bounding-boxes", "draw bounding boxes" }, + { CMDLINE_TYPE_INTEGER, &_options.weather, kNAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, + { CMDLINE_TYPE_SWITCH, &_options.hide_guests, kNAC, "no-peeps", "hide peeps" }, + { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, kNAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, + { CMDLINE_TYPE_SWITCH, &_options.clear_grass, kNAC, "clear-grass", "set all grass to be clear of weeds" }, + { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, kNAC, "mowed-grass", "set all grass to be mowed" }, + { CMDLINE_TYPE_SWITCH, &_options.water_plants, kNAC, "water-plants", "water plants for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, kNAC, "fix-vandalism", "fix vandalism for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.remove_litter, kNAC, "remove-litter", "remove litter for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, kNAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, + { CMDLINE_TYPE_SWITCH, &_options.transparent, kNAC, "transparent", "make the background transparent" }, + { CMDLINE_TYPE_SWITCH, &_options.draw_bounding_boxes, kNAC, "draw-bounding-boxes", "draw bounding boxes" }, + { CMDLINE_TYPE_SWITCH, &_options.drawSegmentHeights, kNAC, "draw-segment-heights", "draw segment heights" }, kOptionTableEnd }; diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 56be9db427..4ed67f1808 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -28,6 +28,7 @@ #include "../drawing/X8DrawingEngine.h" #include "../localisation/Formatter.h" #include "../paint/Painter.h" +#include "../paint/tile_element/Paint.TileElement.h" #include "../platform/Platform.h" #include "../world/Climate.h" #include "../world/Map.h" @@ -427,6 +428,11 @@ static void ApplyOptions(const ScreenshotOptions* options, Viewport& viewport) { gPaintBoundingBoxes = true; } + + if (options->drawSegmentHeights) + { + gShowSupportSegmentHeights = true; + } } int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOptions* options) diff --git a/src/openrct2/interface/Screenshot.h b/src/openrct2/interface/Screenshot.h index 1528be254b..d4214dcef7 100644 --- a/src/openrct2/interface/Screenshot.h +++ b/src/openrct2/interface/Screenshot.h @@ -34,6 +34,7 @@ struct ScreenshotOptions bool tidy_up_park = false; bool transparent = false; bool draw_bounding_boxes = false; + bool drawSegmentHeights = false; }; struct CaptureView