diff --git a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h index 8ba7a081..5e28782d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/FilePager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/FilePager.h @@ -70,6 +70,13 @@ namespace PolyVox { logTrace() << "Paging in data for " << region; + fseek(pFile, 0L, SEEK_END); + pBlockData->m_uCompressedDataLength = ftell(pFile); + fseek(pFile, 0L, SEEK_SET); + + delete[] pBlockData->m_pCompressedData; + pBlockData->m_pCompressedData = new uint8_t[pBlockData->m_uCompressedDataLength]; + fread(pBlockData->m_pCompressedData, sizeof(uint8_t), pBlockData->m_uCompressedDataLength, pFile); if(ferror(pFile)) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Pager.h b/library/PolyVoxCore/include/PolyVoxCore/Pager.h index 893898bb..13f4ad19 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Pager.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Pager.h @@ -24,6 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_Pager_H__ #define __PolyVox_Pager_H__ +#include "PolyVoxCore/Impl/Block.h" #include "PolyVoxCore/Impl/TypeDef.h" #include "PolyVoxCore/ConstVolumeProxy.h" @@ -42,6 +43,9 @@ namespace PolyVox /// Destructor virtual ~Pager() {}; + virtual void pageIn(const Region& region, Block* pBlockData) = 0; + virtual void pageOut(const Region& region, Block* pBlockData) = 0; + virtual void dataRequiredHandler(const ConstVolumeProxy& volumeProxy, const Region& region) { POLYVOX_ASSERT(false, "NOT IMPLEMENTED");