mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
CR feedback
This commit is contained in:
parent
fb4424e975
commit
166ad4f73d
2 changed files with 3 additions and 8 deletions
|
@ -279,9 +279,9 @@ void VoxelNode::printDebugDetails(const char* label) const {
|
|||
printLog("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isColored=%s isDirty=%s shouldRender=%s\n children=", label,
|
||||
_box.getCorner().x, _box.getCorner().y, _box.getCorner().z, _box.getSize().x,
|
||||
debug::valueOf(isLeaf()), debug::valueOf(isColored()), debug::valueOf(isDirty()),
|
||||
debug::valueOf(getShouldRender()) );
|
||||
debug::valueOf(getShouldRender()));
|
||||
|
||||
outputBits(childBits,false);
|
||||
outputBits(childBits, false);
|
||||
printLog("\n octalCode=");
|
||||
printOctalCode(_octalCode);
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ int VoxelTree::readNodeData(VoxelNode* destinationNode, unsigned char* nodeData,
|
|||
|
||||
// give this destination node the child mask from the packet
|
||||
unsigned char childrenInTreeMask = includeExistsBits ? *(nodeData + bytesRead) : ALL_CHILDREN_ASSUMED_TO_EXIST;
|
||||
unsigned char childMask = *(nodeData + bytesRead + (includeExistsBits ? sizeof(childrenInTreeMask) : 0) );
|
||||
unsigned char childMask = *(nodeData + bytesRead + (includeExistsBits ? sizeof(childrenInTreeMask) : 0));
|
||||
|
||||
int childIndex = 0;
|
||||
bytesRead += includeExistsBits ? sizeof(childrenInTreeMask) + sizeof(childMask) : sizeof(childMask);
|
||||
|
@ -354,17 +354,12 @@ void VoxelTree::readCodeColorBufferToTree(unsigned char *codeColorBuffer, bool d
|
|||
void VoxelTree::processRemoveVoxelBitstream(unsigned char * bitstream, int bufferSizeBytes) {
|
||||
// XXXBHG: validate buffer is at least 4 bytes long? other guards??
|
||||
unsigned short int itemNumber = (*((unsigned short int*)&bitstream[1]));
|
||||
printLog("processRemoveVoxelBitstream() receivedBytes=%d itemNumber=%d\n",bufferSizeBytes,itemNumber);
|
||||
int atByte = 3;
|
||||
unsigned char* pVoxelData = (unsigned char*)&bitstream[3];
|
||||
while (atByte < bufferSizeBytes) {
|
||||
unsigned char octets = (unsigned char)*pVoxelData;
|
||||
int voxelDataSize = bytesRequiredForCodeLength(octets)+3; // 3 for color!
|
||||
|
||||
float* vertices = firstVertexForCode(pVoxelData);
|
||||
printLog("deleting voxel at: %f,%f,%f\n",vertices[0],vertices[1],vertices[2]);
|
||||
delete []vertices;
|
||||
|
||||
deleteVoxelCodeFromTree(pVoxelData);
|
||||
|
||||
pVoxelData+=voxelDataSize;
|
||||
|
|
Loading…
Reference in a new issue