aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormd52011-05-13 20:34:25 +0300
committermd52011-05-13 20:34:25 +0300
commit9bbfa2846b81fc8ed2f2872fa7fe818145ac8c69 (patch)
tree5b846fcb9815eb637240f1664f5e5e240347c06d
parentb3bc35c62abb3a3b707409e2eac61ac2d2978d91 (diff)
downloadscummvm-rg350-9bbfa2846b81fc8ed2f2872fa7fe818145ac8c69.tar.gz
scummvm-rg350-9bbfa2846b81fc8ed2f2872fa7fe818145ac8c69.tar.bz2
scummvm-rg350-9bbfa2846b81fc8ed2f2872fa7fe818145ac8c69.zip
COMMON: Added compilation safeguards for the png decoder
-rw-r--r--graphics/png.cpp5
-rw-r--r--graphics/png.h14
2 files changed, 19 insertions, 0 deletions
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