1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-09 13:14:02 +02:00

support loading layer images

This commit is contained in:
Laserlicht 2024-11-09 21:04:20 +01:00
parent 3872a3ea89
commit 23709ab217

View File

@ -361,6 +361,18 @@ std::shared_ptr<IImage> RenderHandler::loadImage(const ImageLocator & locator, E
}
else
{
if(loc.image)
{
std::string imgPath = (*loc.image).getName();
if(loc.layer == EImageLayer::OVERLAY)
imgPath += "-overlay";
if(loc.layer == EImageLayer::SHADOW)
imgPath += "-shadow";
if(CResourceHandler::get()->existsResource(ImagePath::builtin(imgPath)))
loc.image = ImagePath::builtin(imgPath);
}
return loadImageImpl(loc)->createImageReference(mode);
}
}