Made homogeneous blocks static so they can be shared between volumes.

This commit is contained in:
David Williams 2009-04-09 21:27:28 +00:00
parent 6d72169e11
commit 2c2f99a8e2

View File

@ -61,7 +61,7 @@ namespace PolyVox
POLYVOX_SHARED_PTR< BlockData<VoxelType> > getHomogenousBlockData(VoxelType tHomogenousValue) const; POLYVOX_SHARED_PTR< BlockData<VoxelType> > getHomogenousBlockData(VoxelType tHomogenousValue) const;
Block<VoxelType>* m_pBlocks; Block<VoxelType>* m_pBlocks;
mutable std::map<VoxelType, POLYVOX_WEAK_PTR< BlockData<VoxelType> > > m_pHomogenousBlockData; static std::map<VoxelType, POLYVOX_WEAK_PTR< BlockData<VoxelType> > > m_pHomogenousBlockData;
uint32_t m_uNoOfBlocksInVolume; uint32_t m_uNoOfBlocksInVolume;
uint16_t m_uSideLengthInBlocks; uint16_t m_uSideLengthInBlocks;
@ -73,6 +73,10 @@ namespace PolyVox
uint16_t m_uBlockSideLength; uint16_t m_uBlockSideLength;
}; };
//Required for the static member
template <class VoxelType> std::map<VoxelType, POLYVOX_WEAK_PTR< BlockData<VoxelType> > > Volume<VoxelType>::m_pHomogenousBlockData;
//Some handy typedefs //Some handy typedefs
typedef Volume<float> FloatVolume; typedef Volume<float> FloatVolume;
typedef Volume<uint8_t> UInt8Volume; typedef Volume<uint8_t> UInt8Volume;