Merge branch 'Almamu:main' into main

This commit is contained in:
Vaxry 2023-04-21 02:10:36 +01:00 committed by GitHub
commit 8e1ae5e627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,8 @@ const ITexture* CTextureCache::resolve (const std::string& filename)
// search for the texture in all the different containers just in case // search for the texture in all the different containers just in case
for (auto it : this->getContext ().getApp ().getBackgrounds ()) for (auto it : this->getContext ().getApp ().getBackgrounds ())
{
try
{ {
const ITexture* texture = it.second->getContainer ()->readTexture (filename); const ITexture* texture = it.second->getContainer ()->readTexture (filename);
@ -30,16 +32,27 @@ const ITexture* CTextureCache::resolve (const std::string& filename)
return texture; return texture;
} }
catch (CAssetLoadException& ex)
{
// ignored, this happens if we're looking at the wrong background
}
}
if (this->getContext ().getApp ().getDefaultBackground () != nullptr) if (this->getContext ().getApp ().getDefaultBackground () != nullptr)
{ {
const ITexture* texture = try
this->getContext ().getApp ().getDefaultBackground ()->getContainer ()->readTexture (filename); {
const ITexture* texture = this->getContext ().getApp ().getDefaultBackground ()->getContainer ()->readTexture (filename);
this->store (filename, texture); this->store (filename, texture);
return texture; return texture;
} }
catch (CAssetLoadException& ex)
{
// ignored, this happens if we're looking at the wrong background
}
}
throw CAssetLoadException (filename, "Cannot find file"); throw CAssetLoadException (filename, "Cannot find file");
} }