* Make a screenshot. * Ask for confirmation first if the screenshot will be huge. * @param t Screenshot type: World, defaultzoom, heightmap or viewport screenshot * @see MakeScreenshot */
| 351 | * @see MakeScreenshot |
| 352 | */ |
| 353 | void MakeScreenshotWithConfirm(ScreenshotType t) |
| 354 | { |
| 355 | Viewport vp = SetupScreenshotViewport(t); |
| 356 | |
| 357 | bool heightmap_or_minimap = t == SC_HEIGHTMAP || t == SC_MINIMAP; |
| 358 | uint64_t width = (heightmap_or_minimap ? Map::SizeX() : vp.width); |
| 359 | uint64_t height = (heightmap_or_minimap ? Map::SizeY() : vp.height); |
| 360 | |
| 361 | if (width * height > 8192 * 8192) { |
| 362 | /* Ask for confirmation */ |
| 363 | _confirmed_screenshot_type = t; |
| 364 | ShowQuery( |
| 365 | GetEncodedString(STR_WARNING_SCREENSHOT_SIZE_CAPTION), |
| 366 | GetEncodedString(STR_WARNING_SCREENSHOT_SIZE_MESSAGE, width, height), nullptr, ScreenshotConfirmationCallback); |
| 367 | } else { |
| 368 | /* Less than 64M pixels, just do it */ |
| 369 | MakeScreenshot(t, {}); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * Make a screenshot. |
no test coverage detected