Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: Remove Qt-specific screenshot path #13561

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions Core/Screenshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
#include "ppsspp_config.h"

#include <algorithm>
#ifdef USING_QT_UI
#include <QtGui/QImage>
#else
#include <png.h>
#include "ext/jpge/jpge.h"
#endif

#include "Common/ColorConv.h"
#include "Common/File/FileUtil.h"
Expand All @@ -35,7 +31,6 @@
#include "GPU/GPUInterface.h"
#include "GPU/GPUState.h"

#ifndef USING_QT_UI
// This is used to make non-ASCII paths work for filename.
// Technically only needed on Windows.
class JPEGFileStream : public jpge::output_stream
Expand Down Expand Up @@ -118,7 +113,6 @@ static bool WriteScreenshotToPNG(png_imagep image, const char *filename, int con
return false;
}
}
#endif

static bool ConvertPixelTo8888RGBA(GPUDebugBufferFormat fmt, u8 &r, u8 &g, u8 &b, u8 &a, const void *buffer, int offset, bool rev) {
const u8 *buf8 = (const u8 *)buffer;
Expand Down Expand Up @@ -348,10 +342,6 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
}

bool Save888RGBScreenshot(const char *filename, ScreenshotFormat fmt, const u8 *bufferRGB888, int w, int h) {
#ifdef USING_QT_UI
QImage image(bufferRGB888, w, h, QImage::Format_RGB888);
return image.save(filename, fmt == ScreenshotFormat::PNG ? "PNG" : "JPG");
#else
if (fmt == ScreenshotFormat::PNG) {
png_image png;
memset(&png, 0, sizeof(png));
Expand All @@ -374,14 +364,9 @@ bool Save888RGBScreenshot(const char *filename, ScreenshotFormat fmt, const u8 *
} else {
return false;
}
#endif
}

bool Save8888RGBAScreenshot(const char *filename, const u8 *buffer, int w, int h) {
#ifdef USING_QT_UI
QImage image(buffer, w, h, QImage::Format_RGBA8888);
return image.save(filename, "PNG");
#else
png_image png;
memset(&png, 0, sizeof(png));
png.version = PNG_IMAGE_VERSION;
Expand All @@ -396,5 +381,4 @@ bool Save8888RGBAScreenshot(const char *filename, const u8 *buffer, int w, int h
success = false;
}
return success;
#endif
}