Qt: Use inbuilt png handler instead of building libpng. Resolves a conflict with QWidget and QPainter in desktop menus.

This commit is contained in:
Sacha committed 2014-06-18 15:37:12 +10:00
1 parent f92a842a34
commit 46abce78c0
3 files changed
+13 -14

No files matched your search

-7
View File
@@ -61,13 +61,6 @@ win32|contains(QT_CONFIG, no-zlib) {
SOURCES += $$P/native/ext/libzip/*.c
HEADERS += $$P/native/ext/libzip/*.h
# Libpng
SOURCES += $$P/native/ext/libpng17/*.c
HEADERS += $$P/native/ext/libpng17/*.h
armv7: SOURCES += $$P/native/ext/libpng17/arm/*.c
INCLUDEPATH += $$P/native/ext
# Native
SOURCES += $$P/native/audio/*.cpp \
+3 -2
View File
@@ -4,8 +4,6 @@ TARGET = PPSSPPQt
QT += core gui opengl
include(Settings.pri)
!release:symbian:MMP_RULES += "DEBUGGABLE"
lessThan(QT_MAJOR_VERSION, 5) {
lessThan(QT_MAJOR_VERSION, 4) | lessThan(QT_MINOR_VERSION, 7) {
error(PPSSPP requires Qt 4.7 or newer but Qt $$[QT_VERSION] was detected.)
@@ -117,6 +115,8 @@ INCLUDEPATH += $$P $$P/Common $$P/native $$P/native/ext
FORMS += $$P/Qt/Debugger/*.ui
RESOURCES += $$P/Qt/desktop_assets.qrc
INCLUDEPATH += $$P/Qt $$P/Qt/Debugger
# Creating translations should be done by Qt, really
LREL_TOOL = $$[QT_INSTALL_BINS]/lrelease
greaterThan(QT_MAJOR_VERSION, 4) {
exists($${LREL_TOOL}-qt5): LREL_TOOL=$${LREL_TOOL}-qt5
@@ -149,6 +149,7 @@ symbian {
ICON = $$P/assets/icon.svg
DEPLOYMENT += vendor_deploy
MMP_RULES += "DEBUGGABLE"
# 268 MB maximum
TARGET.EPOCHEAPSIZE = 0x40000 0x10000000
+10 -5
View File
@@ -33,7 +33,7 @@
#include <algorithm>
#endif
#if defined(_WIN32) || (defined(USING_QT_UI) && !defined(MOBILE_DEVICE))
#if defined(_WIN32)
#include <libpng17/png.h>
#include "ext/jpge/jpge.h"
#endif
@@ -565,15 +565,19 @@ void TakeScreenshot() {
// Okay, allocate a buffer.
u8 *buffer = new u8[3 * pixel_xres * pixel_yres];
// Silly openGL reads upside down, we flip to another buffer for simplicity.
u8 *flipbuffer = new u8[3 * pixel_xres * pixel_yres];
glReadPixels(0, 0, pixel_xres, pixel_yres, GL_RGB, GL_UNSIGNED_BYTE, buffer);
#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");
#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);
}
if (g_Config.bScreenshotsAsPNG) {
png_image png;
memset(&png, 0, sizeof(png));
@@ -588,9 +592,10 @@ void TakeScreenshot() {
params.m_quality = 90;
compress_image_to_jpeg_file(filename, pixel_xres, pixel_yres, 3, flipbuffer, params);
}
delete [] flipbuffer;
#endif
delete [] buffer;
delete [] flipbuffer;
osm.Show(filename);
#endif