mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-15 11:46:56 +02:00
Added draw method to ISharedImage interface
This commit is contained in:
parent
502f47c6b5
commit
2d12cecded
@ -21,6 +21,7 @@ class ColorRGBA;
|
|||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|
||||||
struct SDL_Surface;
|
struct SDL_Surface;
|
||||||
|
struct SDL_Palette;
|
||||||
class ColorFilter;
|
class ColorFilter;
|
||||||
|
|
||||||
/// Defines which blit method will be selected when image is used for rendering
|
/// Defines which blit method will be selected when image is used for rendering
|
||||||
@ -88,6 +89,7 @@ public:
|
|||||||
virtual Point dimensions() const = 0;
|
virtual Point dimensions() const = 0;
|
||||||
virtual void exportBitmap(const boost::filesystem::path & path) const = 0;
|
virtual void exportBitmap(const boost::filesystem::path & path) const = 0;
|
||||||
virtual bool isTransparent(const Point & coords) const = 0;
|
virtual bool isTransparent(const Point & coords) const = 0;
|
||||||
|
virtual void draw(SDL_Surface * where, SDL_Palette * palette, const Point & dest, const Rect * src, uint8_t alpha, EImageBlitMode mode) const = 0;
|
||||||
|
|
||||||
virtual std::shared_ptr<IImage> createImageReference(EImageBlitMode mode) = 0;
|
virtual std::shared_ptr<IImage> createImageReference(EImageBlitMode mode) = 0;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ int ImageSharedScaled::getScalingFactor() const
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageSharedScaled::draw(SDL_Surface *where, const Point &dest, const Rect *src, uint8_t alpha, EImageBlitMode mode) const
|
void ImageSharedScaled::draw(SDL_Surface *where, SDL_Palette * palette, const Point &dest, const Rect *src, uint8_t alpha, EImageBlitMode mode) const
|
||||||
{
|
{
|
||||||
scaledImage->draw(where, nullptr, dest, src, alpha, mode);
|
scaledImage->draw(where, nullptr, dest, src, alpha, mode);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../render/IImage.h"
|
#include "../render/IImage.h"
|
||||||
|
#include "../render/IRenderHandler.h"
|
||||||
|
|
||||||
struct SDL_Palette;
|
struct SDL_Palette;
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ class ImageSharedScaled final : public ISharedImage, public std::enable_shared_f
|
|||||||
public:
|
public:
|
||||||
ImageSharedScaled(std::shared_ptr<SDLImageShared> sourceImage);
|
ImageSharedScaled(std::shared_ptr<SDLImageShared> sourceImage);
|
||||||
|
|
||||||
void draw(SDL_Surface * where, const Point & dest, const Rect * src, uint8_t alpha, EImageBlitMode mode) const;
|
void draw(SDL_Surface * where, SDL_Palette * palette, const Point & dest, const Rect * src, uint8_t alpha, EImageBlitMode mode) const override;
|
||||||
|
|
||||||
void exportBitmap(const boost::filesystem::path & path) const override;
|
void exportBitmap(const boost::filesystem::path & path) const override;
|
||||||
Point dimensions() const override;
|
Point dimensions() const override;
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
SDLImageShared(SDL_Surface * from);
|
SDLImageShared(SDL_Surface * from);
|
||||||
~SDLImageShared();
|
~SDLImageShared();
|
||||||
|
|
||||||
void draw(SDL_Surface * where, SDL_Palette * palette, const Point & dest, const Rect * src, uint8_t alpha, EImageBlitMode mode) const;
|
void draw(SDL_Surface * where, SDL_Palette * palette, const Point & dest, const Rect * src, uint8_t alpha, EImageBlitMode mode) const override;
|
||||||
|
|
||||||
void exportBitmap(const boost::filesystem::path & path) const override;
|
void exportBitmap(const boost::filesystem::path & path) const override;
|
||||||
Point dimensions() const override;
|
Point dimensions() const override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user