summaryrefslogtreecommitdiff
path: root/src/game/Brush.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-30 16:03:18 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-30 16:03:18 (GMT)
commit1d297cb57a338f2a9e34d0f16642afc6a83c1041 (patch)
tree7d5514be702ff98f9b1e53eecdbf0c67096d76f6 /src/game/Brush.h
parent259fc2bcf75d754af043a5d3fa39b6ee0c0b1dec (diff)
downloadpowder-1d297cb57a338f2a9e34d0f16642afc6a83c1041.zip
powder-1d297cb57a338f2a9e34d0f16642afc6a83c1041.tar.gz
Line and rect drawing
Diffstat (limited to 'src/game/Brush.h')
-rw-r--r--src/game/Brush.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/game/Brush.h b/src/game/Brush.h
index 9daf721..617f7df 100644
--- a/src/game/Brush.h
+++ b/src/game/Brush.h
@@ -35,8 +35,29 @@ public:
if(bitmap)
delete bitmap;
}
+ 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->fillrect(position1.X-1, position1.Y-1, width+2, height+2, 255, 0, 255, 70);
+ }
+ virtual void RenderLine(Graphics * g, ui::Point position1, ui::Point position2)
+ {
+ g->blend_line(position1.X, position1.Y, position2.X, position2.Y, 255, 0, 255, 70);
+ }
//Draw the brush outline onto the screen
- virtual void Render(Graphics * g, ui::Point position)
+ virtual void RenderPoint(Graphics * g, ui::Point position)
{
g->fillrect(position.X-size.X-1, position.Y-size.Y-1, (size.X*2)+2, (size.Y*2)+2, 255, 0, 255, 70);
}