diff options
Diffstat (limited to 'src/common/image.cpp')
-rw-r--r-- | src/common/image.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/image.cpp b/src/common/image.cpp index ef8097e..db14797 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -22,8 +22,8 @@ #include <string.h> #include <assert.h> -#include <SDL/SDL.h> -#include <SDL/SDL_image.h> +#include <SDL.h> +#include <SDL_image.h> #include <png.h> @@ -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. * |