Ray casting engine implemented on the mBuino platform using the ST7735 LCD controller.
Ray casting engine written to test performance of the LCD_ST7735 library I wrote as a learning exercise on the mbed platform.
Revision 1:fdbc2be25831, committed 2014-09-22
- Comitter:
- taylorza
- Date:
- Mon Sep 22 04:23:35 2014 +0000
- Parent:
- 0:303768292f44
- Child:
- 2:4de2cb6f6fe8
- Commit message:
- Added destructor to clean-up memory for the _pSlivers array.
Changed in this revision
Raycaster.cpp | Show annotated file Show diff for this revision Revisions of this file |
Raycaster.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Raycaster.cpp Sun Sep 21 22:04:22 2014 +0000 +++ b/Raycaster.cpp Mon Sep 22 04:23:35 2014 +0000 @@ -47,6 +47,15 @@ _pSlivers = new Sliver[_width >> 1]; } +Raycaster::~Raycaster() +{ + if (_pSlivers != NULL) + { + delete[] _pSlivers; + _pSlivers = NULL; + } +} + void Raycaster::setCellPosition(int x, int y) { _playerX = x << CELL_SIZE_SHIFT;
--- a/Raycaster.h Sun Sep 21 22:04:22 2014 +0000 +++ b/Raycaster.h Mon Sep 22 04:23:35 2014 +0000 @@ -14,6 +14,7 @@ void rotate(float radians); void move(int distance); + ~Raycaster(); private: struct Sliver {