COMMON: Added compilation safeguards for the png decoder
This commit is contained in:
parent
b3bc35c62a
commit
9bbfa2846b
2 changed files with 19 additions and 0 deletions
|
@ -21,6 +21,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "graphics/png.h"
|
#include "graphics/png.h"
|
||||||
|
|
||||||
|
#ifdef GRAPHICS_PNG_H
|
||||||
|
|
||||||
#include "graphics/pixelformat.h"
|
#include "graphics/pixelformat.h"
|
||||||
#include "graphics/surface.h"
|
#include "graphics/surface.h"
|
||||||
|
|
||||||
|
@ -489,3 +492,5 @@ void PNG::readTransparencyChunk(uint32 chunkLength) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of Graphics namespace
|
} // End of Graphics namespace
|
||||||
|
|
||||||
|
#endif // GRAPHICS_PNG_H
|
||||||
|
|
|
@ -23,8 +23,20 @@
|
||||||
/*
|
/*
|
||||||
* PNG decoder used in engines:
|
* PNG decoder used in engines:
|
||||||
* - sword25
|
* - 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
|
#ifndef GRAPHICS_PNG_H
|
||||||
#define GRAPHICS_PNG_H
|
#define GRAPHICS_PNG_H
|
||||||
|
|
||||||
|
@ -164,3 +176,5 @@ private:
|
||||||
} // End of Graphics namespace
|
} // End of Graphics namespace
|
||||||
|
|
||||||
#endif // GRAPHICS_PNG_H
|
#endif // GRAPHICS_PNG_H
|
||||||
|
|
||||||
|
#endif // Engine and zlib guard
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue