mirror of https://github.com/axmolengine/axmol.git
issue #161,support *.jpg,add texture to texture cache
This commit is contained in:
parent
3dee048191
commit
3f233e2651
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue