CCFilteredSpriteWithOne* CCFilteredSpriteWithOne::createWithSpriteFrame(CCSpriteFrame* $pSpriteFrame)
{
CCFilteredSpriteWithOne pobSprite = new CCFilteredSpriteWithOne();
if ($pSpriteFrame && pobSprite)
{
if ($pSpriteFrame->isRotated())
{
CCSprite __sp = CCSprite::createWithSpriteFrame($pSpriteFrame);
CCSize __size = __sp->getContentSize();
__sp->setAnchorPoint(ccp(0,0));
__sp->setPosition(ccp(0,0));
CCRenderTexture* __rTex = CCRenderTexture::create(__size.width, __size.height);
__rTex->begin();
__sp->visit();
__rTex->end();
CCTexture2D* __newTex = new CCTexture2D();
__newTex->initWithImage(__rTex->newCCImage(true));
__newTex->autorelease();
pobSprite->initWithTexture(__newTex);
//CCLOG("==== CCFilteredSprite::initWithTexture, rotated true texture wh(%f,%f)", __newTex->getContentSize().width, __newTex->getContentSize().height);
}
else
{
pobSprite->initWithSpriteFrame($pSpriteFrame);
}
pobSprite->autorelease();
return pobSprite;
}
CC_SAFE_DELETE(pobSprite);
return NULL;
}
__newTex->initWithImage(__rTex->newCCImage(true)); 中的newCCImage(true) 没有释放。 其它地方的也是,好像有3处。