mirror of https://github.com/axmolengine/axmol.git
Fix compile error: using any of CC_USE_JPEG=0, CC_USE_PNG=0, CC_USE_TIFF=0, CC_USE_WIC=0
When I don't want to use TIF file, Cocos2d-x ccConfig.h's style is.. #define CC_USE_TIF 0 But CCImage.cpp just check wheather defined or not..
This commit is contained in:
parent
7e9019f9d6
commit
134355d763
|
@ -923,9 +923,9 @@ bool Image::encodeWithWIC(const std::string& filePath, bool isToRGB, GUID contai
|
||||||
|
|
||||||
bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen)
|
bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen)
|
||||||
{
|
{
|
||||||
#if defined(CC_USE_WIC)
|
#if CC_USE_WIC
|
||||||
return decodeWithWIC(data, dataLen);
|
return decodeWithWIC(data, dataLen);
|
||||||
#elif defined(CC_USE_JPEG)
|
#elif CC_USE_JPEG
|
||||||
/* these are standard libjpeg structures for reading(decompression) */
|
/* these are standard libjpeg structures for reading(decompression) */
|
||||||
struct jpeg_decompress_struct cinfo;
|
struct jpeg_decompress_struct cinfo;
|
||||||
/* We use our private extension JPEG error handler.
|
/* We use our private extension JPEG error handler.
|
||||||
|
@ -1019,9 +1019,9 @@ bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen)
|
||||||
|
|
||||||
bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen)
|
bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen)
|
||||||
{
|
{
|
||||||
#if defined(CC_USE_WIC)
|
#if CC_USE_WIC
|
||||||
return decodeWithWIC(data, dataLen);
|
return decodeWithWIC(data, dataLen);
|
||||||
#elif defined(CC_USE_PNG)
|
#elif CC_USE_PNG
|
||||||
// length of bytes to check if it is a valid png file
|
// length of bytes to check if it is a valid png file
|
||||||
#define PNGSIGSIZE 8
|
#define PNGSIGSIZE 8
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
@ -1288,9 +1288,9 @@ namespace
|
||||||
|
|
||||||
bool Image::initWithTiffData(const unsigned char * data, ssize_t dataLen)
|
bool Image::initWithTiffData(const unsigned char * data, ssize_t dataLen)
|
||||||
{
|
{
|
||||||
#if defined(CC_USE_WIC)
|
#if CC_USE_WIC
|
||||||
return decodeWithWIC(data, dataLen);
|
return decodeWithWIC(data, dataLen);
|
||||||
#elif defined(CC_USE_TIFF)
|
#elif CC_USE_TIFF
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -2253,9 +2253,9 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB)
|
||||||
|
|
||||||
bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB)
|
bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB)
|
||||||
{
|
{
|
||||||
#if defined(CC_USE_WIC)
|
#if CC_USE_WIC
|
||||||
return encodeWithWIC(filePath, isToRGB, GUID_ContainerFormatPng);
|
return encodeWithWIC(filePath, isToRGB, GUID_ContainerFormatPng);
|
||||||
#elif defined(CC_USE_PNG)
|
#elif CC_USE_PNG
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -2405,9 +2405,9 @@ bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB)
|
||||||
|
|
||||||
bool Image::saveImageToJPG(const std::string& filePath)
|
bool Image::saveImageToJPG(const std::string& filePath)
|
||||||
{
|
{
|
||||||
#if defined(CC_USE_WIC)
|
#if CC_USE_WIC
|
||||||
return encodeWithWIC(filePath, false, GUID_ContainerFormatJpeg);
|
return encodeWithWIC(filePath, false, GUID_ContainerFormatJpeg);
|
||||||
#elif defined(CC_USE_JPEG)
|
#elif CC_USE_JPEG
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue