Showing the changes to interface/src/VoxelSystem.cpp (1 of 4 files). Show all
Unified · Split
| @@ -101,6 +101,11 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 100 unmodified lines | ||
| 101 | 101 | double start = usecTimestampNow(); |
| 102 | 102 | // ask the VoxelTree to read the bitstream into the tree |
| 103 | 103 | _tree->readBitstreamToTree(voxelData, numBytes - 1); |
| 104 | + if (_renderWarningsOn && _tree->getNodesChangedFromBitstream()) { | |
| 105 | + printLog("readBitstreamToTree()... getNodesChangedFromBitstream=%ld _tree->isDirty()=%s \n", | |
| 106 | + _tree->getNodesChangedFromBitstream(), (_tree->isDirty() ? "yes" : "no") ); | |
| 107 | + } | |
| 108 | + | |
| 104 | 109 | double end = usecTimestampNow(); |
| 105 | 110 | double elapsedmsec = (end - start)/1000.0; |
| 106 | 111 | if (_renderWarningsOn && elapsedmsec > 1) { |
| @@ -178,7 +183,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 71 unmodified lines | ||
| 178 | 183 | |
| 179 | 184 | void VoxelSystem::copyWrittenDataToReadArrays() { |
| 180 | 185 | double start = usecTimestampNow(); |
| 181 | − if (_voxelsDirty) { | |
| 186 | + if (_voxelsDirty && _voxelsUpdated) { | |
| 182 | 187 | // lock on the buffer write lock so we can't modify the data when the GPU is reading it |
| 183 | 188 | pthread_mutex_lock(&_bufferWriteLock); |
| 184 | 189 | int bytesOfVertices = (_voxelsInArrays * VERTEX_POINTS_PER_VOXEL) * sizeof(GLfloat); |