mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-24 02:15:37 +01:00
Add #define guard to including IO with PVRTC
This commit is contained in:
parent
995eacd5b6
commit
e59541e30a
@ -68,6 +68,8 @@ SET( SOURCES
|
||||
src/PVRTCImage.cpp
|
||||
)
|
||||
|
||||
OPTION(DEBUG_PVRTC_DECODER "Output intermediate images during PVRTC decoding." OFF)
|
||||
|
||||
CONFIGURE_FILE(
|
||||
"config/PVRTCDefines.h.in"
|
||||
"include/PVRTCDefines.h"
|
||||
@ -87,7 +89,9 @@ ADD_LIBRARY( PVRTCEncoder
|
||||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES( PVRTCEncoder FasTCBase )
|
||||
TARGET_LINK_LIBRARIES( PVRTCEncoder FasTCIO )
|
||||
IF( DEBUG_PVRTC_DECODER )
|
||||
TARGET_LINK_LIBRARIES( PVRTCEncoder FasTCIO )
|
||||
ENDIF( DEBUG_PVRTC_DECODER )
|
||||
|
||||
IF( PVRTEXLIB_FOUND )
|
||||
TARGET_LINK_LIBRARIES( PVRTCEncoder ${PVRTEXLIB_LIBRARIES} )
|
||||
|
@ -51,3 +51,4 @@
|
||||
*/
|
||||
|
||||
#cmakedefine PVRTEXLIB_FOUND
|
||||
#cmakedefine DEBUG_PVRTC_DECODER
|
||||
|
@ -66,7 +66,9 @@
|
||||
#include "Pixel.h"
|
||||
using FasTC::Pixel;
|
||||
|
||||
#include "../../IO/include/ImageFile.h"
|
||||
#ifdef DEBUG_PVRTC_DECODER
|
||||
# include "../../IO/include/ImageFile.h"
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline T Clamp(const T &v, const T &a, const T &b) {
|
||||
@ -540,6 +542,7 @@ uint32 Image::GetPixelIndex(int32 i, int32 j, EWrapMode wrapMode) const {
|
||||
return idx;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PVRTC_DECODER
|
||||
void Image::DebugOutput(const char *filename) const {
|
||||
uint32 *outPixels = new uint32[GetWidth() * GetHeight()];
|
||||
const uint8 fullDepth[4] = { 8, 8, 8, 8 };
|
||||
@ -561,5 +564,8 @@ void Image::DebugOutput(const char *filename) const {
|
||||
::ImageFile imgFile(debugFilename, eFileFormat_PNG, img);
|
||||
imgFile.Write();
|
||||
}
|
||||
#else
|
||||
void Image::DebugOutput(const char *filename) const { }
|
||||
#endif // DEBUG_PVRTC_DECODER
|
||||
|
||||
} // namespace PVRTCC
|
||||
|
Loading…
Reference in New Issue
Block a user