Showing the changes to interface/src/VoxelSystem.cpp (1 of 5 files). Show all
Unified · Split
| @@ -337,16 +337,15 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) { · 336 unmodified lines | |||
| 337 | } else { | 337 | } else { |
| 338 | voxelsUpdated += updateNodeInArraysAsPartialVBO(node); | 338 | voxelsUpdated += updateNodeInArraysAsPartialVBO(node); |
| 339 | } | 339 | } |
| 340 | node->clearDirtyBit(); // clear the dirty bit, do this before we potentially delete things. | ||
| 340 | 341 | ||
| 341 | // If the node has been asked to be deleted, but we've gotten to here, after updateNodeInArraysXXX() | 342 | // If the node has been asked to be deleted, but we've gotten to here, after updateNodeInArraysXXX() |
| 342 | // then it means our VBOs are "clean" and our vertices have been removed or not added. So we can now | 343 | // then it means our VBOs are "clean" and our vertices have been removed or not added. So we can now |
| 343 | // safely remove the node from the tree and actually delete it. | 344 | // safely remove the node from the tree and actually delete it. |
| 344 | // otherwise honor our calculated shouldRender | ||
| 345 | if (node->isStagedForDeletion()) { | 345 | if (node->isStagedForDeletion()) { |
| 346 | _tree->deleteVoxelCodeFromTree(node->getOctalCode()); | 346 | _tree->deleteVoxelCodeFromTree(node->getOctalCode()); |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | node->clearDirtyBit(); // always clear the dirty bit, even if it doesn't need to be rendered | ||
| 350 | return voxelsUpdated; | 349 | return voxelsUpdated; |
| 351 | } | 350 | } |
| 352 | 351 | ||