From c51b4e331163f153dfd59bf293436ccaeb1d17b2 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 22 Mar 2013 16:21:45 -0700 Subject: [PATCH] add leavesWrittenToBitstream member variable to VoxelTree for debug --- shared/src/VoxelTree.cpp | 4 ++++ shared/src/VoxelTree.h | 1 + 2 files changed, 5 insertions(+) diff --git a/shared/src/VoxelTree.cpp b/shared/src/VoxelTree.cpp index 643a7a6f8b..dff2787bf8 100644 --- a/shared/src/VoxelTree.cpp +++ b/shared/src/VoxelTree.cpp @@ -231,6 +231,10 @@ unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer, unsigned char * childStopOctalCode = NULL; + if (currentVoxelNode->childMask == 0) { + leavesWrittenToBitstream++; + } + if (*currentVoxelNode->octalCode < deepestLevel - 1) { for (int i = firstIndexToCheck; i < 8; i ++) { diff --git a/shared/src/VoxelTree.h b/shared/src/VoxelTree.h index a2215f5dd1..f75d99d27b 100644 --- a/shared/src/VoxelTree.h +++ b/shared/src/VoxelTree.h @@ -23,6 +23,7 @@ public: ~VoxelTree(); VoxelNode *rootNode; + int leavesWrittenToBitstream; int levelForViewerPosition(float * position); void readBitstreamToTree(unsigned char * bitstream, int bufferSizeBytes);