Showing the changes to interface/src/VoxelSystem.cpp (1 of 6 files). Show all
Unified · Split
| @@ -561,30 +561,30 @@ int VoxelSystem::parseData(const QByteArray& packet) { · 560 unmodified lines | ||
| 561 | 561 | |
| 562 | 562 | const unsigned char* dataAt = reinterpret_cast<const unsigned char*>(packet.data()) + numBytesPacketHeader; |
| 563 | 563 | |
| 564 | − VOXEL_PACKET_FLAGS flags = (*(VOXEL_PACKET_FLAGS*)(dataAt)); | |
| 565 | − dataAt += sizeof(VOXEL_PACKET_FLAGS); | |
| 566 | − VOXEL_PACKET_SEQUENCE sequence = (*(VOXEL_PACKET_SEQUENCE*)dataAt); | |
| 567 | − dataAt += sizeof(VOXEL_PACKET_SEQUENCE); | |
| 564 | + OCTREE_PACKET_FLAGS flags = (*(OCTREE_PACKET_FLAGS*)(dataAt)); | |
| 565 | + dataAt += sizeof(OCTREE_PACKET_FLAGS); | |
| 566 | + OCTREE_PACKET_SEQUENCE sequence = (*(OCTREE_PACKET_SEQUENCE*)dataAt); | |
| 567 | + dataAt += sizeof(OCTREE_PACKET_SEQUENCE); | |
| 568 | 568 | |
| 569 | − VOXEL_PACKET_SENT_TIME sentAt = (*(VOXEL_PACKET_SENT_TIME*)dataAt); | |
| 570 | − dataAt += sizeof(VOXEL_PACKET_SENT_TIME); | |
| 569 | + OCTREE_PACKET_SENT_TIME sentAt = (*(OCTREE_PACKET_SENT_TIME*)dataAt); | |
| 570 | + dataAt += sizeof(OCTREE_PACKET_SENT_TIME); | |
| 571 | 571 | |
| 572 | 572 | bool packetIsColored = oneAtBit(flags, PACKET_IS_COLOR_BIT); |
| 573 | 573 | bool packetIsCompressed = oneAtBit(flags, PACKET_IS_COMPRESSED_BIT); |
| 574 | 574 | |
| 575 | − VOXEL_PACKET_SENT_TIME arrivedAt = usecTimestampNow(); | |
| 575 | + OCTREE_PACKET_SENT_TIME arrivedAt = usecTimestampNow(); | |
| 576 | 576 | int flightTime = arrivedAt - sentAt; |
| 577 | 577 | |
| 578 | − VOXEL_PACKET_INTERNAL_SECTION_SIZE sectionLength = 0; | |
| 579 | − int dataBytes = packet.size() - VOXEL_PACKET_HEADER_SIZE; | |
| 578 | + OCTREE_PACKET_INTERNAL_SECTION_SIZE sectionLength = 0; | |
| 579 | + int dataBytes = packet.size() - (numBytesPacketHeader + OCTREE_PACKET_EXTRA_HEADERS_SIZE); | |
| 580 | 580 | |
| 581 | 581 | int subsection = 1; |
| 582 | 582 | while (dataBytes > 0) { |
| 583 | 583 | if (packetIsCompressed) { |
| 584 | − if (dataBytes > sizeof(VOXEL_PACKET_INTERNAL_SECTION_SIZE)) { | |
| 585 | − sectionLength = (*(VOXEL_PACKET_INTERNAL_SECTION_SIZE*)dataAt); | |
| 586 | − dataAt += sizeof(VOXEL_PACKET_INTERNAL_SECTION_SIZE); | |
| 587 | − dataBytes -= sizeof(VOXEL_PACKET_INTERNAL_SECTION_SIZE); | |
| 584 | + if (dataBytes > sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE)) { | |
| 585 | + sectionLength = (*(OCTREE_PACKET_INTERNAL_SECTION_SIZE*)dataAt); | |
| 586 | + dataAt += sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE); | |
| 587 | + dataBytes -= sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE); | |
| 588 | 588 | } else { |
| 589 | 589 | sectionLength = 0; |
| 590 | 590 | dataBytes = 0; // stop looping something is wrong |