Browse Source

Made the TurboJPEG code for decoding and encoding images disable-able.

--HG--
branch : minor
Alex Szpakowski 10 years ago
parent
commit
d0300a4fa7

+ 4 - 0
src/modules/image/magpie/Image.cpp

@@ -43,7 +43,11 @@ namespace magpie
 Image::Image()
 {
 	formatHandlers.push_back(new PNGHandler);
+
+#ifndef LOVE_NO_TURBOJPEG
 	formatHandlers.push_back(new JPEGHandler);
+#endif
+
 	formatHandlers.push_back(new STBHandler);
 
 #ifdef LOVE_SUPPORT_IMAGEIO

+ 6 - 1
src/modules/image/magpie/JPEGHandler.cpp

@@ -18,8 +18,11 @@
  * 3. This notice may not be removed or altered from any source distribution.
  **/
 
-// LOVE
 #include "JPEGHandler.h"
+
+#ifndef LOVE_NO_TURBOJPEG
+
+// LOVE
 #include "common/Exception.h"
 #include "common/math.h"
 
@@ -161,3 +164,5 @@ FormatHandler::EncodedImage JPEGHandler::encode(const DecodedImage &img, ImageDa
 } // magpie
 } // image
 } // love
+
+#endif // LOVE_NO_TURBOJPEG

+ 6 - 0
src/modules/image/magpie/JPEGHandler.h

@@ -21,6 +21,10 @@
 #ifndef LOVE_IMAGE_MAGPIE_JPEG_HANDLER_H
 #define LOVE_IMAGE_MAGPIE_JPEG_HANDLER_H
 
+#include "common/config.h"
+
+#ifndef LOVE_NO_TURBOJPEG
+
 // LOVE
 #include "FormatHandler.h"
 #include "thread/threads.h"
@@ -72,4 +76,6 @@ private:
 } // image
 } // love
 
+#endif // LOVE_NO_TURBOJPEG
+
 #endif // LOVE_IMAGE_MAGPIE_JPEG_HANDLER_H