mirror of
https://github.com/u0u0/Cocos2d-Lua-Community.git
synced 2026-05-07 06:07:25 +08:00
纹理预加载bugfix
This commit is contained in:
@@ -603,7 +603,9 @@ void UIPackage::loadAtlas(PackageItem* item)
|
||||
{
|
||||
TextureCache* textureCache = Director::getInstance()->getTextureCache();
|
||||
Texture2D* tex = textureCache->getTextureForKey(item->file);
|
||||
if (!tex) {
|
||||
if (tex) {
|
||||
item->texture = tex;
|
||||
} else {
|
||||
tex = textureCache->addImage(item->file);
|
||||
if (!tex) {
|
||||
item->texture = _emptyTexture;
|
||||
|
||||
Reference in New Issue
Block a user