diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 3808590136..3f861ceed4 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -627,17 +627,17 @@ void TakeScreenshot() { glReadPixels(0, 0, pixel_xres, pixel_yres, GL_RGB, GL_UNSIGNED_BYTE, buffer); + bool success = true; #ifdef USING_QT_UI QImage image(buffer, pixel_xres, pixel_yres, QImage::Format_RGB888); image = image.mirrored(); - image.save(filename, g_Config.bScreenshotsAsPNG ? "PNG" : "JPG"); + success = image.save(filename, g_Config.bScreenshotsAsPNG ? "PNG" : "JPG"); #else // Silly openGL reads upside down, we flip to another buffer for simplicity. u8 *flipbuffer = new u8[3 * pixel_xres * pixel_yres]; for (int y = 0; y < pixel_yres; y++) { memcpy(flipbuffer + y * pixel_xres * 3, buffer + (pixel_yres - y - 1) * pixel_xres * 3, pixel_xres * 3); } - bool success = true; if (g_Config.bScreenshotsAsPNG) { png_image png; memset(&png, 0, sizeof(png));