Add ui::Graphics::fillRegion()

This commit is contained in:
David Capello 2014-02-06 20:01:32 -03:00
parent 9050861d78
commit 9b2f5399e9
2 changed files with 11 additions and 0 deletions

View File

@ -104,6 +104,12 @@ void Graphics::fillRect(ui::Color color, const gfx::Rect& rc)
m_dy+rc.y+rc.h-1, to_system(color));
}
void Graphics::fillRegion(ui::Color color, const gfx::Region& rgn)
{
for (gfx::Region::iterator it=rgn.begin(), end=rgn.end(); it!=end; ++it)
fillRect(color, *it);
}
void Graphics::drawBitmap(BITMAP* sprite, int x, int y)
{
draw_sprite(m_bmp, sprite, m_dx+x, m_dy+y);

View File

@ -18,6 +18,10 @@
struct BITMAP;
struct FONT;
namespace gfx {
class Region;
}
namespace ui {
// Class to render a widget in the screen.
@ -37,6 +41,7 @@ namespace ui {
void drawRect(ui::Color color, const gfx::Rect& rc);
void fillRect(ui::Color color, const gfx::Rect& rc);
void fillRegion(ui::Color color, const gfx::Region& rgn);
void drawBitmap(BITMAP* sprite, int x, int y);
void drawAlphaBitmap(BITMAP* sprite, int x, int y);