summaryrefslogtreecommitdiffstats
path: root/src/common/image.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-10-20 16:34:22 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-10-20 16:34:22 +0200
commit40e065aea947b45700930d431754282c23d1de45 (patch)
tree4f4f6ed1e252d832d738a297fea057dcbf3ff049 /src/common/image.cpp
parent6d06c9f722885805f7e150173706804634b3e5d4 (diff)
downloadcolobot-40e065aea947b45700930d431754282c23d1de45.tar.gz
colobot-40e065aea947b45700930d431754282c23d1de45.tar.bz2
colobot-40e065aea947b45700930d431754282c23d1de45.zip
Ground spot texture drawing
Diffstat (limited to 'src/common/image.cpp')
-rw-r--r--src/common/image.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/image.cpp b/src/common/image.cpp
index f3cfa34..638304e 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -190,6 +190,15 @@ Math::IntPoint CImage::GetSize() const
return Math::IntPoint(m_data->surface->w, m_data->surface->h);
}
+/** Image must be valid. */
+void CImage::Fill(Gfx::IntColor color)
+{
+ assert(m_data != nullptr);
+
+ Uint32 c = SDL_MapRGBA(m_data->surface->format, color.r, color.g, color.b, color.a);
+ SDL_FillRect(m_data->surface, nullptr, c);
+}
+
/**
* Image must be valid and pixel coords in valid range.
*