CCTextureAtlas * CCTextureAtlas::textureAtlasWithFile(const char* file, unsigned int capacity) { CCTextureAtlas * pTextureAtlas = new CCTextureAtlas(); if(pTextureAtlas && pTextureAtlas->initWithFile(file, capacity)) { pTextureAtlas->autorelease(); return pTextureAtlas; } CC_SAFE_DELETE(pTextureAtlas); return NULL; }
CCTextureAtlas * CCTextureAtlas::textureAtlasWithTexture(CCTexture2D *texture, unsigned int capacity) { CCTextureAtlas * pTextureAtlas = new CCTextureAtlas(); if (pTextureAtlas && pTextureAtlas->initWithTexture(texture, capacity)) { pTextureAtlas->autorelease(); return pTextureAtlas; } CC_SAFE_DELETE(pTextureAtlas); return NULL; }
CCTextureAtlas* CCTextureAtlas::createWithTexture ( CCTexture2D* pTexture, KDuint uCapacity ) { CCTextureAtlas* pRet = new CCTextureAtlas ( ); if ( pRet && pRet->initWithTexture ( pTexture, uCapacity ) ) { pRet->autorelease ( ); } else { CC_SAFE_DELETE ( pRet ); } return pRet; }
CCTextureAtlas* CCTextureAtlas::create ( const KDchar* szFilePath, KDuint uCapacity ) { CCTextureAtlas* pRet = new CCTextureAtlas ( ); if ( pRet && pRet->initWithFile ( szFilePath, uCapacity ) ) { pRet->autorelease ( ); } else { CC_SAFE_DELETE ( pRet ); } return pRet; }