纹理预加载bugfix

This commit is contained in:
u0u0
2022-04-11 10:46:07 +08:00
parent ce5b0c6ec9
commit d61ba95e1a

View File

@@ -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;