Work on paging to file.

This commit is contained in:
David Williams 2013-06-22 11:19:30 +02:00
parent d9ebe96c5a
commit 5643140882
2 changed files with 11 additions and 0 deletions

View File

@ -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))

View File

@ -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<VoxelType>* pBlockData) = 0;
virtual void pageOut(const Region& region, Block<VoxelType>* pBlockData) = 0;
virtual void dataRequiredHandler(const ConstVolumeProxy<VoxelType>& volumeProxy, const Region& region)
{
POLYVOX_ASSERT(false, "NOT IMPLEMENTED");