From b46dc3850f489dca68fabe4512a611aed32e7df5 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 30 Sep 2012 00:23:26 +0200 Subject: Map texture painting --- src/common/image.cpp | 7 +++++++ src/common/image.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/common') 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(); -- cgit v1.2.3-1-g7c22