From 2df808fba57d7b115295ff4040ece673f6d1c777 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 29 Mar 2013 10:58:29 -0700 Subject: [PATCH] explicitly set hasChildren to false --- shared/src/VoxelTree.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/shared/src/VoxelTree.cpp b/shared/src/VoxelTree.cpp index ea91316344..136769d93a 100644 --- a/shared/src/VoxelTree.cpp +++ b/shared/src/VoxelTree.cpp @@ -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) {