1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Feature: Add optional screenshot argument for Z coord

This commit is contained in:
Cory Sanin
2025-06-23 17:19:24 -05:00
committed by GitHub
parent d8964c5641
commit 6fc950d38f
3 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
0.4.24 (in development)
------------------------------------------------------------------------
- Feature: [#24411] Vanilla scenarios now also have previews in the scenario selection window.
- Feature: [#24662] Add optional screenshot argument for Z coord.
- Improved: [#22684] The limit of 2000 animated tile elements has been removed.
- Improved: [#23228] Landscape edge doors now animate opening and closing and play a sound.
- Improved: [#24026] Notification settings have been made into a tab of the Recent Messages window.

View File

@@ -35,7 +35,7 @@ static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator);
const CommandLineCommand CommandLine::kScreenshotCommands[]
{
// Main commands
DefineCommand("", "<file> <output_image> <width> <height> [<x> <y> <zoom> <rotation>]", kScreenshotOptionsDef, HandleScreenshot),
DefineCommand("", "<file> <output_image> <width> <height> [<x> <y> [<z>] <zoom> <rotation>]", kScreenshotOptionsDef, HandleScreenshot),
DefineCommand("", "<file> <output_image> giant <zoom> <rotation>", kScreenshotOptionsDef, HandleScreenshot),
kCommandTableEnd
};

View File

@@ -438,9 +438,9 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti
}
bool giantScreenshot = (argc == 5) && String::iequals(argv[2], "giant");
if (argc != 4 && argc != 8 && !giantScreenshot)
if (argc != 4 && argc != 8 && argc != 9 && !giantScreenshot)
{
std::printf("Usage: openrct2 screenshot <file> <output_image> <width> <height> [<x> <y> <zoom> <rotation>]\n");
std::printf("Usage: openrct2 screenshot <file> <output_image> <width> <height> [<x> <y> [<z>] <zoom> <rotation>]\n");
std::printf("Usage: openrct2 screenshot <file> <output_image> giant <zoom> <rotation>\n");
return -1;
}
@@ -488,8 +488,9 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti
int32_t customY = 0;
int32_t customZoom = 0;
int32_t customRotation = 0;
if (argc == 8)
if (argc >= 8)
{
int32_t argOffset = argc == 8 ? 0 : 1;
customLocation = true;
if (argv[4][0] == 'c')
centreMapX = true;
@@ -501,8 +502,8 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti
else
customY = std::atoi(argv[5]);
customZoom = std::atoi(argv[6]);
customRotation = std::atoi(argv[7]) & 3;
customZoom = std::atoi(argv[6 + argOffset]);
customRotation = std::atoi(argv[7 + argOffset]) & 3;
}
const auto& mapSize = getGameState().mapSize;
@@ -525,6 +526,8 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti
customY = (mapSize.y / 2) * 32 + 16;
int32_t z = TileElementHeight({ customX, customY });
if (argc == 9)
z = std::atoi(argv[6]);
CoordsXYZ coords3d = { customX, customY, z };
auto coords2d = Translate3DTo2DWithZ(customRotation, coords3d);