diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2013-03-22 14:14:17 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2013-03-22 14:14:17 (GMT) |
| commit | 9abe51526cac2634af0541c3de69834dd30e9f78 (patch) | |
| tree | 6ae4deadfe00a83094b9d288d8c11d8ce823577a /src/game/EllipseBrush.h | |
| parent | 2c311b9a36a88fadd96f3d39acb1ab2590835d81 (diff) | |
| download | powder-9abe51526cac2634af0541c3de69834dd30e9f78.zip powder-9abe51526cac2634af0541c3de69834dd30e9f78.tar.gz | |
Move all GUI source files into gui/
Diffstat (limited to 'src/game/EllipseBrush.h')
| -rw-r--r-- | src/game/EllipseBrush.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/game/EllipseBrush.h b/src/game/EllipseBrush.h deleted file mode 100644 index ad28766..0000000 --- a/src/game/EllipseBrush.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef ELIPSEBRUSH_H_ -#define ELIPSEBRUSH_H_ - -#include <cmath> -#include "Brush.h" - -class EllipseBrush: public Brush -{ -public: - EllipseBrush(ui::Point size_): - Brush(size_) - { - SetRadius(size_); - }; - virtual void GenerateBitmap() - { - if(bitmap) - delete[] bitmap; - bitmap = new unsigned char[size.X*size.Y]; - int rx = radius.X; - int ry = radius.Y; - - if (!rx) - { - for (int j = 0; j <= 2*ry; j++) - { - bitmap[j*(size.X)+rx] = 255; - } - } - else - { - int yTop = ry, yBottom, i, j; - for (i = 0; i <= rx; i++) - { - while (pow(i-rx,2.0f)*pow(ry,2.0f) + pow(yTop-ry,2.0f)*pow(rx,2.0f) <= pow(rx,2.0f)*pow(ry,2.0f)) - yTop++; - yBottom = 2*ry - yTop; - for (int j = 0; j <= ry*2; j++) - { - if (j > yBottom && j < yTop) - { - bitmap[j*(size.X)+i] = 255; - bitmap[j*(size.X)+2*rx-i] = 255; - } - else - { - bitmap[j*(size.X)+i] = 0; - bitmap[j*(size.X)+2*rx-i] = 0; - } - } - } - } - } -}; - -#endif /* ELIPSEBRUSH_H_ */ |
