mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 23:12:16 +02:00
fix printTreeForDebugging instead of addition of repairChildMasks
This commit is contained in:
parent
f435a09673
commit
c9e16994f4
2 changed files with 1 additions and 27 deletions
|
@ -159,31 +159,6 @@ void VoxelTree::readCodeColorBufferToTree(unsigned char *codeColorBuffer) {
|
|||
// give this node its color
|
||||
memcpy(lastCreatedNode->color, codeColorBuffer + octalCodeBytes, 3);
|
||||
lastCreatedNode->color[3] = 1;
|
||||
|
||||
repairChildMasks(rootNode);
|
||||
}
|
||||
|
||||
int VoxelTree::repairChildMasks(VoxelNode *currentNode) {
|
||||
|
||||
currentNode->childMask = 0;
|
||||
int grandChildren = 0;
|
||||
int thisNodeGrandChildren = 0;
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
|
||||
if (currentNode->children[i] != NULL) {
|
||||
thisNodeGrandChildren = repairChildMasks(currentNode->children[i]);
|
||||
|
||||
if (thisNodeGrandChildren > 0) {
|
||||
currentNode->childMask += (1 << (7 - i));
|
||||
}
|
||||
|
||||
thisNodeGrandChildren += grandChildren;
|
||||
}
|
||||
}
|
||||
|
||||
return grandChildren;
|
||||
|
||||
}
|
||||
|
||||
unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer,
|
||||
|
@ -311,7 +286,7 @@ void VoxelTree::printTreeForDebugging(VoxelNode *startNode) {
|
|||
// ask children to recursively output their trees
|
||||
// if they aren't a leaf
|
||||
for (int k = 0; k < 8; k++) {
|
||||
if (startNode->children[k] != NULL && oneAtBit(startNode->childMask, k)) {
|
||||
if (startNode->children[k] != NULL) {
|
||||
printTreeForDebugging(startNode->children[k]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ public:
|
|||
int levelForViewerPosition(float * position);
|
||||
void readBitstreamToTree(unsigned char * bitstream, int bufferSizeBytes);
|
||||
void readCodeColorBufferToTree(unsigned char *codeColorBuffer);
|
||||
int repairChildMasks(VoxelNode *currentNode);
|
||||
unsigned char * loadBitstreamBuffer(unsigned char *& bitstreamBuffer,
|
||||
unsigned char * octalCode,
|
||||
VoxelNode *currentVoxelNode,
|
||||
|
|
Loading…
Reference in a new issue