mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 15:33:10 +02:00
Added deleteAll() member to VoxelNodeBag class
This commit is contained in:
parent
70818bd3fe
commit
5758e42870
2 changed files with 12 additions and 2 deletions
|
@ -15,11 +15,19 @@
|
|||
#include <OctalCode.h>
|
||||
|
||||
VoxelNodeBag::~VoxelNodeBag() {
|
||||
deleteAll();
|
||||
}
|
||||
|
||||
void VoxelNodeBag::deleteAll() {
|
||||
if (_bagElements) {
|
||||
delete[] _bagElements;
|
||||
}
|
||||
_bagElements = NULL;
|
||||
_elementsInUse = 0;
|
||||
_sizeOfElementsArray = 0;
|
||||
}
|
||||
|
||||
|
||||
const int GROW_BAG_BY = 100;
|
||||
|
||||
// put a node into the bag
|
||||
|
|
|
@ -29,8 +29,10 @@ public:
|
|||
void insert(VoxelNode* node); // put a node into the bag
|
||||
VoxelNode* extract(); // pull a node out of the bag (could come in any order)
|
||||
|
||||
bool isEmpty() const { return (_elementsInUse == 0); }
|
||||
int count() const { return _elementsInUse; }
|
||||
bool isEmpty() const { return (_elementsInUse == 0); };
|
||||
int count() const { return _elementsInUse; };
|
||||
|
||||
void deleteAll();
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Reference in a new issue