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

Fixed generation of upscaled spellbook

This commit is contained in:
Ivan Savenko
2024-09-12 14:26:05 +00:00
parent 1e74216040
commit dfd3f0c1a6
6 changed files with 35 additions and 19 deletions

View File

@@ -35,9 +35,10 @@ void AssetGenerator::createAdventureOptionsCleanBackground()
return;
ResourcePath savePath(filename, EResType::IMAGE);
auto res = ImagePath::builtin("ADVOPTBK");
auto locator = ImageLocator(ImagePath::builtin("ADVOPTBK"));
locator.scalingFactor = 1;
std::shared_ptr<IImage> img = GH.renderHandler().loadImage(res, EImageBlitMode::OPAQUE);
std::shared_ptr<IImage> img = GH.renderHandler().loadImage(locator, EImageBlitMode::OPAQUE);
Canvas canvas = Canvas(Point(575, 585), CanvasScalingPolicy::IGNORE);
canvas.draw(img, Point(0, 0), Rect(0, 0, 575, 585));
@@ -64,9 +65,10 @@ void AssetGenerator::createBigSpellBook()
return;
ResourcePath savePath(filename, EResType::IMAGE);
auto res = ImagePath::builtin("SpelBack");
auto locator = ImageLocator(ImagePath::builtin("SpelBack"));
locator.scalingFactor = 1;
std::shared_ptr<IImage> img = GH.renderHandler().loadImage(res, EImageBlitMode::OPAQUE);
std::shared_ptr<IImage> img = GH.renderHandler().loadImage(locator, EImageBlitMode::OPAQUE);
Canvas canvas = Canvas(Point(800, 600), CanvasScalingPolicy::IGNORE);
// edges
canvas.draw(img, Point(0, 0), Rect(15, 38, 90, 45));