More flush/prefetch work from ker.

This commit is contained in:
David Williams
2011-03-24 21:34:57 +00:00
parent 78c5884303
commit a364f6d72c
3 changed files with 120 additions and 84 deletions

View File

@ -186,17 +186,18 @@ namespace PolyVox
bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue);
/// Sets the voxel at a 3D vector position
bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue);
/// makes sure all the voxels in the given region are loaded
/// tries to load all voxels inside the given region
/// if MaxNumberOfBlocksInMemory is not large enough to support the region
/// this function will return false and the volume is unchanged
/// if all the voxels in the given region are already loaded, this function will not do anything but still return true.
/// this function will only load part of the region. it is undefined which parts will actually be loaded
/// if all the voxels in the given region are already loaded, this function will not do anything
/// other blocks might be unloaded to make space for the new blocks
bool prefetchRegion(Region regPrefetch);
void prefetch(Region regPrefetch);
/// attempts to unload all the voxels in the given region.
/// there is no guarantee that any voxels are unloaded
/// try unloading a region whose sidelengths are multiples of BlockSideLength
/// returns the number of voxels that were actually unloaded
uint32_t flushRegion(Region regFlush);
void flush(Region regFlush);
/// unloads all data
void flushAll();
void clearBlockCache(void);
float calculateCompressionRatio(void);