Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
Diff: Wall.cpp
- Revision:
- 4:f421e34313d3
- Child:
- 5:065f19e08dcb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Wall.cpp Sat Feb 28 11:40:24 2015 +0000
@@ -0,0 +1,43 @@
+#include "Wall.h"
+
+Wall::Wall() : rWall(0,0,0,0)
+{ // constructor
+}
+
+Wall::Wall(LCD_ST7735* pDisp) : rWall(0,0,0,0)
+{ // constructor
+ this->pDisp=pDisp;
+ uColor=Color565::Blue;
+ this->fActive=false;
+}
+
+void Wall::setRect(Rectangle rNew)
+{
+ rWall=rNew;
+}
+
+
+Rectangle Wall::getRect()
+{
+ return(rWall);
+}
+
+void Wall::draw()
+{
+ int x1=rWall.getX1();
+ int y1=rWall.getY1();
+ int x2=rWall.getX2();
+ int y2=rWall.getY2();
+ if(x1!=x2 && y1!=y2)
+ pDisp->fillRect(x1,y1,x2,y2, uColor);
+ else
+ pDisp->drawLine(x1,y1,x2,y2, uColor);
+
+/*
+char szBuffer[256];
+sprintf(szBuffer, "w:%d,%d - %d,%d ", rWall.getX1(), rWall.getY1(), rWall.getX2(), rWall.getY2());
+pDisp->drawString(font_oem, 0, 0, szBuffer);
+*/
+
+}
+