mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-04 05:18:36 +02:00
cr cleanup
This commit is contained in:
parent
a6b486aa89
commit
2ec2824e8f
1 changed files with 17 additions and 16 deletions
|
@ -243,7 +243,8 @@ void VoxelTree::readBitstreamToTree(unsigned char * bitstream, int bufferSizeByt
|
||||||
int octalCodeBytes = bytesRequiredForCodeLength(*bitstreamAt);
|
int octalCodeBytes = bytesRequiredForCodeLength(*bitstreamAt);
|
||||||
int theseBytesRead = 0;
|
int theseBytesRead = 0;
|
||||||
theseBytesRead += octalCodeBytes;
|
theseBytesRead += octalCodeBytes;
|
||||||
theseBytesRead += readNodeData(bitstreamRootNode, bitstreamAt + octalCodeBytes, bufferSizeBytes - (bytesRead+octalCodeBytes));
|
theseBytesRead += readNodeData(bitstreamRootNode, bitstreamAt + octalCodeBytes,
|
||||||
|
bufferSizeBytes - (bytesRead + octalCodeBytes));
|
||||||
|
|
||||||
// skip bitstream to new startPoint
|
// skip bitstream to new startPoint
|
||||||
bitstreamAt += theseBytesRead;
|
bitstreamAt += theseBytesRead;
|
||||||
|
@ -266,16 +267,16 @@ void VoxelTree::deleteVoxelCodeFromTree(unsigned char *codeBuffer) {
|
||||||
if (0 == memcmp(nodeToDelete->octalCode,codeBuffer,lengthInBytes)) {
|
if (0 == memcmp(nodeToDelete->octalCode,codeBuffer,lengthInBytes)) {
|
||||||
|
|
||||||
float* vertices = firstVertexForCode(nodeToDelete->octalCode);
|
float* vertices = firstVertexForCode(nodeToDelete->octalCode);
|
||||||
delete []vertices;
|
delete[] vertices;
|
||||||
|
|
||||||
if (parentNode) {
|
if (parentNode) {
|
||||||
float* vertices = firstVertexForCode(parentNode->octalCode);
|
float* vertices = firstVertexForCode(parentNode->octalCode);
|
||||||
delete []vertices;
|
delete[] vertices;
|
||||||
|
|
||||||
int childNDX = branchIndexWithDescendant(parentNode->octalCode, codeBuffer);
|
int childIndex = branchIndexWithDescendant(parentNode->octalCode, codeBuffer);
|
||||||
|
|
||||||
delete parentNode->children[childNDX]; // delete the child nodes
|
delete parentNode->children[childIndex]; // delete the child nodes
|
||||||
parentNode->children[childNDX]=NULL; // set it to NULL
|
parentNode->children[childIndex] = NULL; // set it to NULL
|
||||||
|
|
||||||
reaverageVoxelColors(rootNode); // Fix our colors!! Need to call it on rootNode
|
reaverageVoxelColors(rootNode); // Fix our colors!! Need to call it on rootNode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue