cleaned up some comments and code

This commit is contained in:
ZappoMan 2013-11-23 14:58:23 -08:00
parent 7ff7b13c6b
commit b0cc6494da
3 changed files with 6 additions and 11 deletions

View file

@ -116,14 +116,14 @@ bool VoxelPacket::appendBitMask(unsigned char bitmask) {
return success;
}
bool VoxelPacket::appendColor(rgbColor color) {
bool VoxelPacket::appendColor(const nodeColor& color) {
// eventually we can make this use a dictionary...
bool success = false;
const int BYTES_PER_COLOR = 3;
if (_bytesAvailable > BYTES_PER_COLOR) {
append(color[0]);
append(color[1]);
append(color[2]);
append(color[RED_INDEX]);
append(color[GREEN_INDEX]);
append(color[BLUE_INDEX]);
success = true;
}
return success;

View file

@ -59,7 +59,7 @@ public:
bool updatePriorBytes(int offset, const unsigned char* replacementBytes, int length);
/// appends a color to the end of the stream, may fail if new data stream is too long to fit in packet
bool appendColor(rgbColor color);
bool appendColor(const nodeColor& color);
/// returns a byte offset from beginning of the uncompressed stream based on offset from end.
/// Positive offsetFromEnd returns that many bytes before the end of uncompressed stream

View file

@ -1439,12 +1439,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node,
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
if (oneAtBit(childrenColoredBits, i)) {
VoxelNode* childNode = node->getChildAtIndex(i);
rgbColor color;
color[0] = childNode->getColor()[0];
color[1] = childNode->getColor()[1];
color[2] = childNode->getColor()[2];
continueThisLevel = packet->appendColor(color);
continueThisLevel = packet->appendColor(childNode->getColor());
if (!continueThisLevel) {
break; // no point in continuing