mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 14:13:47 +02:00
removed some debug code
This commit is contained in:
parent
e4c39369aa
commit
2f2af7ec09
1 changed files with 0 additions and 87 deletions
|
@ -741,91 +741,4 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) {
|
|||
tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation,(void*)viewFrustum);
|
||||
printf("setting in distance false color for %d nodes\n",_nodeCount);
|
||||
setupNewVoxelsForDrawing();
|
||||
|
||||
|
||||
printf("--------- DEBUG TESTING ------------\n");
|
||||
//const int MAX_VOXEL_PACKET_SIZE=13; // test tight fit...
|
||||
unsigned char* tempOutputBuffer = new unsigned char[MAX_VOXEL_PACKET_SIZE];
|
||||
unsigned char* finalOutputBuffer = new unsigned char[MAX_VOXEL_PACKET_SIZE];
|
||||
unsigned char* finalOutputBufferAt = finalOutputBuffer;
|
||||
int availableInFinal = MAX_VOXEL_PACKET_SIZE;
|
||||
int bytesWritten = 0;
|
||||
int totalBytesWritten = 0;
|
||||
int totalPackets = 0;
|
||||
|
||||
VoxelNodeBag bagOfTrees;
|
||||
|
||||
// stick a "V" in the finalOutputBuffer
|
||||
finalOutputBuffer[0] = 'V';
|
||||
finalOutputBufferAt++;
|
||||
availableInFinal = MAX_VOXEL_PACKET_SIZE-1;
|
||||
|
||||
//bytesWritten = tree->encodeTreeBitstream(tree->rootNode, *viewFrustum, outputBuffer, MAX_VOXEL_PACKET_SIZE, bagOfTrees);
|
||||
//totalBytesWritten += bytesWritten;
|
||||
//printf("--------- initial results ---- bytesWritten=%d ------------\n",bytesWritten);
|
||||
//outputBufferBits(finalOutputBuffer, bytesWritten, true);
|
||||
//printf("--------- DONE initial results ------------\n");
|
||||
|
||||
printf("--------- searchForColoredNodes() ------------\n");
|
||||
tree->searchForColoredNodes(tree->rootNode, *viewFrustum, bagOfTrees);
|
||||
printf("--------- DONE searchForColoredNodes() ------------\n");
|
||||
|
||||
printf("--------- bag of trees ------------\n");
|
||||
printf("bagOfTrees.count()=%d\n",bagOfTrees.count());
|
||||
|
||||
int countOfTrees = 0;
|
||||
bool finalOutputBufferWaiting = false;
|
||||
while (!bagOfTrees.isEmpty()) {
|
||||
countOfTrees++;
|
||||
VoxelNode* extraTree = bagOfTrees.extract();
|
||||
printf("processing countOfTrees=%d\n", countOfTrees);
|
||||
|
||||
// Only let this guy create at largest packets equal to the amount of space we have left in our final???
|
||||
// Or let it create the largest possible size (minus 1 for the "V")
|
||||
bytesWritten = tree->encodeTreeBitstream(extraTree, *viewFrustum, tempOutputBuffer, MAX_VOXEL_PACKET_SIZE-1, bagOfTrees);
|
||||
|
||||
printf("this tree size=%d\n", bytesWritten);
|
||||
|
||||
// if we have room in our final packet, add this buffer to the final packet
|
||||
if (availableInFinal >= bytesWritten) {
|
||||
memcpy(finalOutputBufferAt, tempOutputBuffer, bytesWritten);
|
||||
availableInFinal -= bytesWritten;
|
||||
finalOutputBufferAt += bytesWritten;
|
||||
finalOutputBufferWaiting = true;
|
||||
} else {
|
||||
// otherwise "send" the packet!
|
||||
int sizeOfFinal = MAX_VOXEL_PACKET_SIZE - availableInFinal;
|
||||
|
||||
totalBytesWritten += sizeOfFinal;
|
||||
totalPackets++;
|
||||
printf("---- voxel packet ---- sizeOfFinal=%d totalPackets=%d ----\n",sizeOfFinal,totalPackets);
|
||||
//outputBufferBits(finalOutputBuffer, sizeOfFinal, true);
|
||||
printf("---- DONE voxel packet ------------\n");
|
||||
|
||||
// reset our finalOutputBuffer (keep the 'V')
|
||||
finalOutputBufferAt = &finalOutputBuffer[1];
|
||||
availableInFinal = MAX_VOXEL_PACKET_SIZE - 1;
|
||||
finalOutputBufferWaiting = false;
|
||||
|
||||
// we also need to stick the last created packet in here!!
|
||||
memcpy(finalOutputBufferAt, tempOutputBuffer, bytesWritten);
|
||||
availableInFinal -= bytesWritten;
|
||||
finalOutputBufferAt += bytesWritten;
|
||||
finalOutputBufferWaiting = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (finalOutputBufferWaiting) {
|
||||
// otherwise "send" the packet!
|
||||
int sizeOfFinal = MAX_VOXEL_PACKET_SIZE - availableInFinal;
|
||||
|
||||
totalBytesWritten += sizeOfFinal;
|
||||
totalPackets++;
|
||||
printf("---- voxel packet ---- sizeOfFinal=%d totalPackets=%d ----\n",sizeOfFinal,totalPackets);
|
||||
//outputBufferBits(finalOutputBuffer, sizeOfFinal, true);
|
||||
printf("---- DONE voxel packet ------------\n");
|
||||
}
|
||||
|
||||
printf("--- DONE DEBUG TESTING --- countOfTrees=%d totalBytesWritten=%d totalPackets=%d ------\n",
|
||||
countOfTrees, totalBytesWritten,totalPackets);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue