Renamed 'resize' to 'initialise' and made it private.

This commit is contained in:
unknown 2012-02-28 10:57:53 +01:00
parent d2a94ac6f4
commit 4658e8026e
6 changed files with 13 additions and 16 deletions

View File

@ -299,10 +299,9 @@ namespace PolyVox
/// Calculates approximatly how many bytes of memory the volume is currently using. /// Calculates approximatly how many bytes of memory the volume is currently using.
uint32_t calculateSizeInBytes(void); uint32_t calculateSizeInBytes(void);
/// Deprecated - I don't think we should expose this function? Let us know if you disagree...
void resize(const Region& regValidRegion, uint16_t uBlockSideLength);
private: private:
void initialise(const Region& regValidRegion, uint16_t uBlockSideLength);
/// gets called when a new region is allocated and needs to be filled /// gets called when a new region is allocated and needs to be filled
/// NOTE: accessing ANY voxels outside this region during the process of this function /// NOTE: accessing ANY voxels outside this region during the process of this function
/// is absolutely unsafe /// is absolutely unsafe

View File

@ -45,7 +45,7 @@ namespace PolyVox
m_funcDataOverflowHandler = dataOverflowHandler; m_funcDataOverflowHandler = dataOverflowHandler;
m_bPagingEnabled = true; m_bPagingEnabled = true;
//Create a volume of the right size. //Create a volume of the right size.
resize(Region::MaxRegion,uBlockSideLength); initialise(Region::MaxRegion,uBlockSideLength);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -93,7 +93,7 @@ namespace PolyVox
m_bPagingEnabled = bPagingEnabled; m_bPagingEnabled = bPagingEnabled;
//Create a volume of the right size. //Create a volume of the right size.
resize(regValid,uBlockSideLength); initialise(regValid,uBlockSideLength);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -391,7 +391,7 @@ namespace PolyVox
/// This function should probably be made internal... /// This function should probably be made internal...
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template <typename VoxelType> template <typename VoxelType>
void LargeVolume<VoxelType>::resize(const Region& regValidRegion, uint16_t uBlockSideLength) void LargeVolume<VoxelType>::initialise(const Region& regValidRegion, uint16_t uBlockSideLength)
{ {
//Debug mode validation //Debug mode validation
assert(uBlockSideLength > 0); assert(uBlockSideLength > 0);

View File

@ -144,10 +144,9 @@ namespace PolyVox
/// Calculates approximatly how many bytes of memory the volume is currently using. /// Calculates approximatly how many bytes of memory the volume is currently using.
uint32_t calculateSizeInBytes(void); uint32_t calculateSizeInBytes(void);
/// Deprecated - I don't think we should expose this function? Let us know if you disagree...
void resize(const Region& regValidRegion);
private: private:
void initialise(const Region& regValidRegion);
//The block data //The block data
VoxelType* m_pData; VoxelType* m_pData;

View File

@ -37,7 +37,7 @@ namespace PolyVox
setBorderValue(VoxelType()); setBorderValue(VoxelType());
//Create a volume of the right size. //Create a volume of the right size.
resize(regValid); initialise(regValid);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -157,7 +157,7 @@ namespace PolyVox
/// This function should probably be made internal... /// This function should probably be made internal...
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template <typename VoxelType> template <typename VoxelType>
void RawVolume<VoxelType>::resize(const Region& regValidRegion) void RawVolume<VoxelType>::initialise(const Region& regValidRegion)
{ {
this->m_regValidRegion = regValidRegion; this->m_regValidRegion = regValidRegion;

View File

@ -173,10 +173,9 @@ namespace PolyVox
/// Calculates approximatly how many bytes of memory the volume is currently using. /// Calculates approximatly how many bytes of memory the volume is currently using.
uint32_t calculateSizeInBytes(void); uint32_t calculateSizeInBytes(void);
/// Deprecated - I don't think we should expose this function? Let us know if you disagree...
void resize(const Region& regValidRegion, uint16_t uBlockSideLength);
private: private:
void initialise(const Region& regValidRegion, uint16_t uBlockSideLength);
Block* getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; Block* getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const;
//The block data //The block data

View File

@ -57,7 +57,7 @@ namespace PolyVox
:BaseVolume<VoxelType>(regValid) :BaseVolume<VoxelType>(regValid)
{ {
//Create a volume of the right size. //Create a volume of the right size.
resize(regValid,uBlockSideLength); initialise(regValid,uBlockSideLength);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -174,7 +174,7 @@ namespace PolyVox
/// This function should probably be made internal... /// This function should probably be made internal...
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template <typename VoxelType> template <typename VoxelType>
void SimpleVolume<VoxelType>::resize(const Region& regValidRegion, uint16_t uBlockSideLength) void SimpleVolume<VoxelType>::initialise(const Region& regValidRegion, uint16_t uBlockSideLength)
{ {
//Debug mode validation //Debug mode validation
assert(uBlockSideLength > 0); assert(uBlockSideLength > 0);