From 6ea758db67d1e8236e32f93b79fab985faad602f Mon Sep 17 00:00:00 2001 From: Sacha Date: Sun, 8 Dec 2013 01:42:17 +1000 Subject: [PATCH] Use libpng to load PNGs. Fixes #4689. --- CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++-- Qt/Native.pro | 6 ++++++ native | 2 +- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05d38bdae5..e9ce3c0d57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -557,6 +557,37 @@ target_link_libraries(libzip ${ZLIB_LIBRARY}) include_directories(native/ext/libzip) set(LIBZIP_LIBRARY libzip) +if (BLACKBERRY) + set(LIBPNG_LIBRARY png) +else() + add_library(png16 STATIC + native/ext/libpng16/pngconf.h + native/ext/libpng16/pngdebug.h + native/ext/libpng16/png.c + native/ext/libpng16/png.h + native/ext/libpng16/pngerror.c + native/ext/libpng16/pngget.c + native/ext/libpng16/pnginfo.h + native/ext/libpng16/pnglibconf.h + native/ext/libpng16/pngmem.c + native/ext/libpng16/pngpread.c + native/ext/libpng16/pngpriv.h + native/ext/libpng16/pngread.c + native/ext/libpng16/pngrio.c + native/ext/libpng16/pngrtran.c + native/ext/libpng16/pngrutil.c + native/ext/libpng16/pngset.c + native/ext/libpng16/pngstruct.h + native/ext/libpng16/pngtest.c + native/ext/libpng16/pngtrans.c + native/ext/libpng16/pngwio.c + native/ext/libpng16/pngwrite.c + native/ext/libpng16/pngwtran.c + native/ext/libpng16/pngwutil.c) + set(LIBPNG_LIBRARY png16) + include_directories(native/ext/libpng16) +endif() + set(nativeExtra) set(nativeExtraLibs) if(ANDROID) @@ -598,7 +629,7 @@ elseif(USING_QT_UI) endif() elseif(BLACKBERRY) set(nativeExtra ${nativeExtra} native/base/BlackberryMain.cpp native/base/BlackberryDisplay.cpp) - set(nativeExtraLibs ${nativeExtraLibs} OpenAL bps screen socket EGL png) + set(nativeExtraLibs ${nativeExtraLibs} OpenAL bps screen socket EGL) set(TargetBin PPSSPPBlackberry) elseif(SDL_FOUND) set(TargetBin PPSSPPSDL) @@ -783,7 +814,7 @@ add_library(native STATIC native/ext/jpge/jpge.cpp native/ext/jpge/jpge.h) include_directories(native) -target_link_libraries(native ${LIBZIP_LIBRARY} rg_etc1 vjson stb_image stb_vorbis snappy ${GLEW_LIBRARIES}) +target_link_libraries(native ${LIBZIP_LIBRARY} ${LIBPNG_LIBRARY} rg_etc1 vjson stb_image stb_vorbis snappy ${GLEW_LIBRARIES}) if(ANDROID) target_link_libraries(native log) diff --git a/Qt/Native.pro b/Qt/Native.pro index d53ffde45a..c1b7310087 100755 --- a/Qt/Native.pro +++ b/Qt/Native.pro @@ -69,6 +69,12 @@ win32|contains(QT_CONFIG, no-zlib) { SOURCES += $$P/native/ext/libzip/*.c HEADERS += $$P/native/ext/libzip/*.h +# Libpng +SOURCES += $$P/native/ext/libpng16/*.c +HEADERS += $$P/native/ext/libpng16/*.h +INCLUDEPATH += $$P/native/ext/libpng16 + + # Native SOURCES += $$P/native/audio/*.cpp \ diff --git a/native b/native index 4e2212de40..64b5146718 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 4e2212de407cafb175091fce0e236dfaaa9d4226 +Subproject commit 64b5146718c768818c6819057d00712acf31631e