History

Fix for flashing when painting textures.

Andrzej Kapolka committed 12 years ago

Commit 5c773171 parent 6e06b632 files · +13 −4Browse files

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

Unified · Split

interface/src/MetavoxelSystem.cpp+9−3
@@ -118,7 +118,7 @@ void MetavoxelSystem::render() { · 117 unmodified lines
118 viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());118 viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());
119 119
120 RenderVisitor renderVisitor(getLOD());120 RenderVisitor renderVisitor(getLOD());
121 guideToAugmented(renderVisitor);121 guideToAugmented(renderVisitor, true);
122}122}
123 123
124class RayHeightfieldIntersectionVisitor : public RayIntersectionVisitor {124class RayHeightfieldIntersectionVisitor : public RayIntersectionVisitor {
@@ -459,13 +459,19 @@ MetavoxelClient* MetavoxelSystem::createClient(const SharedNodePointer& node) { · 334 unmodified lines
459 return new MetavoxelSystemClient(node, _updater);459 return new MetavoxelSystemClient(node, _updater);
460}460}
461 461
462void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor) {462void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) {
463 foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) {463 foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) {
464 if (node->getType() == NodeType::MetavoxelServer) {464 if (node->getType() == NodeType::MetavoxelServer) {
465 QMutexLocker locker(&node->getMutex());465 QMutexLocker locker(&node->getMutex());
466 MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());466 MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
467 if (client) {467 if (client) {
468 client->getAugmentedData().guide(visitor);468 MetavoxelData data = client->getAugmentedData();
469 data.guide(visitor);
470 if (render) {
471 // save the rendered augmented data so that its cached texture references, etc., don't
472 // get collected when we replace it with more recent versions
473 client->setRenderedAugmentedData(data);
474 }
469 }475 }
470 }476 }
471 }477 }