mirror of https://github.com/axmolengine/axmol.git
Merge pull request #969 from dumganhar/gles20
fixed #1300: Typo: CC_ENABLE_CACHE_TEXTTURE_DATA -> CC_ENABLE_CACHE_TEXTURE_DATA
This commit is contained in:
commit
c8b62d4ec8
|
@ -224,7 +224,7 @@ void CCRenderTexture::end(bool bIsTOCacheTexture)
|
||||||
|
|
||||||
director->setProjection(director->getProjection());
|
director->setProjection(director->getProjection());
|
||||||
|
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
if (bIsTOCacheTexture)
|
if (bIsTOCacheTexture)
|
||||||
{
|
{
|
||||||
CC_SAFE_DELETE(m_pUITextureImage);
|
CC_SAFE_DELETE(m_pUITextureImage);
|
||||||
|
|
|
@ -31,16 +31,16 @@
|
||||||
#include "CCPlatformConfig.h"
|
#include "CCPlatformConfig.h"
|
||||||
#include "CCPlatformDefine.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.
|
Enable it if you want to cache the texture data.
|
||||||
Basically,it's only enabled in android
|
Basically,it's only enabled in android
|
||||||
|
|
||||||
It's new in cocos2d-x since v0.99.5
|
It's new in cocos2d-x since v0.99.5
|
||||||
*/
|
*/
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||||
#define CC_ENABLE_CACHE_TEXTTURE_DATA 1
|
#define CC_ENABLE_CACHE_TEXTURE_DATA 1
|
||||||
#else
|
#else
|
||||||
#define CC_ENABLE_CACHE_TEXTTURE_DATA 0
|
#define CC_ENABLE_CACHE_TEXTURE_DATA 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
|
|
|
@ -45,7 +45,7 @@ THE SOFTWARE.
|
||||||
#include "ccGLStateCache.h"
|
#include "ccGLStateCache.h"
|
||||||
#include "CCShaderCache.h"
|
#include "CCShaderCache.h"
|
||||||
|
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
#include "CCTextureCache.h"
|
#include "CCTextureCache.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ CCTexture2D::CCTexture2D()
|
||||||
|
|
||||||
CCTexture2D::~CCTexture2D()
|
CCTexture2D::~CCTexture2D()
|
||||||
{
|
{
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
VolatileTexture::removeTexture(this);
|
VolatileTexture::removeTexture(this);
|
||||||
#endif
|
#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)
|
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
|
// cache the texture data
|
||||||
VolatileTexture::addStringTexture(this, text, dimensions, alignment, fontName, fontSize);
|
VolatileTexture::addStringTexture(this, text, dimensions, alignment, fontName, fontSize);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -361,7 +361,7 @@ void CCTextureCache::addImageAsyncCallBack(ccTime dt)
|
||||||
texture->initWithImage(pImage);
|
texture->initWithImage(pImage);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
// cache the texture file name
|
// cache the texture file name
|
||||||
VolatileTexture::addImageTexture(texture, filename, pImageInfo->imageType);
|
VolatileTexture::addImageTexture(texture, filename, pImageInfo->imageType);
|
||||||
#endif
|
#endif
|
||||||
|
@ -449,7 +449,7 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
|
||||||
|
|
||||||
if( texture )
|
if( texture )
|
||||||
{
|
{
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
// cache the texture file name
|
// cache the texture file name
|
||||||
VolatileTexture::addImageTexture(texture, fullpath.c_str(), eImageFormat);
|
VolatileTexture::addImageTexture(texture, fullpath.c_str(), eImageFormat);
|
||||||
#endif
|
#endif
|
||||||
|
@ -527,7 +527,7 @@ CCTexture2D * CCTextureCache::addPVRImage(const char* path)
|
||||||
tex = new CCTexture2D();
|
tex = new CCTexture2D();
|
||||||
if(tex != NULL && tex->initWithPVRFile(fullpath.c_str()) )
|
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
|
// cache the texture file name
|
||||||
VolatileTexture::addImageTexture(tex, fullpath.c_str(), CCImage::kFmtRawData);
|
VolatileTexture::addImageTexture(tex, fullpath.c_str(), CCImage::kFmtRawData);
|
||||||
#endif
|
#endif
|
||||||
|
@ -582,7 +582,7 @@ CCTexture2D* CCTextureCache::addUIImage(CCImage *image, const char *key)
|
||||||
|
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
VolatileTexture::addCCImage(texture, image);
|
VolatileTexture::addCCImage(texture, image);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ CCTexture2D* CCTextureCache::textureForKey(const char* key)
|
||||||
|
|
||||||
void CCTextureCache::reloadAllTextures()
|
void CCTextureCache::reloadAllTextures()
|
||||||
{
|
{
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
VolatileTexture::reloadAllTextures();
|
VolatileTexture::reloadAllTextures();
|
||||||
#endif
|
#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));
|
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*> VolatileTexture::textures;
|
std::list<VolatileTexture*> VolatileTexture::textures;
|
||||||
bool VolatileTexture::isReloading = false;
|
bool VolatileTexture::isReloading = false;
|
||||||
|
@ -897,7 +897,7 @@ void VolatileTexture::reloadAllTextures()
|
||||||
isReloading = false;
|
isReloading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CC_ENABLE_CACHE_TEXTTURE_DATA
|
#endif // CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ THE SOFTWARE.
|
||||||
#include "CCTexture2D.h"
|
#include "CCTexture2D.h"
|
||||||
|
|
||||||
|
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
#include "CCImage.h"
|
#include "CCImage.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
#endif
|
#endif
|
||||||
|
@ -163,12 +163,12 @@ public:
|
||||||
CCTexture2D* addPVRImage(const char* filename);
|
CCTexture2D* addPVRImage(const char* filename);
|
||||||
|
|
||||||
/** Reload all textures
|
/** 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();
|
static void reloadAllTextures();
|
||||||
};
|
};
|
||||||
|
|
||||||
#if CC_ENABLE_CACHE_TEXTTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
|
|
||||||
class VolatileTexture
|
class VolatileTexture
|
||||||
{
|
{
|
||||||
|
|
|
@ -195,7 +195,7 @@ void RenderTextureTest::ccTouchesMoved(CCSet* touches, CCEvent* event)
|
||||||
|
|
||||||
void RenderTextureTest::ccTouchesEnded(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;
|
CCSetIterator it;
|
||||||
CCTouch* touch;
|
CCTouch* touch;
|
||||||
|
|
Loading…
Reference in New Issue