Making use of shared_ptr to track blocks.

This commit is contained in:
David Williams
2014-09-14 11:47:17 +02:00
parent 3cf8f38793
commit 47ace554cc
6 changed files with 22 additions and 19 deletions

View File

@ -90,7 +90,7 @@ public:
/// Destructor
virtual ~PerlinNoisePager() {};
virtual void pageIn(const PolyVox::Region& region, UncompressedBlock<MaterialDensityPair44>* pBlockData)
virtual void pageIn(const PolyVox::Region& region, std::shared_ptr< UncompressedBlock<MaterialDensityPair44> > 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...
@ -143,7 +143,7 @@ public:
//delete compressor;
}
virtual void pageOut(const PolyVox::Region& region, UncompressedBlock<MaterialDensityPair44>* /*pBlockData*/)
virtual void pageOut(const PolyVox::Region& region, std::shared_ptr< UncompressedBlock<MaterialDensityPair44> > /*pBlockData*/)
{
std::cout << "warning unloading region: " << region.getLowerCorner() << " -> " << region.getUpperCorner() << std::endl;
}