History

Backed out last change to recursion.

matsukaze committed 12 years ago

Commit 32f0a811 parent 04b1c3e2 files · +18 −5Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+17−5
@@ -60,6 +60,7 @@ VoxelSystem::VoxelSystem(float treeScale, int maxVoxels) · 59 unmodified lines
6060 _treeScale(treeScale),
6161 _maxVoxels(maxVoxels),
6262 _initialized(false),
63+ _inOcclusions(false),
6364 _showCulledSharedFaces(false),
6465 _usePrimitiveRenderer(false),
6566 _renderer(0) {
@@ -1506,8 +1507,8 @@ bool VoxelSystem::inspectForInteriorOcclusionsOperation(OctreeElement* element, · 1440 unmodified lines
15061507 _nodeCount++;
15071508 VoxelTreeElement* voxel = (VoxelTreeElement*)element;
15081509
1509− // Nothing to do at the leaf level or below the should render level
1510− if (voxel->isLeaf() || voxel->getShouldRender()) {
1510+ // Nothing to do at the leaf level
1511+ if (voxel->isLeaf()) {
15111512 return false;
15121513 }
15131514
@@ -1571,8 +1572,8 @@ bool VoxelSystem::inspectForExteriorOcclusionsOperation(OctreeElement* element, · 57 unmodified lines
15711572 _nodeCount++;
15721573 VoxelTreeElement* voxel = (VoxelTreeElement*)element;
15731574
1574− // Nothing to do at the leaf level or below the should render level
1575− if (voxel->isLeaf() || voxel->getShouldRender()) {
1575+ // Nothing to do at the leaf level
1576+ if (voxel->isLeaf()) {
15761577 return false;
15771578 }
15781579
@@ -1645,7 +1646,7 @@ bool VoxelSystem::clearAllOcclusionsOperation(OctreeElement* element, void* extr · 66 unmodified lines
16451646 VoxelTreeElement* voxel = (VoxelTreeElement*)element;
16461647
16471648 bool rc;
1648− if (voxel->isLeaf() || voxel->getShouldRender()) {
1649+ if (voxel->isLeaf()) {
16491650
16501651 // By definition the the exterior faces of a leaf voxel are
16511652 // always occluders.
@@ -1700,6 +1701,10 @@ void VoxelSystem::showCulledSharedFaces() { · 48 unmodified lines
17001701
17011702 void VoxelSystem::clearAllOcclusions() {
17021703
1704+ if (_inOcclusions) {
1705+ return;
1706+ }
1707+ _inOcclusions = true;
17031708 _nodeCount = 0;
17041709
17051710 bool showDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
@@ -1715,10 +1720,16 @@ void VoxelSystem::clearAllOcclusions() { · 9 unmodified lines
17151720 _writeRenderFullVBO = true;
17161721 _tree->setDirtyBit();
17171722 setupNewVoxelsForDrawing();
1723+
1724+ _inOcclusions = false;
17181725 }
17191726
17201727 void VoxelSystem::inspectForOcclusions() {
17211728
1729+ if (_inOcclusions) {
1730+ return;
1731+ }
1732+ _inOcclusions = true;
17221733 _nodeCount = 0;
17231734
17241735 bool showDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
@@ -1736,6 +1747,7 @@ void VoxelSystem::inspectForOcclusions() { · 11 unmodified lines
17361747 _writeRenderFullVBO = true;
17371748 _tree->setDirtyBit();
17381749 setupNewVoxelsForDrawing();
1750+ _inOcclusions = false;
17391751 }
17401752
17411753 bool VoxelSystem::forceRedrawEntireTreeOperation(OctreeElement* element, void* extraData) {