mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:17:58 +02:00
flush delete queue after encode is complete
This commit is contained in:
parent
f19477dd63
commit
25e21f862c
2 changed files with 15 additions and 0 deletions
|
@ -1832,6 +1832,9 @@ void VoxelTree::doneEncoding(VoxelNode* node) {
|
||||||
pthread_mutex_lock(&_encodeSetLock);
|
pthread_mutex_lock(&_encodeSetLock);
|
||||||
_codesBeingEncoded.erase(node->getOctalCode());
|
_codesBeingEncoded.erase(node->getOctalCode());
|
||||||
pthread_mutex_unlock(&_encodeSetLock);
|
pthread_mutex_unlock(&_encodeSetLock);
|
||||||
|
|
||||||
|
// if we have any pending delete codes, then delete them now.
|
||||||
|
emptyDeleteQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelTree::startDeleting(unsigned char* code) {
|
void VoxelTree::startDeleting(unsigned char* code) {
|
||||||
|
@ -1859,6 +1862,16 @@ void VoxelTree::queueForLaterDelete(unsigned char* codeBuffer) {
|
||||||
pthread_mutex_unlock(&_deletePendingSetLock);
|
pthread_mutex_unlock(&_deletePendingSetLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VoxelTree::emptyDeleteQueue() {
|
||||||
|
pthread_mutex_lock(&_deletePendingSetLock);
|
||||||
|
for (std::set<unsigned char*>::iterator i = _codesPendingDelete.begin(); i != _codesPendingDelete.end(); ++i) {
|
||||||
|
unsigned char* codeToDelete = *i;
|
||||||
|
_codesBeingDeleted.erase(codeToDelete);
|
||||||
|
deleteVoxelCodeFromTree(codeToDelete, COLLAPSE_EMPTY_TREE);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&_deletePendingSetLock);
|
||||||
|
}
|
||||||
|
|
||||||
void VoxelTree::cancelImport() {
|
void VoxelTree::cancelImport() {
|
||||||
_stopImport = true;
|
_stopImport = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,6 +252,8 @@ private:
|
||||||
|
|
||||||
/// Adds an Octal Code to the set of codes that needs to be deleted
|
/// Adds an Octal Code to the set of codes that needs to be deleted
|
||||||
void queueForLaterDelete(unsigned char* codeBuffer);
|
void queueForLaterDelete(unsigned char* codeBuffer);
|
||||||
|
/// flushes out any Octal Codes that had to be queued
|
||||||
|
void emptyDeleteQueue();
|
||||||
};
|
};
|
||||||
|
|
||||||
float boundaryDistanceForRenderLevel(unsigned int renderLevel);
|
float boundaryDistanceForRenderLevel(unsigned int renderLevel);
|
||||||
|
|
Loading…
Reference in a new issue