From 17946c084a6ced305457020b635c36e2323f58da Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 25 Jul 2013 21:59:37 +0800 Subject: [PATCH] issue #2430:fix android compiling error --- cocos2dx/platform/CCImageCommon_cpp.h | 16 ++++++++-------- cocos2dx/textures/CCTextureCache.cpp | 6 +++--- cocos2dx/textures/CCTextureCache.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cocos2dx/platform/CCImageCommon_cpp.h b/cocos2dx/platform/CCImageCommon_cpp.h index b68ff02c40..b0474c9220 100644 --- a/cocos2dx/platform/CCImageCommon_cpp.h +++ b/cocos2dx/platform/CCImageCommon_cpp.h @@ -91,7 +91,7 @@ Image::~Image() CC_SAFE_DELETE_ARRAY(_data); } -bool Image::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/) +bool Image::initWithImageFile(const char * strPath, Format eImgFmt/* = eFmtPng*/) { bool bRet = false; @@ -128,7 +128,7 @@ bool Image::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFm return bRet; } -bool Image::initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType) +bool Image::initWithImageFileThreadSafe(const char *fullpath, Format imageType) { bool bRet = false; unsigned long nSize = 0; @@ -148,7 +148,7 @@ bool Image::initWithImageFileThreadSafe(const char *fullpath, EImageFormat image bool Image::initWithImageData(void * pData, int nDataLen, - EImageFormat eFmt/* = eSrcFmtPng*/, + Format eFmt/* = eSrcFmtPng*/, int nWidth/* = 0*/, int nHeight/* = 0*/, int nBitsPerComponent/* = 8*/) @@ -158,27 +158,27 @@ bool Image::initWithImageData(void * pData, { CC_BREAK_IF(! pData || nDataLen <= 0); - if (kFmtPng == eFmt) + if (FORMAT_PNG == eFmt) { bRet = _initWithPngData(pData, nDataLen); break; } - else if (kFmtJpg == eFmt) + else if (FORMAT_JPG == eFmt) { bRet = _initWithJpgData(pData, nDataLen); break; } - else if (kFmtTiff == eFmt) + else if (FORMAT_TIFF == eFmt) { bRet = _initWithTiffData(pData, nDataLen); break; } - else if (kFmtWebp == eFmt) + else if (FORMAT_WEBP == eFmt) { bRet = _initWithWebpData(pData, nDataLen); break; } - else if (kFmtRawData == eFmt) + else if (FORMAT_RAW_DATA == eFmt) { bRet = initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent, false); break; diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos2dx/textures/CCTextureCache.cpp index 7c91edf3fe..2f30f1741e 100644 --- a/cocos2dx/textures/CCTextureCache.cpp +++ b/cocos2dx/textures/CCTextureCache.cpp @@ -433,7 +433,7 @@ Texture2D * TextureCache::addPVRImage(const char* path) { #if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name - VolatileTexture::addImageTexture(texture, fullpath.c_str(), Image::kFmtRawData); + VolatileTexture::addImageTexture(texture, fullpath.c_str(), Image::FORMAT_RAW_DATA); #endif _textures->setObject(texture, key.c_str()); texture->autorelease(); @@ -643,7 +643,7 @@ VolatileTexture::VolatileTexture(Texture2D *t) , _textureData(NULL) , _pixelFormat(Texture2D::PIXEL_FORMAT_RGBA8888) , _fileName("") -, _fmtImage(Image::kFmtPng) +, _fmtImage(Image::FORMAT_PNG) , _text("") , _uiImage(NULL) { @@ -660,7 +660,7 @@ VolatileTexture::~VolatileTexture() CC_SAFE_RELEASE(_uiImage); } -void VolatileTexture::addImageTexture(Texture2D *tt, const char* imageFileName, Image::EImageFormat format) +void VolatileTexture::addImageTexture(Texture2D *tt, const char* imageFileName, Image::Format format) { if (_isReloading) { diff --git a/cocos2dx/textures/CCTextureCache.h b/cocos2dx/textures/CCTextureCache.h index 36d0ab0b18..82d199609f 100644 --- a/cocos2dx/textures/CCTextureCache.h +++ b/cocos2dx/textures/CCTextureCache.h @@ -218,7 +218,7 @@ public: VolatileTexture(Texture2D *t); ~VolatileTexture(); - static void addImageTexture(Texture2D *tt, const char* imageFileName, Image::EImageFormat format); + static void addImageTexture(Texture2D *tt, const char* imageFileName, Image::Format format); static void addStringTexture(Texture2D *tt, const char* text, const FontDefinition& fontDefinition); static void addDataTexture(Texture2D *tt, void* data, Texture2D::PixelFormat pixelFormat, const Size& contentSize); static void addImage(Texture2D *tt, Image *image); @@ -248,7 +248,7 @@ protected: Texture2D::PixelFormat _pixelFormat; std::string _fileName; - Image::EImageFormat _fmtImage; + Image::Format _fmtImage; ccTexParams _texParams; std::string _text;