BlurSprite* BlurSprite::create(std::string v_fpath) { BlurSprite *rtn = new BlurSprite(); if (rtn&&rtn->init(v_fpath)) { rtn->autorelease(); return rtn; } CC_SAFE_DELETE(rtn); return NULL; }
BlurSprite* BlurSprite::create(const char* filename) { BlurSprite * ret = new BlurSprite(); if (ret && ret->initWithFile(filename)) { ret->autorelease(); return ret; } CC_SAFE_RELEASE(ret); return NULL; }
BlurSprite* BlurSprite::create(const char *pszFileName) { BlurSprite* pRet = new (std::nothrow) BlurSprite(); if (pRet && pRet->initWithFile(pszFileName)) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; }
BlurSprite* BlurSprite::createWithTexture(CCTexture2D *pTexture) { CCAssert(pTexture != NULL, "Invalid texture for sprite"); CCRect rect = CCRectZero; rect.size = pTexture->getContentSize(); BlurSprite *ret = new BlurSprite(); if (ret && ret->initWithTexture(pTexture, rect)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return NULL; }