History

Merge branch 'master' of https://github.com/worklist/hifi into occlusion_culling

ZappoMan committed 13 years ago

Commit c26e3972 parents 241bd7c 717518633 files · +485 −336Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 33 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+10−11
@@ -113,32 +113,31 @@ float VoxelSystem::getVoxelsBytesReadPerSecondAverage() { · 112 unmodified lines
113113 int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) {
114114
115115 unsigned char command = *sourceBuffer;
116− unsigned char *voxelData = sourceBuffer + 1;
116+ int numBytesPacketHeader = numBytesForPacketHeader(sourceBuffer);
117+ unsigned char* voxelData = sourceBuffer + numBytesPacketHeader;
117118
118119 pthread_mutex_lock(&_treeLock);
119120
120121 switch(command) {
121− case PACKET_HEADER_VOXEL_DATA:
122− {
122+ case PACKET_TYPE_VOXEL_DATA: {
123123 PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()");
124124 // ask the VoxelTree to read the bitstream into the tree
125− _tree->readBitstreamToTree(voxelData, numBytes - 1, WANT_COLOR, WANT_EXISTS_BITS);
125+ _tree->readBitstreamToTree(voxelData, numBytes - numBytesPacketHeader, WANT_COLOR, WANT_EXISTS_BITS);
126126 }
127− break;
128− case PACKET_HEADER_VOXEL_DATA_MONOCHROME:
129− {
127+ break;
128+ case PACKET_TYPE_VOXEL_DATA_MONOCHROME: {
130129 PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()");
131130 // ask the VoxelTree to read the MONOCHROME bitstream into the tree
132− _tree->readBitstreamToTree(voxelData, numBytes - 1, NO_COLOR, WANT_EXISTS_BITS);
131+ _tree->readBitstreamToTree(voxelData, numBytes - numBytesPacketHeader, NO_COLOR, WANT_EXISTS_BITS);
133132 }
134− break;
135− case PACKET_HEADER_Z_COMMAND:
133+ break;
134+ case PACKET_TYPE_Z_COMMAND:
136135
137136 // the Z command is a special command that allows the sender to send high level semantic
138137 // requests, like erase all, or add sphere scene, different receivers may handle these
139138 // messages differently
140139 char* packetData = (char *)sourceBuffer;
141− char* command = &packetData[1]; // start of the command
140+ char* command = &packetData[numBytesPacketHeader]; // start of the command
142141 int commandLength = strlen(command); // commands are null terminated strings
143142 int totalLength = 1+commandLength+1;
144143