summaryrefslogtreecommitdiffstats
path: root/src/common/image.cpp
diff options
context:
space:
mode:
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 ef8097e..be5711d 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.
*