Keep Qt UI screenshots in RGB888 format, just convert the buffer properly

This commit is contained in:
Andrey Bondrov committed 2015-03-04 02:53:33 +10:00
1 parent 168ab06266
commit f81ec4ce65
1 file changed
+3 -3
+3 -3
View File
@@ -236,10 +236,10 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
#ifdef USING_QT_UI
if (success) {
u8 *flipbuffer = nullptr;
const u8 *buffer = ConvertBufferTo888RGB(buf, flipbuffer);
// TODO: Handle other formats (e.g. Direct3D, raw framebuffers.)
const u8 *buffer = buf.GetData();
QImage image(buffer, buf.GetStride(), buf.GetHeight(), QImage::Format_RGB32);
image = image.mirrored();
QImage image(buffer, buf.GetStride(), buf.GetHeight(), QImage::Format_RGB888);
success = image.save(filename, fmt == SCREENSHOT_PNG ? "PNG" : "JPG");
}
#else