mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 12:19:54 +02:00
cleanup code
This commit is contained in:
parent
e8fd96018b
commit
edcc92cfb6
1 changed files with 0 additions and 14 deletions
|
@ -452,7 +452,6 @@ void VoxelTree::loadVoxelsFile(const char* fileName, bool wantColorRandomizer) {
|
||||||
bool bail = false;
|
bool bail = false;
|
||||||
while (!file.eof() && !bail) {
|
while (!file.eof() && !bail) {
|
||||||
file.get(octets);
|
file.get(octets);
|
||||||
//printLog("octets=%d...\n",octets);
|
|
||||||
totalBytesRead++;
|
totalBytesRead++;
|
||||||
lengthInBytes = bytesRequiredForCodeLength(octets) - 1;
|
lengthInBytes = bytesRequiredForCodeLength(octets) - 1;
|
||||||
unsigned char * voxelData = new unsigned char[lengthInBytes + 1 + 3];
|
unsigned char * voxelData = new unsigned char[lengthInBytes + 1 + 3];
|
||||||
|
@ -837,7 +836,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
const ViewFrustum* viewFrustum, bool includeColor, bool includeExistsBits,
|
const ViewFrustum* viewFrustum, bool includeColor, bool includeExistsBits,
|
||||||
bool deltaViewFrustum, const ViewFrustum* lastViewFrustum) const {
|
bool deltaViewFrustum, const ViewFrustum* lastViewFrustum) const {
|
||||||
|
|
||||||
//printLog("encodeTreeBitstreamRecursion() currentEncodeLevel=%d\n",currentEncodeLevel);
|
|
||||||
// How many bytes have we written so far at this level;
|
// How many bytes have we written so far at this level;
|
||||||
int bytesAtThisLevel = 0;
|
int bytesAtThisLevel = 0;
|
||||||
|
|
||||||
|
@ -897,7 +895,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
|
|
||||||
// if the caller wants to include childExistsBits, then include them even if not in view
|
// if the caller wants to include childExistsBits, then include them even if not in view
|
||||||
if (includeExistsBits && childNode) {
|
if (includeExistsBits && childNode) {
|
||||||
//printLog("includeExistsBits, calculating exists bits\n");
|
|
||||||
childrenExistInTreeBits += (1 << (7 - i));
|
childrenExistInTreeBits += (1 << (7 - i));
|
||||||
if (childNode->isColored()) {
|
if (childNode->isColored()) {
|
||||||
colorsExistInTreeBits += (1 << (7 - i));
|
colorsExistInTreeBits += (1 << (7 - i));
|
||||||
|
@ -938,14 +935,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
bytesAtThisLevel += sizeof(childrenColoredBits); // keep track of byte count
|
bytesAtThisLevel += sizeof(childrenColoredBits); // keep track of byte count
|
||||||
// if the caller wants to include childExistsBits, then include them even if not in view
|
// if the caller wants to include childExistsBits, then include them even if not in view
|
||||||
if (includeExistsBits) {
|
if (includeExistsBits) {
|
||||||
//printLog("includeExistsBits, writing color exists bits...\n");
|
|
||||||
//printLog("childrenColoredBits=");
|
|
||||||
//outputBits(childrenColoredBits);
|
|
||||||
//printLog(" colorsExistInTreeBits=");
|
|
||||||
//outputBits(colorsExistInTreeBits);
|
|
||||||
//printLog(" childrenExistInTreeBits=");
|
|
||||||
//outputBits(childrenExistInTreeBits);
|
|
||||||
|
|
||||||
*writeToThisLevelBuffer = colorsExistInTreeBits;
|
*writeToThisLevelBuffer = colorsExistInTreeBits;
|
||||||
writeToThisLevelBuffer += sizeof(colorsExistInTreeBits); // move the pointer
|
writeToThisLevelBuffer += sizeof(colorsExistInTreeBits); // move the pointer
|
||||||
bytesAtThisLevel += sizeof(colorsExistInTreeBits); // keep track of byte count
|
bytesAtThisLevel += sizeof(colorsExistInTreeBits); // keep track of byte count
|
||||||
|
@ -965,7 +954,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
// if the caller wants to include childExistsBits, then include them even if not in view, put them before the
|
// if the caller wants to include childExistsBits, then include them even if not in view, put them before the
|
||||||
// childrenExistInPacketBits, so that the lower code can properly repair the packet exists bits
|
// childrenExistInPacketBits, so that the lower code can properly repair the packet exists bits
|
||||||
if (includeExistsBits) {
|
if (includeExistsBits) {
|
||||||
//printLog("includeExistsBits, writing subtree exists bits\n");
|
|
||||||
*writeToThisLevelBuffer = childrenExistInTreeBits;
|
*writeToThisLevelBuffer = childrenExistInTreeBits;
|
||||||
writeToThisLevelBuffer += sizeof(childrenExistInTreeBits); // move the pointer
|
writeToThisLevelBuffer += sizeof(childrenExistInTreeBits); // move the pointer
|
||||||
bytesAtThisLevel += sizeof(childrenExistInTreeBits); // keep track of byte count
|
bytesAtThisLevel += sizeof(childrenExistInTreeBits); // keep track of byte count
|
||||||
|
@ -1032,7 +1020,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
// we can make this act like no bytes out, by just resetting the bytes out in this case
|
// we can make this act like no bytes out, by just resetting the bytes out in this case
|
||||||
if (includeColor && childTreeBytesOut == 2) {
|
if (includeColor && childTreeBytesOut == 2) {
|
||||||
childTreeBytesOut = 0; // this is the degenerate case of a tree with no colors and no child trees
|
childTreeBytesOut = 0; // this is the degenerate case of a tree with no colors and no child trees
|
||||||
//printLog("childTreeBytesOut==2.... lopping empty lower tree\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bytesAtThisLevel += childTreeBytesOut;
|
bytesAtThisLevel += childTreeBytesOut;
|
||||||
|
@ -1042,7 +1029,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
|
||||||
// If we had previously started writing, and if the child DIDN'T write any bytes,
|
// If we had previously started writing, and if the child DIDN'T write any bytes,
|
||||||
// then we want to remove their bit from the childExistsPlaceHolder bitmask
|
// then we want to remove their bit from the childExistsPlaceHolder bitmask
|
||||||
if (childTreeBytesOut == 0) {
|
if (childTreeBytesOut == 0) {
|
||||||
//printLog("childTreeBytesOut == 0... actually lopping empty lower tree\n");
|
|
||||||
// remove this child's bit...
|
// remove this child's bit...
|
||||||
childrenExistInPacketBits -= (1 << (7 - i));
|
childrenExistInPacketBits -= (1 << (7 - i));
|
||||||
// repair the child exists mask
|
// repair the child exists mask
|
||||||
|
|
Loading…
Reference in a new issue