From 6bb2941ec98a225263eea7f17dcbfca8508d7e0b Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 6 Jun 2012 10:06:51 +0800 Subject: [PATCH] fixed #1300: Typo: CC_ENABLE_CACHE_TEXTTURE_DATA -> CC_ENABLE_CACHE_TEXTURE_DATA --- cocos2dx/misc_nodes/CCRenderTexture.cpp | 2 +- cocos2dx/platform/CCPlatformMacros.h | 6 +++--- cocos2dx/textures/CCTexture2D.cpp | 6 +++--- cocos2dx/textures/CCTextureCache.cpp | 14 +++++++------- cocos2dx/textures/CCTextureCache.h | 6 +++--- .../tests/RenderTextureTest/RenderTextureTest.cpp | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index c4eb592e00..7c144aee43 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -224,7 +224,7 @@ void CCRenderTexture::end(bool bIsTOCacheTexture) director->setProjection(director->getProjection()); -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA if (bIsTOCacheTexture) { CC_SAFE_DELETE(m_pUITextureImage); diff --git a/cocos2dx/platform/CCPlatformMacros.h b/cocos2dx/platform/CCPlatformMacros.h index e3fda7014c..ce752969d2 100644 --- a/cocos2dx/platform/CCPlatformMacros.h +++ b/cocos2dx/platform/CCPlatformMacros.h @@ -31,16 +31,16 @@ #include "CCPlatformConfig.h" #include "CCPlatformDefine.h" -/** @def CC_ENABLE_CACHE_TEXTTURE_DATA +/** @def CC_ENABLE_CACHE_TEXTURE_DATA Enable it if you want to cache the texture data. Basically,it's only enabled in android It's new in cocos2d-x since v0.99.5 */ #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - #define CC_ENABLE_CACHE_TEXTTURE_DATA 1 + #define CC_ENABLE_CACHE_TEXTURE_DATA 1 #else - #define CC_ENABLE_CACHE_TEXTTURE_DATA 0 + #define CC_ENABLE_CACHE_TEXTURE_DATA 0 #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 9bbc5feeaf..596fbaec37 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -45,7 +45,7 @@ THE SOFTWARE. #include "ccGLStateCache.h" #include "CCShaderCache.h" -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA #include "CCTextureCache.h" #endif @@ -78,7 +78,7 @@ CCTexture2D::CCTexture2D() CCTexture2D::~CCTexture2D() { -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTexture::removeTexture(this); #endif @@ -417,7 +417,7 @@ bool CCTexture2D::initWithString(const char *text, const char *fontName, float f } bool CCTexture2D::initWithString(const char *text, const CCSize& dimensions, CCTextAlignment alignment, const char *fontName, float fontSize) { -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture data VolatileTexture::addStringTexture(this, text, dimensions, alignment, fontName, fontSize); #endif diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos2dx/textures/CCTextureCache.cpp index 5fc57f22c7..c691a65f2d 100644 --- a/cocos2dx/textures/CCTextureCache.cpp +++ b/cocos2dx/textures/CCTextureCache.cpp @@ -361,7 +361,7 @@ void CCTextureCache::addImageAsyncCallBack(ccTime dt) texture->initWithImage(pImage); #endif -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTexture::addImageTexture(texture, filename, pImageInfo->imageType); #endif @@ -449,7 +449,7 @@ CCTexture2D * CCTextureCache::addImage(const char * path) if( texture ) { -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTexture::addImageTexture(texture, fullpath.c_str(), eImageFormat); #endif @@ -527,7 +527,7 @@ CCTexture2D * CCTextureCache::addPVRImage(const char* path) tex = new CCTexture2D(); if(tex != NULL && tex->initWithPVRFile(fullpath.c_str()) ) { -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTexture::addImageTexture(tex, fullpath.c_str(), CCImage::kFmtRawData); #endif @@ -582,7 +582,7 @@ CCTexture2D* CCTextureCache::addUIImage(CCImage *image, const char *key) } while (0); -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTexture::addCCImage(texture, image); #endif @@ -667,7 +667,7 @@ CCTexture2D* CCTextureCache::textureForKey(const char* key) void CCTextureCache::reloadAllTextures() { -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTexture::reloadAllTextures(); #endif } @@ -699,7 +699,7 @@ void CCTextureCache::dumpCachedTextureInfo() CCLOG("cocos2d: CCTextureCache dumpDebugInfo: %ld textures, for %lu KB (%.2f MB)", (long)count, (long)totalBytes / 1024, totalBytes / (1024.0f*1024.0f)); } -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA std::list VolatileTexture::textures; bool VolatileTexture::isReloading = false; @@ -897,7 +897,7 @@ void VolatileTexture::reloadAllTextures() isReloading = false; } -#endif // CC_ENABLE_CACHE_TEXTTURE_DATA +#endif // CC_ENABLE_CACHE_TEXTURE_DATA NS_CC_END diff --git a/cocos2dx/textures/CCTextureCache.h b/cocos2dx/textures/CCTextureCache.h index 1ed542a5ed..8a98477b41 100644 --- a/cocos2dx/textures/CCTextureCache.h +++ b/cocos2dx/textures/CCTextureCache.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include "CCTexture2D.h" -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA #include "CCImage.h" #include #endif @@ -163,12 +163,12 @@ public: CCTexture2D* addPVRImage(const char* filename); /** Reload all textures - It's only useful when the value of CC_ENABLE_CACHE_TEXTTURE_DATA is 1 + It's only useful when the value of CC_ENABLE_CACHE_TEXTURE_DATA is 1 */ static void reloadAllTextures(); }; -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA class VolatileTexture { diff --git a/tests/tests/RenderTextureTest/RenderTextureTest.cpp b/tests/tests/RenderTextureTest/RenderTextureTest.cpp index 821fbcf970..b4f42d3410 100644 --- a/tests/tests/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/tests/RenderTextureTest/RenderTextureTest.cpp @@ -195,7 +195,7 @@ void RenderTextureTest::ccTouchesMoved(CCSet* touches, CCEvent* event) void RenderTextureTest::ccTouchesEnded(CCSet* touches, CCEvent* event) { -#if CC_ENABLE_CACHE_TEXTTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA CCSetIterator it; CCTouch* touch;