From abb3def1e70c3fddb9c554f461053683855d8e47 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 11 Feb 2008 20:34:45 +0000 Subject: [PATCH] Tiding up... --- include/IndexedSurfacePatch.h | 9 ++------- include/PolyVoxSceneManager.h | 4 ---- include/Volume.h | 6 ++++-- source/Block.cpp | 3 ++- source/PolyVoxSceneManager.cpp | 5 ----- source/Volume.cpp | 17 ++++------------- 6 files changed, 12 insertions(+), 32 deletions(-) diff --git a/include/IndexedSurfacePatch.h b/include/IndexedSurfacePatch.h index 8532c120..429cdc56 100644 --- a/include/IndexedSurfacePatch.h +++ b/include/IndexedSurfacePatch.h @@ -1,19 +1,14 @@ #ifndef __IndexedSurfacePatch_H__ #define __IndexedSurfacePatch_H__ -#include "boost/cstdint.hpp" - -//#include -//#include - #include +#include "boost/cstdint.hpp" + #include "Constants.h" #include "SurfaceTypes.h" #include "SurfaceVertex.h" #include "TypeDef.h" -#include "VolumeIterator.h" - namespace PolyVox { diff --git a/include/PolyVoxSceneManager.h b/include/PolyVoxSceneManager.h index ccd58ab3..f53b0380 100644 --- a/include/PolyVoxSceneManager.h +++ b/include/PolyVoxSceneManager.h @@ -26,16 +26,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "Constants.h" #include "IndexedSurfacePatch.h" #include "SurfaceTriangle.h" -//#include "AbstractSurfacePatch.h" #include "TypeDef.h" #include "Volume.h" #include "SurfaceVertex.h" #include "RegionGeometry.h" - #include "Vector.h" -#include - namespace PolyVox { enum NormalGenerationMethod diff --git a/include/Volume.h b/include/Volume.h index 4af05547..76b58f54 100644 --- a/include/Volume.h +++ b/include/Volume.h @@ -37,11 +37,13 @@ namespace PolyVox //Volume interface public: Volume(); - Volume(const Volume& rhs); - ~Volume(); + ~Volume(); + private: + Volume(const Volume& rhs); Volume& operator=(const Volume& rhs); + public: Block* getBlock(boost::uint16_t index); bool containsPoint(Vector3DFloat pos, float boundary); diff --git a/source/Block.cpp b/source/Block.cpp index 60332136..0fae6bb6 100644 --- a/source/Block.cpp +++ b/source/Block.cpp @@ -21,7 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. using namespace boost; -namespace PolyVox { +namespace PolyVox +{ Block::Block() { diff --git a/source/PolyVoxSceneManager.cpp b/source/PolyVoxSceneManager.cpp index eaaaabde..5cdc058f 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/PolyVoxSceneManager.cpp @@ -18,14 +18,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ #include "MarchingCubesTables.h" -#include "SurfaceVertex.h" -#include "SurfaceEdge.h" -#include "IndexedSurfacePatch.h" #include "PolyVoxSceneManager.h" #include "VolumeIterator.h" -#include - using namespace boost; namespace PolyVox diff --git a/source/Volume.cpp b/source/Volume.cpp index c36c5219..72643645 100644 --- a/source/Volume.cpp +++ b/source/Volume.cpp @@ -31,19 +31,6 @@ namespace PolyVox Volume::Volume() { - //FIXME - Add checking... - /*SharedPtr& homogeneousBlock = mHomogeneousBlocks[0]; - if(homogeneousBlock.isNull()) - { - homogeneousBlock = SharedPtr(new Block); - homogeneousBlock->fillWithValue(0); - }*/ - - /*for(uint16_t i = 0; i < POLYVOX_NO_OF_BLOCKS_IN_VOLUME; ++i) - { - mBlocks[i] = mHomogeneousBlocks[0]; - }*/ - for(uint16_t i = 0; i < POLYVOX_NO_OF_BLOCKS_IN_VOLUME; ++i) { mBlocks[i] = new Block; @@ -58,6 +45,10 @@ namespace PolyVox Volume::~Volume() { + for(uint16_t i = 0; i < POLYVOX_NO_OF_BLOCKS_IN_VOLUME; ++i) + { + delete mBlocks[i]; + } } Volume& Volume::operator=(const Volume& rhs)