diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-20 12:40:34 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-20 12:40:34 (GMT) |
| commit | e81e18238df47212d84fa00422a64983857e1ea1 (patch) | |
| tree | 67c973f1f3666f9f4b230524575cda5dd6cc4cd6 /src/game/Brush.h | |
| parent | 2be9c925088c16beb144dd9932202416d00ff581 (diff) | |
| parent | f6403958de1f67d3bce47f56b40de254c30f5ba4 (diff) | |
| download | powder-e81e18238df47212d84fa00422a64983857e1ea1.zip powder-e81e18238df47212d84fa00422a64983857e1ea1.tar.gz | |
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/game/Brush.h')
| -rw-r--r-- | src/game/Brush.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/Brush.h b/src/game/Brush.h index 34354c0..0adcd95 100644 --- a/src/game/Brush.h +++ b/src/game/Brush.h @@ -25,8 +25,8 @@ protected: if(!bitmap) return; if(outline) - free(outline); - outline = (unsigned char *)calloc(size.X*size.Y, sizeof(unsigned char)); + delete[] outline; + outline = new unsigned char[size.X*size.Y]; for(int x = 0; x < size.X; x++) { for(int y = 0; y < size.Y; y++) @@ -69,9 +69,9 @@ public: } virtual ~Brush() { if(bitmap) - delete bitmap; + delete[] bitmap; if(outline) - delete outline; + delete[] outline; } virtual void RenderRect(Graphics * g, ui::Point position1, ui::Point position2) { @@ -109,8 +109,8 @@ public: virtual void GenerateBitmap() { if(bitmap) - free(bitmap); - bitmap = (unsigned char *)calloc((size.X*size.Y), sizeof(unsigned char)); + delete[] bitmap; + bitmap = new unsigned char[size.X*size.Y]; for(int x = 0; x < size.X; x++) { for(int y = 0; y < size.Y; y++) |
