mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Reworked image container classes for easier support of new features
This commit is contained in:
@@ -106,7 +106,7 @@ void Canvas::draw(const std::shared_ptr<IImage>& image, const Point & pos)
|
||||
{
|
||||
assert(image);
|
||||
if (image)
|
||||
image->draw(surface, transformPos(pos));
|
||||
image->draw(surface, transformPos(pos), nullptr, getScalingFactor());
|
||||
}
|
||||
|
||||
void Canvas::draw(const std::shared_ptr<IImage>& image, const Point & pos, const Rect & sourceRect)
|
||||
@@ -114,7 +114,7 @@ void Canvas::draw(const std::shared_ptr<IImage>& image, const Point & pos, const
|
||||
Rect realSourceRect = sourceRect * getScalingFactor();
|
||||
assert(image);
|
||||
if (image)
|
||||
image->draw(surface, transformPos(pos), &realSourceRect);
|
||||
image->draw(surface, transformPos(pos), &realSourceRect, getScalingFactor());
|
||||
}
|
||||
|
||||
void Canvas::draw(const Canvas & image, const Point & pos)
|
||||
@@ -218,11 +218,11 @@ void Canvas::fillTexture(const std::shared_ptr<IImage>& image)
|
||||
for (int y=0; y < surface->h; y+= imageArea.h)
|
||||
{
|
||||
for (int x=0; x < surface->w; x+= imageArea.w)
|
||||
image->draw(surface, Point(renderArea.x + x * getScalingFactor(), renderArea.y + y * getScalingFactor()));
|
||||
image->draw(surface, Point(renderArea.x + x * getScalingFactor(), renderArea.y + y * getScalingFactor()), nullptr, getScalingFactor());
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Surface * Canvas::getInternalSurface()
|
||||
SDL_Surface * Canvas::getInternalSurface() const
|
||||
{
|
||||
return surface;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user