diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index e6d27a3921..ac8b71f66e 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -106,14 +106,14 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { { PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()"); // ask the VoxelTree to read the bitstream into the tree - _tree->readBitstreamToTree(voxelData, numBytes - 1, true, WANT_EXISTS_BITS); + _tree->readBitstreamToTree(voxelData, numBytes - 1, WANT_COLOR, WANT_EXISTS_BITS); } break; case PACKET_HEADER_VOXEL_DATA_MONOCHROME: { PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()"); // ask the VoxelTree to read the MONOCHROME bitstream into the tree - _tree->readBitstreamToTree(voxelData, numBytes - 1, false, WANT_EXISTS_BITS); + _tree->readBitstreamToTree(voxelData, numBytes - 1, NO_COLOR, WANT_EXISTS_BITS); } break; case PACKET_HEADER_Z_COMMAND: diff --git a/libraries/voxels/src/VoxelTree.h b/libraries/voxels/src/VoxelTree.h index b2b50da169..d0056534f5 100644 --- a/libraries/voxels/src/VoxelTree.h +++ b/libraries/voxels/src/VoxelTree.h @@ -19,7 +19,10 @@ typedef bool (*RecurseVoxelTreeOperation)(VoxelNode* node, void* extraData); typedef enum {GRADIENT, RANDOM, NATURAL} creationMode; +#define NO_EXISTS_BITS false #define WANT_EXISTS_BITS true +#define NO_COLOR false +#define WANT_COLOR true class VoxelTree { public: @@ -43,7 +46,7 @@ public: void processRemoveVoxelBitstream(unsigned char * bitstream, int bufferSizeBytes); void readBitstreamToTree(unsigned char * bitstream, unsigned long int bufferSizeBytes, - bool includeColor = true, bool includeExistsBits = false); + bool includeColor = WANT_COLOR, bool includeExistsBits = false); void readCodeColorBufferToTree(unsigned char *codeColorBuffer, bool destructive = false); void deleteVoxelCodeFromTree(unsigned char *codeBuffer, bool stage = false); void printTreeForDebugging(VoxelNode *startNode); @@ -61,7 +64,7 @@ public: int encodeTreeBitstream(int maxEncodeLevel, VoxelNode* node, unsigned char* outputBuffer, int availableBytes, VoxelNodeBag& bag, const ViewFrustum* viewFrustum, - bool includeColor = true, bool includeExistsBits = false, + bool includeColor = WANT_COLOR, bool includeExistsBits = false, bool deltaViewFrustum = false, const ViewFrustum* lastViewFrustum = NULL) const; int searchForColoredNodes(int maxSearchLevel, VoxelNode* node, const ViewFrustum& viewFrustum, VoxelNodeBag& bag, @@ -100,7 +103,7 @@ private: VoxelNode* nodeForOctalCode(VoxelNode* ancestorNode, unsigned char* needleCode, VoxelNode** parentOfFoundNode) const; VoxelNode* createMissingNode(VoxelNode* lastParentNode, unsigned char* deepestCodeToCreate); int readNodeData(VoxelNode *destinationNode, unsigned char* nodeData, int bufferSizeBytes, - bool includeColor = true, bool includeExistsBits = false); + bool includeColor = WANT_COLOR, bool includeExistsBits = false); bool _isDirty; unsigned long int _nodesChangedFromBitstream;