mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 15:54:31 +01:00
Feature: Add optional screenshot argument for Z coord
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user