From 9bbfa2846b81fc8ed2f2872fa7fe818145ac8c69 Mon Sep 17 00:00:00 2001 From: md5 Date: Fri, 13 May 2011 20:34:25 +0300 Subject: COMMON: Added compilation safeguards for the png decoder --- graphics/png.cpp | 5 +++++ graphics/png.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'graphics') diff --git a/graphics/png.cpp b/graphics/png.cpp index 6fd3e2b24b..e6dceab3fa 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -21,6 +21,9 @@ */ #include "graphics/png.h" + +#ifdef GRAPHICS_PNG_H + #include "graphics/pixelformat.h" #include "graphics/surface.h" @@ -489,3 +492,5 @@ void PNG::readTransparencyChunk(uint32 chunkLength) { } } // End of Graphics namespace + +#endif // GRAPHICS_PNG_H diff --git a/graphics/png.h b/graphics/png.h index 50e7a17ec8..3f8ea85320 100644 --- a/graphics/png.h +++ b/graphics/png.h @@ -23,8 +23,20 @@ /* * PNG decoder used in engines: * - sword25 + * Dependencies: + * - zlib */ +// Currently, only the sword25 engine uses the PNG decoder, so skip compiling +// it if sword25 is not enabled, or if zlib (a required dependency) is not +// enabled. + +#if !(defined(ENABLE_SWORD25) || defined(USE_ZLIB)) + +// Do not compile the PNG decoder code + +#else + #ifndef GRAPHICS_PNG_H #define GRAPHICS_PNG_H @@ -164,3 +176,5 @@ private: } // End of Graphics namespace #endif // GRAPHICS_PNG_H + +#endif // Engine and zlib guard -- cgit v1.2.3