This commit is contained in:
ZappoMan 2013-10-25 10:01:13 -07:00
commit 9e19bebda8
5 changed files with 18 additions and 8 deletions

View file

@ -531,7 +531,10 @@ void NodeList::sendDomainServerCheckIn() {
packetPosition += numBytesNodesOfInterest;
}
_nodeSocket.send(_domainIP.toString().toLocal8Bit().constData(), _domainPort, checkInPacket, packetPosition - checkInPacket);
_nodeSocket.send(_domainIP.toString().toLocal8Bit().constData(), _domainPort, checkInPacket,
packetPosition - checkInPacket);
delete[] checkInPacket; // clean up
const int NUM_DOMAIN_SERVER_CHECKINS_PER_STUN_REQUEST = 5;
static unsigned int numDomainCheckins = 0;

View file

@ -333,7 +333,7 @@ unsigned char* hexStringToOctalCode(const QString& input) {
// loop through the string - 2 bytes at a time converting
// it to decimal equivalent and store in byte array
bool ok;
bool ok = false;
while (stringIndex < input.length()) {
uint value = input.mid(stringIndex, HEX_BYTE_SIZE).toUInt(&ok, HEX_NUMBER_BASE);
if (!ok) {

View file

@ -205,7 +205,6 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
CoverageMapStorageResult result = NOT_STORED;
CoverageRegion* storeIn = &_remainder;
bool fitsInAHalf = false;
// Check each half of the box independently
const bool useRegions = true; // for now we will continue to use regions
@ -213,19 +212,15 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
if (_topHalf.contains(polygonBox)) {
result = _topHalf.checkRegion(polygon, polygonBox, storeIt);
storeIn = &_topHalf;
fitsInAHalf = true;
} else if (_bottomHalf.contains(polygonBox)) {
result = _bottomHalf.checkRegion(polygon, polygonBox, storeIt);
storeIn = &_bottomHalf;
fitsInAHalf = true;
} else if (_leftHalf.contains(polygonBox)) {
result = _leftHalf.checkRegion(polygon, polygonBox, storeIt);
storeIn = &_leftHalf;
fitsInAHalf = true;
} else if (_rightHalf.contains(polygonBox)) {
result = _rightHalf.checkRegion(polygon, polygonBox, storeIt);
storeIn = &_rightHalf;
fitsInAHalf = true;
}
}

View file

@ -324,20 +324,29 @@ VoxelNode* VoxelNode::getChildAtIndex(int childIndex) const {
VoxelNode* result = NULL;
int childCount = getChildCount();
#ifdef HAS_AUDIT_CHILDREN
const char* caseStr = NULL;
#endif
switch (childCount) {
case 0:
#ifdef HAS_AUDIT_CHILDREN
caseStr = "0 child case";
#endif
break;
case 1: {
#ifdef HAS_AUDIT_CHILDREN
caseStr = "1 child case";
#endif
int indexOne = getNthBit(_childBitmask, 1);
if (indexOne == childIndex) {
result = _children.single;
}
} break;
case 2: {
#ifdef HAS_AUDIT_CHILDREN
caseStr = "2 child case";
#endif
int indexOne = getNthBit(_childBitmask, 1);
int indexTwo = getNthBit(_childBitmask, 2);
@ -358,7 +367,9 @@ VoxelNode* VoxelNode::getChildAtIndex(int childIndex) const {
}
} break;
case 3: {
#ifdef HAS_AUDIT_CHILDREN
caseStr = "3 child case";
#endif
int indexOne = getNthBit(_childBitmask, 1);
int indexTwo = getNthBit(_childBitmask, 2);
int indexThree = getNthBit(_childBitmask, 3);
@ -386,7 +397,9 @@ VoxelNode* VoxelNode::getChildAtIndex(int childIndex) const {
}
} break;
default: {
#ifdef HAS_AUDIT_CHILDREN
caseStr = "default";
#endif
// if we have 4 or more, we know we're in external mode, so we just need to figure out which
// slot in our external array this child is.
if (oneAtBit(_childBitmask, childIndex)) {

View file

@ -1432,7 +1432,6 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
// write the child exist bits
*writeToThisLevelBuffer = childrenExistInPacketBits;
writeToThisLevelBuffer += sizeof(childrenExistInPacketBits); // move the pointer
bytesAtThisLevel += sizeof(childrenExistInPacketBits); // keep track of byte count
if (params.stats) {
params.stats->existsInPacketBitsWritten();