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 = new CCTexture2D();
|
||||||
texture->initWithImage(image);
|
texture->initWithImage(image);
|
||||||
CCX_SAFE_DELETE(image);// image->release();
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -237,7 +247,7 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
|
||||||
if( texture )
|
if( texture )
|
||||||
{
|
{
|
||||||
m_pTextures->setObject(texture, fullpath);
|
m_pTextures->setObject(texture, fullpath);
|
||||||
texture->autorelease();
|
texture->release();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue