mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Merge branch 'vcmi/beta' into 'vcmi/develop'
This commit is contained in:
@@ -58,13 +58,14 @@ std::shared_ptr<CDefFile> RenderHandler::getAnimationFile(const AnimationPath &
|
||||
auto it = animationFiles.find(actualPath);
|
||||
|
||||
if (it != animationFiles.end())
|
||||
return it->second;
|
||||
{
|
||||
auto locked = it->second.lock();
|
||||
if (locked)
|
||||
return locked;
|
||||
}
|
||||
|
||||
if (!CResourceHandler::get()->existsResource(actualPath))
|
||||
{
|
||||
animationFiles[actualPath] = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto result = std::make_shared<CDefFile>(actualPath);
|
||||
|
||||
@@ -193,7 +194,11 @@ std::shared_ptr<ScalableImageShared> RenderHandler::loadImageImpl(const ImageLoc
|
||||
{
|
||||
auto it = imageFiles.find(locator);
|
||||
if (it != imageFiles.end())
|
||||
return it->second;
|
||||
{
|
||||
auto locked = it->second.lock();
|
||||
if (locked)
|
||||
return locked;
|
||||
}
|
||||
|
||||
auto sdlImage = loadImageFromFileUncached(locator);
|
||||
auto scaledImage = std::make_shared<ScalableImageShared>(locator, sdlImage);
|
||||
|
||||
Reference in New Issue
Block a user