1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Clean up scaling code, implemented image size optimization

This commit is contained in:
Ivan Savenko
2024-07-25 18:22:27 +00:00
parent f0448acaa3
commit f29a687234
11 changed files with 173 additions and 22 deletions

View File

@@ -237,7 +237,7 @@ std::shared_ptr<ISharedImage> RenderHandler::scaleImage(const ImageLocator & loc
if (locator.layerBody && locator.playerColored != PlayerColor::CANNOT_DETERMINE)
handle->playerColored(locator.playerColored);
handle->scaleFast(handle->dimensions() * locator.scalingFactor);
handle->scaleInteger(locator.scalingFactor);
// TODO: try to optimize image size (possibly even before scaling?) - trim image borders if they are completely transparent
auto result = handle->getSharedImage();