1
0
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:
Ivan Savenko
2025-04-13 18:53:54 +03:00
34 changed files with 676 additions and 362 deletions

View File

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