* 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
| 454 | * @see MakeScreenshotWithConfirm |
| 455 | */ |
| 456 | bool 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 | |
| 473 | static void MinimapScreenCallback(void *buf, uint y, uint pitch, uint n) |
no test coverage detected