issue #161,support *.jpg,add texture to texture cache

This commit is contained in:
Walzer 2010-09-27 09:26:35 +00:00
parent 3dee048191
commit 3f233e2651
1 changed files with 11 additions and 1 deletions

View File

@ -214,6 +214,16 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
texture = new CCTexture2D();
texture->initWithImage(image);
CCX_SAFE_DELETE(image);// image->release();
if( texture )
{
m_pTextures->setObject(texture, fullpath);
texture->release();
}
else
{
CCLOG("cocos2d: Couldn't add image:%s in CCTextureCache", path);
}
}
else
{
@ -237,7 +247,7 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
if( texture )
{
m_pTextures->setObject(texture, fullpath);
texture->autorelease();
texture->release();
}
else
{