mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
code review fixes
This commit is contained in:
parent
9dc09de75e
commit
3af8a1b8f4
3 changed files with 7 additions and 7 deletions
|
@ -232,7 +232,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) {
|
|||
bool inChildBoundary = (distanceToNode <= childBoundary);
|
||||
shouldRender = (node->isLeaf() && inChildBoundary) || (inBoundary && !inChildBoundary);
|
||||
}
|
||||
node->setShouldRender(shouldRender && !node->deleteMe());
|
||||
node->setShouldRender(shouldRender && !node->isStagedForDeletion());
|
||||
// let children figure out their renderness
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
if (node->getChildAtIndex(i)) {
|
||||
|
@ -249,7 +249,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) {
|
|||
// then it means our VBOs are "clean" and our vertices have been removed or not added. So we can now
|
||||
// safely remove the node from the tree and actually delete it.
|
||||
// otherwise honor our calculated shouldRender
|
||||
if (node->deleteMe()) {
|
||||
if (node->isStagedForDeletion()) {
|
||||
_tree->deleteVoxelCodeFromTree(node->getOctalCode());
|
||||
}
|
||||
|
||||
|
@ -915,7 +915,7 @@ void VoxelSystem::deleteVoxelAt(float x, float y, float z, float s) {
|
|||
VoxelNode* node = _tree->getVoxelAt(x, y, z, s);
|
||||
if (node) {
|
||||
// tell the node we want it deleted
|
||||
node->pleaseDeleteMe();
|
||||
node->stageForDeletion();
|
||||
|
||||
// tree is now dirty
|
||||
_tree->setDirtyBit();
|
||||
|
|
|
@ -44,7 +44,7 @@ void VoxelNode::init(unsigned char * octalCode) {
|
|||
_glBufferIndex = GLBUFFER_INDEX_UNKNOWN;
|
||||
_isDirty = true;
|
||||
_shouldRender = false;
|
||||
_deleteMe = false;
|
||||
_isStagedForDeletion = false;
|
||||
|
||||
calculateAABox();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ private:
|
|||
glBufferIndex _glBufferIndex;
|
||||
bool _isDirty;
|
||||
bool _shouldRender;
|
||||
bool _deleteMe;
|
||||
bool _isStagedForDeletion;
|
||||
AABox _box;
|
||||
unsigned char* _octalCode;
|
||||
VoxelNode* _children[8];
|
||||
|
@ -73,8 +73,8 @@ public:
|
|||
bool getShouldRender() const { return _shouldRender; }
|
||||
|
||||
// Used by VoxelSystem to mark a node as to be deleted on next render pass
|
||||
void pleaseDeleteMe() { _deleteMe = true; };
|
||||
bool deleteMe() const { return _deleteMe; }
|
||||
void stageForDeletion() { _isStagedForDeletion = true; };
|
||||
bool isStagedForDeletion() const { return _isStagedForDeletion; }
|
||||
|
||||
#ifndef NO_FALSE_COLOR // !NO_FALSE_COLOR means, does have false color
|
||||
void setFalseColor(colorPart red, colorPart green, colorPart blue);
|
||||
|
|
Loading…
Reference in a new issue