summaryrefslogtreecommitdiffstats
path: root/minuitwrp/resources.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'minuitwrp/resources.cpp')
-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;
}