diff options
Diffstat (limited to 'src/common/image.cpp')
-rw-r--r-- | src/common/image.cpp | 9 |
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. * |