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

Function MakeScreenshot

src/screenshot.cpp:456–470  ·  view source on GitHub ↗

* Schedule making a screenshot. * Unconditionally take a screenshot of the requested type. * @param t the type of screenshot to make. * @param name the name to give to the screenshot. * @param width the width of the screenshot of, or 0 for current viewport width (only works for SC_ZOOMEDIN and SC_DEFAULTZOOM). * @param height the height of the screenshot of, or 0 for current viewport heigh

Source from the content-addressed store, hash-verified

454 * @see MakeScreenshotWithConfirm
455 */
456bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width, uint32_t height)
457{
458 if (t == SC_CRASHLOG) {
459 /* Video buffer might or might not be locked. */
460 VideoDriver::VideoBufferLocker lock;
461
462 return RealMakeScreenshot(t, name, width, height);
463 }
464
465 VideoDriver::GetInstance()->QueueOnMainThread([=] { // Capture by value to not break scope.
466 RealMakeScreenshot(t, name, width, height);
467 });
468
469 return true;
470}
471
472
473static void MinimapScreenCallback(void *buf, uint y, uint pitch, uint n)

Callers 4

ConScreenShotFunction · 0.85
WriteScreenshotMethod · 0.85

Calls 2

RealMakeScreenshotFunction · 0.85
QueueOnMainThreadMethod · 0.80

Tested by

no test coverage detected