* Make a screenshot of the map. * @param t Screenshot type: World or viewport screenshot * @param width the width of the screenshot of, or 0 for current viewport width. * @param height the height of the screenshot of, or 0 for current viewport height. * @return true on success */
| 272 | * @return true on success |
| 273 | */ |
| 274 | static bool MakeLargeWorldScreenshot(ScreenshotType t, uint32_t width = 0, uint32_t height = 0) |
| 275 | { |
| 276 | auto provider = GetScreenshotProvider(); |
| 277 | if (provider == nullptr) return false; |
| 278 | |
| 279 | Viewport vp = SetupScreenshotViewport(t, width, height); |
| 280 | |
| 281 | return provider->MakeImage(MakeScreenshotName(SCREENSHOT_NAME, provider->GetName()), |
| 282 | [&](void *buf, uint y, uint pitch, uint n) { |
| 283 | LargeWorldCallback(vp, buf, y, pitch, n); |
| 284 | }, vp.width, vp.height, BlitterFactory::GetCurrentBlitter()->GetScreenDepth(), _cur_palette.palette); |
| 285 | } |
| 286 | |
| 287 | /** |
| 288 | * Callback for generating a heightmap. Supports 8bpp greyscale only. |
no test coverage detected