Work on paging to file.
This commit is contained in:
parent
d9ebe96c5a
commit
5643140882
@ -70,6 +70,13 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
logTrace() << "Paging in data for " << region;
|
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);
|
fread(pBlockData->m_pCompressedData, sizeof(uint8_t), pBlockData->m_uCompressedDataLength, pFile);
|
||||||
|
|
||||||
if(ferror(pFile))
|
if(ferror(pFile))
|
||||||
|
@ -24,6 +24,7 @@ freely, subject to the following restrictions:
|
|||||||
#ifndef __PolyVox_Pager_H__
|
#ifndef __PolyVox_Pager_H__
|
||||||
#define __PolyVox_Pager_H__
|
#define __PolyVox_Pager_H__
|
||||||
|
|
||||||
|
#include "PolyVoxCore/Impl/Block.h"
|
||||||
#include "PolyVoxCore/Impl/TypeDef.h"
|
#include "PolyVoxCore/Impl/TypeDef.h"
|
||||||
|
|
||||||
#include "PolyVoxCore/ConstVolumeProxy.h"
|
#include "PolyVoxCore/ConstVolumeProxy.h"
|
||||||
@ -42,6 +43,9 @@ namespace PolyVox
|
|||||||
/// Destructor
|
/// Destructor
|
||||||
virtual ~Pager() {};
|
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)
|
virtual void dataRequiredHandler(const ConstVolumeProxy<VoxelType>& volumeProxy, const Region& region)
|
||||||
{
|
{
|
||||||
POLYVOX_ASSERT(false, "NOT IMPLEMENTED");
|
POLYVOX_ASSERT(false, "NOT IMPLEMENTED");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user