From 6f062b9b166a2393c9dbefd9ca581b2a484e16d4 Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Mon, 10 Nov 2014 16:57:51 +0100 Subject: [PATCH] add success flag for qt screenshot too --- UI/NativeApp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));