标签:
1 static CCTextureCache* sharedTextureCache(); //返回纹理缓存的全局单例 2 CCTexture2D* addImage(const char* fileimage); //添加一张纹理图片到缓存中 3 void removeUnusedTextures(); //清除不使用的纹理
1 static CCAnimationCache* sharedAnimationCache(void); //全局共享的缓存单例 2 void addAnimation(CCAnimation* animation, const char* name); //添加一个动画到缓存 3 void removeAnimationByName(const char* name); //移除一个指定的动画 4 CCAnimation* animationByName(const char* name); //获得事先存入的动画
1 void releaseCaches() 2 { 3 CCAnimationCache::purgeSharedAnimationCache(); 4 CCSpriteFrameCache::sharedSpriteFrameCache()->removeUnusedSpriteFrame(); 5 CCTextureCache::sharedTextureCache()->removeUnusedTextures(); 6 //清理顺序,应该先清理动画缓存,然后清理精灵帧,最后清理纹理。按照引用层级由高到低,以保证释放引用有效 7 }
标签:
原文地址:http://www.cnblogs.com/Blogs-young-chan/p/5251067.html