mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 17:03:11 +02:00
explicitly set hasChildren to false
This commit is contained in:
parent
c01cf4db53
commit
2df808fba5
1 changed files with 1 additions and 8 deletions
|
@ -78,8 +78,6 @@ VoxelNode * VoxelTree::nodeForOctalCode(VoxelNode *ancestorNode, unsigned char *
|
|||
|
||||
VoxelNode * VoxelTree::createMissingNode(VoxelNode *lastParentNode, unsigned char *codeToReach) {
|
||||
int indexOfNewChild = branchIndexWithDescendant(lastParentNode->octalCode, codeToReach);
|
||||
printf("Adding child at %d for parent with octal code\n", indexOfNewChild);
|
||||
printOctalCode(lastParentNode->octalCode);
|
||||
lastParentNode->addChildAtIndex(indexOfNewChild);
|
||||
|
||||
if (*lastParentNode->children[indexOfNewChild]->octalCode == *codeToReach) {
|
||||
|
@ -164,8 +162,6 @@ void VoxelTree::readBitstreamToTree(unsigned char * bitstream, int bufferSizeByt
|
|||
|
||||
void VoxelTree::readCodeColorBufferToTree(unsigned char *codeColorBuffer) {
|
||||
VoxelNode *lastCreatedNode = nodeForOctalCode(rootNode, codeColorBuffer);
|
||||
printf("Octal code for last created node\n");
|
||||
printOctalCode(lastCreatedNode->octalCode);
|
||||
|
||||
// create the node if it does not exist
|
||||
if (*lastCreatedNode->octalCode != *codeColorBuffer) {
|
||||
|
@ -177,9 +173,6 @@ void VoxelTree::readCodeColorBufferToTree(unsigned char *codeColorBuffer) {
|
|||
int octalCodeBytes = bytesRequiredForCodeLength(*codeColorBuffer);
|
||||
memcpy(lastCreatedNode->color, codeColorBuffer + octalCodeBytes, 3);
|
||||
lastCreatedNode->color[3] = 1;
|
||||
|
||||
printf("Final created octal code has color %d,%d,%d and code\n", lastCreatedNode->color[0], lastCreatedNode->color[1], lastCreatedNode->color[2]);
|
||||
printOctalCode(lastCreatedNode->octalCode);
|
||||
}
|
||||
|
||||
unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer,
|
||||
|
@ -391,7 +384,7 @@ void VoxelTree::printTreeForDebugging(VoxelNode *startNode) {
|
|||
}
|
||||
|
||||
void VoxelTree::reaverageVoxelColors(VoxelNode *startNode) {
|
||||
bool hasChildren;
|
||||
bool hasChildren = false;
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (startNode->children[i] != NULL) {
|
||||
|
|
Loading…
Reference in a new issue