From ede35435a0a8d046185b16215a3559352cdf7e8b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 20 Sep 2014 17:26:57 +0200 Subject: [PATCH] Renamed UncompressedBlock to Chunk. --- examples/Paging/main.cpp | 6 +- library/PolyVoxCore/CMakeLists.txt | 4 +- .../{UncompressedBlock.h => Chunk.h} | 18 ++--- .../{UncompressedBlock.inl => Chunk.inl} | 20 ++--- .../include/PolyVoxCore/FilePager.h | 4 +- .../include/PolyVoxCore/PagedVolume.h | 10 +-- .../include/PolyVoxCore/PagedVolume.inl | 78 +++++++++---------- .../PolyVoxCore/PagedVolumeSampler.inl | 2 +- .../PolyVoxCore/include/PolyVoxCore/Pager.h | 6 +- 9 files changed, 74 insertions(+), 74 deletions(-) rename library/PolyVoxCore/include/PolyVoxCore/{UncompressedBlock.h => Chunk.h} (83%) rename library/PolyVoxCore/include/PolyVoxCore/{UncompressedBlock.inl => Chunk.inl} (85%) diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index d9359087..576bfb67 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -90,11 +90,11 @@ public: /// Destructor virtual ~PerlinNoisePager() {}; - virtual void pageIn(const PolyVox::Region& region, UncompressedBlock* pBlockData) + virtual void pageIn(const PolyVox::Region& region, Chunk* pBlockData) { // FIXME - this isn't a great example... it's a shame we have to hard clode the block size and also create/destroy // a compressor each time. These could at least be moved outside somewhere if we can't fix it in a better way... - //UncompressedBlock block(256); + //Chunk block(256); Perlin perlin(2,2,1,234); @@ -143,7 +143,7 @@ public: //delete compressor; } - virtual void pageOut(const PolyVox::Region& region, UncompressedBlock* /*pBlockData*/) + virtual void pageOut(const PolyVox::Region& region, Chunk* /*pBlockData*/) { std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl; } diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 4e18c75e..286f5e14 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -38,6 +38,8 @@ SET(CORE_INC_FILES include/PolyVoxCore/BaseVolume.h include/PolyVoxCore/BaseVolume.inl include/PolyVoxCore/BaseVolumeSampler.inl + include/PolyVoxCore/Chunk.h + include/PolyVoxCore/Chunk.inl include/PolyVoxCore/CubicSurfaceExtractor.h include/PolyVoxCore/CubicSurfaceExtractor.inl include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -72,8 +74,6 @@ SET(CORE_INC_FILES include/PolyVoxCore/Raycast.inl include/PolyVoxCore/Region.h include/PolyVoxCore/SimpleVolume.h - include/PolyVoxCore/UncompressedBlock.h - include/PolyVoxCore/UncompressedBlock.inl include/PolyVoxCore/Vector.h include/PolyVoxCore/Vector.inl include/PolyVoxCore/Vertex.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h similarity index 83% rename from library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h rename to library/PolyVoxCore/include/PolyVoxCore/Chunk.h index abc3ca63..4f92e458 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.h @@ -21,8 +21,8 @@ freely, subject to the following restrictions: distribution. *******************************************************************************/ -#ifndef __PolyVox_UncompressedBlock_H__ -#define __PolyVox_UncompressedBlock_H__ +#ifndef __PolyVox_Chunk_H__ +#define __PolyVox_Chunk_H__ #include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxCore/Vector.h" @@ -30,13 +30,13 @@ freely, subject to the following restrictions: namespace PolyVox { template - class UncompressedBlock + class Chunk { friend class PagedVolume; public: - UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); - ~UncompressedBlock(); + Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager = nullptr); + ~Chunk(); VoxelType* getData(void) const; uint32_t getDataSizeInBytes(void) const; @@ -49,10 +49,10 @@ namespace PolyVox private: /// Private copy constructor to prevent accisdental copying - UncompressedBlock(const UncompressedBlock& /*rhs*/) {}; + Chunk(const Chunk& /*rhs*/) {}; /// Private assignment operator to prevent accisdental copying - UncompressedBlock& operator=(const UncompressedBlock& /*rhs*/) {}; + Chunk& operator=(const Chunk& /*rhs*/) {}; // This is updated by the PagedVolume and used to discard the least recently used blocks. uint32_t m_uBlockLastAccessed; @@ -62,7 +62,7 @@ namespace PolyVox bool m_bDataModified; // Made this private for consistancy with CompressedBlock. - // Users shouldn't really need this for UncompressedBlock anyway. + // Users shouldn't really need this for Chunk anyway. uint32_t calculateSizeInBytes(void); static uint32_t calculateSizeInBytes(uint32_t uSideLength); @@ -74,6 +74,6 @@ namespace PolyVox }; } -#include "PolyVoxCore/UncompressedBlock.inl" +#include "PolyVoxCore/Chunk.inl" #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl similarity index 85% rename from library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl rename to library/PolyVoxCore/include/PolyVoxCore/Chunk.inl index 4e038024..ad8e255a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/UncompressedBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Chunk.inl @@ -26,7 +26,7 @@ freely, subject to the following restrictions: namespace PolyVox { template - UncompressedBlock::UncompressedBlock(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) + Chunk::Chunk(Vector3DInt32 v3dPosition, uint16_t uSideLength, Pager* pPager) :m_uBlockLastAccessed(0) ,m_bDataModified(true) ,m_tData(0) @@ -65,7 +65,7 @@ namespace PolyVox } template - UncompressedBlock::~UncompressedBlock() + Chunk::~Chunk() { if (m_pPager && m_bDataModified) { @@ -82,19 +82,19 @@ namespace PolyVox } template - VoxelType* UncompressedBlock::getData(void) const + VoxelType* Chunk::getData(void) const { return m_tData; } template - uint32_t UncompressedBlock::getDataSizeInBytes(void) const + uint32_t Chunk::getDataSizeInBytes(void) const { return m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType); } template - VoxelType UncompressedBlock::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const + VoxelType Chunk::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. @@ -112,13 +112,13 @@ namespace PolyVox } template - VoxelType UncompressedBlock::getVoxel(const Vector3DUint16& v3dPos) const + VoxelType Chunk::getVoxel(const Vector3DUint16& v3dPos) const { return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); } template - void UncompressedBlock::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) + void Chunk::setVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tValue) { // This code is not usually expected to be called by the user, with the exception of when implementing paging // of uncompressed data. It's a performance critical code path so we use asserts rather than exceptions. @@ -138,20 +138,20 @@ namespace PolyVox } template - void UncompressedBlock::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) + void Chunk::setVoxelAt(const Vector3DUint16& v3dPos, VoxelType tValue) { setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); } template - uint32_t UncompressedBlock::calculateSizeInBytes(void) + uint32_t Chunk::calculateSizeInBytes(void) { // Call through to the static version return calculateSizeInBytes(m_uSideLength); } template - uint32_t UncompressedBlock::calculateSizeInBytes(uint32_t uSideLength) + uint32_t Chunk::calculateSizeInBytes(uint32_t uSideLength) { // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 6f466204..83ae5047 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -76,7 +76,7 @@ namespace PolyVox m_vecCreatedFiles.clear(); } - virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) + virtual void pageIn(const Region& region, Chunk* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page in NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); @@ -120,7 +120,7 @@ namespace PolyVox } } - virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) + virtual void pageOut(const Region& region, Chunk* pBlockData) { POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block"); //POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data"); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h index 4c08721c..215f2349 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.h @@ -27,7 +27,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/BaseVolume.h" #include "PolyVoxCore/Pager.h" #include "PolyVoxCore/Region.h" -#include "PolyVoxCore/UncompressedBlock.h" +#include "PolyVoxCore/Chunk.h" #include "PolyVoxCore/Vector.h" #include @@ -285,8 +285,8 @@ namespace PolyVox private: - typedef std::unordered_map > > SharedPtrBlockMap; - typedef std::unordered_map > > WeakPtrBlockMap; + typedef std::unordered_map > > SharedPtrBlockMap; + typedef std::unordered_map > > WeakPtrBlockMap; void initialise(); @@ -298,7 +298,7 @@ namespace PolyVox VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; - std::shared_ptr< UncompressedBlock > getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; + std::shared_ptr< Chunk > getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const; void purgeNullPtrsFromAllBlocks(void) const; @@ -308,7 +308,7 @@ namespace PolyVox mutable uint32_t m_uTimestamper; mutable Vector3DInt32 m_v3dLastAccessedBlockPos; - mutable std::shared_ptr< UncompressedBlock > m_pLastAccessedBlock; + mutable std::shared_ptr< Chunk > m_pLastAccessedBlock; uint32_t m_uBlockCountLimit; // The size of the volume diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl index 07c0e23e..56a8f36e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolume.inl @@ -82,9 +82,9 @@ namespace PolyVox m_uBlockCountLimit = (std::max)(m_uBlockCountLimit, uMinPracticalNoOfBlocks); m_uBlockCountLimit = (std::min)(m_uBlockCountLimit, uMaxPracticalNoOfBlocks); - uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); - POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uBlockSideLength); + POLYVOX_LOG_DEBUG("Memory usage limit for volume initially set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); initialise(); } @@ -223,9 +223,9 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pChunk = getChunk(blockX, blockY, blockZ); - return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); + return pChunk->getVoxel(xOffset, yOffset, zOffset); } else { @@ -247,7 +247,7 @@ namespace PolyVox /// Increasing the size of the block cache will increase memory but may improve performance. /// You may want to set this to a large value (e.g. 1024) when you are first loading your /// volume data and then set it to a smaller value (e.g.64) for general processing. - /// \param uMaxNumberOfUncompressedBlocks The number of blocks for which uncompressed data can be cached. + /// \param uMaxNumberOfChunks The number of blocks for which uncompressed data can be cached. //////////////////////////////////////////////////////////////////////////////// template void PagedVolume::setMemoryUsageLimit(uint32_t uMemoryUsageInBytes) @@ -255,8 +255,8 @@ namespace PolyVox POLYVOX_THROW_IF(!m_pPager, invalid_operation, "You cannot limit the memory usage of the volume because it was created without a pager attached."); // Calculate the number of blocks based on the memory limit and the size of each block. - uint32_t uUncompressedBlockSizeInBytes = UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength); - m_uBlockCountLimit = uMemoryUsageInBytes / uUncompressedBlockSizeInBytes; + uint32_t uChunkSizeInBytes = Chunk::calculateSizeInBytes(m_uBlockSideLength); + m_uBlockCountLimit = uMemoryUsageInBytes / uChunkSizeInBytes; // We need at least a few blocks available to avoid thrashing, and in pratice there will probably be hundreds. POLYVOX_LOG_WARNING_IF(m_uBlockCountLimit < uMinPracticalNoOfBlocks, "Requested memory usage limit of " @@ -270,8 +270,8 @@ namespace PolyVox flushAll(); } - POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uUncompressedBlockSizeInBytes) / (1024 * 1024) - << "Mb (" << m_uBlockCountLimit << " blocks of " << uUncompressedBlockSizeInBytes / 1024 << "Kb each)."); + POLYVOX_LOG_DEBUG("Memory usage limit for volume now set to " << (m_uBlockCountLimit * uChunkSizeInBytes) / (1024 * 1024) + << "Mb (" << m_uBlockCountLimit << " blocks of " << uChunkSizeInBytes / 1024 << "Kb each)."); } //////////////////////////////////////////////////////////////////////////////// @@ -307,8 +307,8 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); + auto pChunk = getChunk(blockX, blockY, blockZ); + pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); } //////////////////////////////////////////////////////////////////////////////// @@ -344,9 +344,9 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); + auto pChunk = getChunk(blockX, blockY, blockZ); - pUncompressedBlock->setVoxelAt(xOffset, yOffset, zOffset, tValue); + pChunk->setVoxelAt(xOffset, yOffset, zOffset, tValue); //Return true to indicate that we modified a voxel. return true; @@ -397,7 +397,7 @@ namespace PolyVox { for(int32_t z = v3dStart.getZ(); z <= v3dEnd.getZ(); z++) { - getUncompressedBlock(x,y,z); + getChunk(x,y,z); } } } @@ -497,7 +497,7 @@ namespace PolyVox m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); - //setMaxNumberOfUncompressedBlocks(m_uBlockCountLimit); + //setMaxNumberOfChunks(m_uBlockCountLimit); //Clear the previous data m_pRecentlyUsedBlocks.clear(); @@ -509,7 +509,7 @@ namespace PolyVox } template - std::shared_ptr< UncompressedBlock > PagedVolume::getUncompressedBlock(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const + std::shared_ptr< Chunk > PagedVolume::getChunk(int32_t uBlockX, int32_t uBlockY, int32_t uBlockZ) const { Vector3DInt32 v3dBlockPos(uBlockX, uBlockY, uBlockZ); @@ -523,45 +523,45 @@ namespace PolyVox } // The block was not the same as last time, but we can now hope it is in the set of most recently used blocks. - std::shared_ptr< UncompressedBlock > pUncompressedBlock = nullptr; - typename SharedPtrBlockMap::iterator itUncompressedBlock = m_pRecentlyUsedBlocks.find(v3dBlockPos); + std::shared_ptr< Chunk > pChunk = nullptr; + typename SharedPtrBlockMap::iterator itChunk = m_pRecentlyUsedBlocks.find(v3dBlockPos); // Check whether the block was found. - if ((itUncompressedBlock) != m_pRecentlyUsedBlocks.end()) + if ((itChunk) != m_pRecentlyUsedBlocks.end()) { // The block was found so we can use it. - pUncompressedBlock = itUncompressedBlock->second; - POLYVOX_ASSERT(pUncompressedBlock, "Recent block list shold never contain a null pointer."); + pChunk = itChunk->second; + POLYVOX_ASSERT(pChunk, "Recent block list shold never contain a null pointer."); } - if (!pUncompressedBlock) + if (!pChunk) { // Although it's not in our recently use blocks, there's some (slim) chance that it // exists in the list of all loaded blocks, because a sampler may be holding on to it. - typename WeakPtrBlockMap::iterator itWeakUncompressedBlock = m_pAllBlocks.find(v3dBlockPos); - if (itWeakUncompressedBlock != m_pAllBlocks.end()) + typename WeakPtrBlockMap::iterator itWeakChunk = m_pAllBlocks.find(v3dBlockPos); + if (itWeakChunk != m_pAllBlocks.end()) { // We've found an entry in the 'all blocks' list, but it can be null. This happens if a sampler was the // last thing to be keeping it alive and then the sampler let it go. In this case we remove it from the // list, and it will get added again soon when we page it in and fill it with valid data. - if (itWeakUncompressedBlock->second.expired()) + if (itWeakChunk->second.expired()) { - m_pAllBlocks.erase(itWeakUncompressedBlock); + m_pAllBlocks.erase(itWeakChunk); } else { // The block is valid. We know it's not in the recently used list (we checked earlier) so it should be added. - pUncompressedBlock = std::shared_ptr< UncompressedBlock >(itWeakUncompressedBlock->second); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + pChunk = std::shared_ptr< Chunk >(itWeakChunk->second); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); } } } // If we still haven't found the block then it's time to create a new one and page it in from disk. - if (!pUncompressedBlock) + if (!pChunk) { // The block was not found so we will create a new one. - pUncompressedBlock = std::make_shared< UncompressedBlock >(v3dBlockPos, m_uBlockSideLength, m_pPager); + pChunk = std::make_shared< Chunk >(v3dBlockPos, m_uBlockSideLength, m_pPager); // As we are loading a new block we should try to ensure we don't go over our target memory usage. bool erasedBlock = false; @@ -594,15 +594,15 @@ namespace PolyVox } // Add our new block to the maps. - m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); - m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pUncompressedBlock)); + m_pAllBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); + m_pRecentlyUsedBlocks.insert(std::make_pair(v3dBlockPos, pChunk)); } - pUncompressedBlock->m_uBlockLastAccessed = ++m_uTimestamper; - m_pLastAccessedBlock = pUncompressedBlock; + pChunk->m_uBlockLastAccessed = ++m_uTimestamper; + m_pLastAccessedBlock = pChunk; m_v3dLastAccessedBlockPos = v3dBlockPos; - return pUncompressedBlock; + return pChunk; } //////////////////////////////////////////////////////////////////////////////// @@ -616,7 +616,7 @@ namespace PolyVox // Note: We disregard the size of the other class members as they are likely to be very small compared to the size of the // allocated voxel data. This also keeps the reported size as a power of two, which makes other memory calculations easier. - return UncompressedBlock::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); + return Chunk::calculateSizeInBytes(m_uBlockSideLength) * m_pAllBlocks.size(); } template @@ -692,8 +692,8 @@ namespace PolyVox const uint16_t yOffset = static_cast(uYPos - (blockY << m_uBlockSideLengthPower)); const uint16_t zOffset = static_cast(uZPos - (blockZ << m_uBlockSideLengthPower)); - auto pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); - return pUncompressedBlock->getVoxel(xOffset, yOffset, zOffset); + auto pChunk = getChunk(blockX, blockY, blockZ); + return pChunk->getVoxel(xOffset, yOffset, zOffset); } } diff --git a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl index 5c55e8ae..d6f38554 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/PagedVolumeSampler.inl @@ -119,7 +119,7 @@ namespace PolyVox uYPosInBlock * this->mVolume->m_uBlockSideLength + uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; - auto pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); + auto pUncompressedCurrentBlock = this->mVolume->getChunk(uXBlock, uYBlock, uZBlock); mCurrentVoxel = pUncompressedCurrentBlock->m_tData + uVoxelIndexInBlock; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index 6b670302..f8edc620 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Pager_H__ #define __PolyVox_Pager_H__ -#include "PolyVoxCore/UncompressedBlock.h" +#include "PolyVoxCore/Chunk.h" #include "PolyVoxCore/Impl/TypeDef.h" #include @@ -43,8 +43,8 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; - virtual void pageIn(const Region& region, UncompressedBlock* pBlockData) = 0; - virtual void pageOut(const Region& region, UncompressedBlock* pBlockData) = 0; + virtual void pageIn(const Region& region, Chunk* pBlockData) = 0; + virtual void pageOut(const Region& region, Chunk* pBlockData) = 0; }; }