diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/image.cpp | 7 | ||||
-rw-r--r-- | src/common/image.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/common/image.cpp b/src/common/image.cpp index 6a2ab0e..f78ea94 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -147,6 +147,13 @@ CImage::CImage() m_data = nullptr; } +CImage::CImage(Math::IntPoint size) +{ + m_data = new ImageData(); + m_data->surface = SDL_CreateRGBSurface(0, size.x, size.y, 32, + 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); +} + CImage::~CImage() { Free(); diff --git a/src/common/image.h b/src/common/image.h index 3391bdb..54bbd3d 100644 --- a/src/common/image.h +++ b/src/common/image.h @@ -60,6 +60,8 @@ private: public: //! Constructs empty image (with NULL data) CImage(); + //! Constructs a RGBA image of given size + CImage(Math::IntPoint size); //! Destroys image, calling Free() virtual ~CImage(); |