History

make local voxel cache properly switch to different cache file when switching domains

Brad Hefta-Gaub committed 12 years ago

Commit 6e95c521 parent c181d0a6 files · +65 −27Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 6 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+6−7
@@ -117,7 +117,6 @@ void VoxelSystem::elementDeleted(OctreeElement* element) { · 116 unmodified lines
117117 VoxelTreeElement* voxel = (VoxelTreeElement*)element;
118118 if (voxel->getVoxelSystem() == this) {
119119 if (_voxelsInWriteArrays != 0) {
120−qDebug() << "elementDeleted()... about to call forceRemoveNodeFromArrays()\n";
121120 forceRemoveNodeFromArrays(voxel);
122121 } else {
123122 if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) {
@@ -706,6 +705,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 582 unmodified lines
706705 bool extraDebugging = Application::getInstance()->getLogger()->extraDebugging();
707706 if (extraDebugging) {
708707 qDebug("setupNewVoxelsForDrawing()... _voxelsUpdated=%lu...\n",_voxelsUpdated);
708+ _viewFrustum->printDebugDetails();
709709 }
710710 }
711711
@@ -2712,11 +2712,6 @@ void VoxelSystem::nodeKilled(Node* node) { · 2000 unmodified lines
27122712 }
27132713 }
27142714
2715−void VoxelSystem::domainChanged(QString domain) {
2716− killLocalVoxels();
2717−}
2718−
2719−
27202715 unsigned long VoxelSystem::getFreeMemoryGPU() {
27212716 // We can't ask all GPUs how much memory they have in use, but we can ask them about how much is free.
27222717 // So, we can record the free memory before we create our VBOs and the free memory after, and get a basic
@@ -2787,7 +2782,9 @@ void VoxelSystem::localVoxelCacheLoaded() { · 64 unmodified lines
27872782 // Make sure that the application has properly set up the view frustum for our loaded state
27882783 Application::getInstance()->initAvatarAndViewFrustum();
27892784
2790− _tree->setDirtyBit();
2785+ _tree->setDirtyBit(); // make sure the tree thinks it's dirty
2786+ _setupNewVoxelsForDrawingLastFinished = 0; // don't allow the setupNewVoxelsForDrawing() shortcuts
2787+ _writeRenderFullVBO = true; // this will disable individual node updates, was reset by killLocalVoxels()
27912788 setupNewVoxelsForDrawing();
27922789 _inhideOutOfView = false; // reenable hideOutOfView behavior
27932790 }
@@ -2796,6 +2793,8 @@ void VoxelSystem::beginLoadingLocalVoxelCache() { · 2 unmodified lines
27962793 qDebug() << "beginLoadingLocalVoxelCache()\n";
27972794 _writeRenderFullVBO = true; // this will disable individual node updates
27982795 _inhideOutOfView = true; // this will disable hidOutOfView which we want to do until local cache is loaded
2796+ killLocalVoxels();
2797+ qDebug() << "DONE beginLoadingLocalVoxelCache()\n";
27992798 }
28002799
28012800