diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-28 12:09:35 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-28 12:09:35 (GMT) |
| commit | f9eeebb91039d88ceb7e4cf4e4aecf374d77e633 (patch) | |
| tree | f6efdfcd4189a8c5b2fb483ecb8737633d71461c /src/game/Brush.h | |
| parent | 30b11a7724c20bb3cf09a9dd67ee7ea39093c44b (diff) | |
| download | powder-f9eeebb91039d88ceb7e4cf4e4aecf374d77e633.zip powder-f9eeebb91039d88ceb7e4cf4e4aecf374d77e633.tar.gz | |
Draw brush using renderer, fixes issue #25
Diffstat (limited to 'src/game/Brush.h')
| -rw-r--r-- | src/game/Brush.h | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/src/game/Brush.h b/src/game/Brush.h index 1b7cf69..a7737ee 100644 --- a/src/game/Brush.h +++ b/src/game/Brush.h @@ -11,6 +11,7 @@ #include <iostream> #include "interface/Point.h" +class Renderer; class Brush { protected: @@ -73,43 +74,10 @@ public: if(outline) delete[] outline; } - virtual void RenderRect(Graphics * g, ui::Point position1, ui::Point position2) - { - int width, height, t; - width = position2.X-position1.X; - height = position2.Y-position1.Y; - if(height<0) - { - position1.Y += height; - height *= -1; - } - if(width<0) - { - position1.X += width; - width *= -1; - } - g->xor_line(position1.X, position1.Y, position1.X+width, position1.Y); - g->xor_line(position1.X, position1.Y+height, position1.X+width, position1.Y+height); - g->xor_line(position1.X+width, position1.Y+1, position1.X+width, position1.Y+height-1); - g->xor_line(position1.X, position1.Y+1, position1.X, position1.Y+height-1); - } - virtual void RenderLine(Graphics * g, ui::Point position1, ui::Point position2) - { - g->xor_line(position1.X, position1.Y, position2.X, position2.Y); - } - //Draw the brush outline onto the screen - virtual void RenderPoint(Graphics * g, ui::Point position) - { - if(!outline) - updateOutline(); - if(!outline) - return; - g->xor_bitmap(outline, position.X-radius.X, position.Y-radius.Y, size.X, size.Y); - } - virtual void RenderFill(Graphics * g, ui::Point position) - { - //Do nothing for now - possibly draw some sort of flood fill mask - } + virtual void RenderRect(Renderer * ren, ui::Point position1, ui::Point position2); + virtual void RenderLine(Renderer * ren, ui::Point position1, ui::Point position2); + virtual void RenderPoint(Renderer * ren, ui::Point position); + virtual void RenderFill(Renderer * ren, ui::Point position); virtual void GenerateBitmap() { if(bitmap) |
