Browse Source

support loading layer images

Laserlicht 11 months ago
parent
commit
23709ab217
1 changed files with 12 additions and 0 deletions
  1. 12 0
      client/renderSDL/RenderHandler.cpp

+ 12 - 0
client/renderSDL/RenderHandler.cpp

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