MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MakeLargeWorldScreenshot

Function MakeLargeWorldScreenshot

src/screenshot.cpp:274–285  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

272 * @return true on success
273 */
274static 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.

Callers 1

RealMakeScreenshotFunction · 0.85

Calls 7

GetScreenshotProviderFunction · 0.85
SetupScreenshotViewportFunction · 0.85
MakeScreenshotNameFunction · 0.85
LargeWorldCallbackFunction · 0.85
MakeImageMethod · 0.45
GetNameMethod · 0.45
GetScreenDepthMethod · 0.45

Tested by

no test coverage detected