mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-23 22:36:21 +00:00
add success flag for qt screenshot too
This commit is contained in:
parent
01c2b88911
commit
6f062b9b16
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user