代码:
/** @class SpriteFrameCache
* @brief Singleton that handles the loading of the sprite frames.
It saves in a cache the sprite frames.
@since v0.9
@js cc.spriteFrameCache
*/
// 精灵帧缓存区
// 加载精灵帧的单例控制器
// 他将精灵帧存入一个缓存中
class CC_DLL SpriteFrameCache : public Ref
{
public:
/** Returns the shared instance of the Sprite Frame cache.
*
* @return The instance of the Sprite Frame Cache.
* @js NA
*/
// 得到单例
static SpriteFrameCache* getInstance();
/** @deprecated Use getInstance() instead
@js NA
*/
CC_DEPRECATED_ATTRIBUTE static SpriteFrameCache* sharedSpriteFrameCache() { return SpriteFrameCache::getInstance(); }
/** Destroys the cache. It releases all the Sprite Frames and the retained instance.
* @js NA
*/
// 销毁单例
static void destroyInstance();
/** @deprecated Use destroyInstance() instead
* @js NA
*/
CC_DEPRECATED_ATTRIBUTE static void purgeSharedSpriteFrameCache() { return SpriteFrameCache::destroyInstance(); }
/** Destructor.
* @js NA
* @lua NA
*/
virtual ~SpriteFrameCache();
/** Initialize method.
*
* @return