summaryrefslogtreecommitdiffstats
path: root/minuitwrp/resources.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-01-27 17:57:26 +0100
committerEthan Yonker <dees_troy@teamw.in>2016-01-27 17:58:02 +0100
commite95c4868b9ba215e858294fb4d0bfbf2634d01f4 (patch)
tree8f8bb99a064cfc7f8cb58dfa610620c9b44b5bf3 /minuitwrp/resources.cpp
parentUpdate minuitwrp graphics in line with latest minui (diff)
downloadandroid_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.tar
android_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.tar.gz
android_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.tar.bz2
android_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.tar.lz
android_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.tar.xz
android_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.tar.zst
android_bootable_recovery-e95c4868b9ba215e858294fb4d0bfbf2634d01f4.zip
Diffstat (limited to '')
-rw-r--r--minuitwrp/resources.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/minuitwrp/resources.cpp b/minuitwrp/resources.cpp
index 781df2b06..c4325e412 100644
--- a/minuitwrp/resources.cpp
+++ b/minuitwrp/resources.cpp
@@ -31,9 +31,11 @@
#include <png.h>
#include <pixelflinger/pixelflinger.h>
+#ifdef TW_INCLUDE_JPEG
extern "C" {
#include "jpeglib.h"
}
+#endif
#include "minui.h"
#define SURFACE_DATA_ALIGNMENT 8
@@ -251,6 +253,7 @@ int res_create_surface_png(const char* name, gr_surface* pSurface) {
return result;
}
+#ifdef TW_INCLUDE_JPEG
int res_create_surface_jpg(const char* name, gr_surface* pSurface) {
GGLSurface* surface = NULL;
int result = 0, y;
@@ -348,18 +351,23 @@ exit:
}
return result;
}
+#endif
int res_create_surface(const char* name, gr_surface* pSurface) {
int ret;
if (!name) return -1;
+#ifdef TW_INCLUDE_JPEG
if (strlen(name) > 4 && strcmp(name + strlen(name) - 4, ".jpg") == 0)
return res_create_surface_jpg(name,pSurface);
+#endif
ret = res_create_surface_png(name,pSurface);
+#ifdef TW_INCLUDE_JPEG
if (ret < 0)
ret = res_create_surface_jpg(name,pSurface);
+#endif
return ret;
}