add success flag for qt screenshot too

This commit is contained in:
Peter Tissen 2014-11-10 16:57:51 +01:00
parent 01c2b88911
commit 6f062b9b16

View File

@ -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));