From 9784288b63adcc154646d07d6551b10c5211e81e Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 21 Nov 2013 13:51:40 -0800 Subject: [PATCH] added some debugging --- libraries/voxels/src/VoxelTree.cpp | 23 +++++++++++++---------- voxel-edit/src/main.cpp | 4 ++++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/libraries/voxels/src/VoxelTree.cpp b/libraries/voxels/src/VoxelTree.cpp index c2ea538a01..6df4cc4071 100644 --- a/libraries/voxels/src/VoxelTree.cpp +++ b/libraries/voxels/src/VoxelTree.cpp @@ -1110,17 +1110,20 @@ int VoxelTree::encodeTreeBitstream(VoxelNode* node, doneEncoding(node); // debug compare the buffer to the packet... - printf("encodeTreeBitstream()... bytesWritten=%d\n",bytesWritten); - printf(" originalOutputBuffer...\n"); - outputBufferBits(originalOutputBuffer, bytesWritten); - printf(" packet...\n"); - outputBufferBits(packet->getStartOfBuffer(), bytesWritten); - if (memcmp(originalOutputBuffer, packet->getStartOfBuffer(), bytesWritten) == 0) { - printf("... they MATCH ...\n"); - } else { - printf("... they DO NOT MATCH!!!!! ...\n"); + bool debug = false; + if (debug) { + printf("encodeTreeBitstream()... bytesWritten=%d\n",bytesWritten); + printf(" originalOutputBuffer...\n"); + outputBufferBits(originalOutputBuffer, bytesWritten); + printf(" packet...\n"); + outputBufferBits(packet->getStartOfBuffer(), bytesWritten); + if (memcmp(originalOutputBuffer, packet->getStartOfBuffer(), bytesWritten) == 0) { + printf("... they MATCH ...\n"); + } else { + printf("... they DO NOT MATCH!!!!! ...\n"); + } } - + return bytesWritten; } diff --git a/voxel-edit/src/main.cpp b/voxel-edit/src/main.cpp index 5f67a46163..e24638389a 100644 --- a/voxel-edit/src/main.cpp +++ b/voxel-edit/src/main.cpp @@ -45,6 +45,7 @@ void voxelTutorial(VoxelTree * tree) { node->getColor()[0], node->getColor()[1], node->getColor()[2]); } + /*** // here's an example of how to delete a voxel printf("attempting to delete corner point 0,0,0\n"); tree->deleteVoxelAt(0, 0, 0, voxelSize); @@ -55,6 +56,7 @@ void voxelTutorial(VoxelTree * tree) { } else { printf("corner point 0,0,0 does not exists...\n"); } + ***/ } @@ -350,7 +352,9 @@ int main(int argc, const char * argv[]) unsigned long nodeCount = myTree.getVoxelCount(); printf("Nodes after adding scenes: %ld nodes\n", nodeCount); + printf("BEFORE writeToSVOFile()\n"); myTree.writeToSVOFile("voxels.svo"); + printf("AFTER writeToSVOFile()\n"); } return 0;