summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-30 00:23:26 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-30 00:23:26 +0200
commitb46dc3850f489dca68fabe4512a611aed32e7df5 (patch)
treea0b8c0f35c270ca7a207f2d3788d8c73cbf47707 /src/common
parenta8554cfae3358af6b909c45ba9dc9bdfc020bdfb (diff)
downloadcolobot-b46dc3850f489dca68fabe4512a611aed32e7df5.tar.gz
colobot-b46dc3850f489dca68fabe4512a611aed32e7df5.tar.bz2
colobot-b46dc3850f489dca68fabe4512a611aed32e7df5.zip
Map texture painting
Diffstat (limited to 'src/common')
-rw-r--r--src/common/image.cpp7
-rw-r--r--src/common/image.h2
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();