cleanup bit field positions

This commit is contained in:
ZappoMan 2013-10-24 14:27:47 -07:00
parent f2229ae708
commit 0368e8c75e
3 changed files with 5 additions and 11 deletions

View file

@ -118,11 +118,8 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
setSemiNibbleAt(bitItems,KEY_STATE_START_BIT,_keyState);
// hand state
setSemiNibbleAt(bitItems,HAND_STATE_START_BIT,_handState);
*destinationBuffer++ = bitItems;
bitItems = 0;
// faceshift state
if (_headData->_isFaceshiftConnected) { setAtBit(bitItems, IS_FACESHIFT_CONNECTED); }
*destinationBuffer++ = bitItems;
// If it is connected, pack up the data
@ -249,7 +246,6 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
// hand state, stored as a semi-nibble in the bitItems
_handState = getSemiNibbleAt(bitItems,HAND_STATE_START_BIT);
bitItems = (unsigned char)*sourceBuffer++;
_headData->_isFaceshiftConnected = oneAtBit(bitItems, IS_FACESHIFT_CONNECTED);
// If it is connected, pack up the data

View file

@ -27,11 +27,9 @@
#include "HandData.h"
// First bitset
const int KEY_STATE_START_BIT = 3; // 4th and 5th bits
const int HAND_STATE_START_BIT = 5; // 6th and 7th bits
// Second bitset
const int IS_FACESHIFT_CONNECTED = 0;
const int KEY_STATE_START_BIT = 0; // 1st and 2nd bits
const int HAND_STATE_START_BIT = 2; // 3rd and 4th bits
const int IS_FACESHIFT_CONNECTED = 4; // 5th bit
const float MAX_AUDIO_LOUDNESS = 1000.0; // close enough for mouth animation

View file

@ -28,7 +28,7 @@
const int WANT_LOW_RES_MOVING_BIT = 0;
const int WANT_COLOR_AT_BIT = 1;
const int WANT_DELTA_AT_BIT = 2;
const int WANT_OCCLUSION_CULLING_BIT = 7; // 8th bit
const int WANT_OCCLUSION_CULLING_BIT = 3; // 4th bit
class VoxelQuery : public NodeData {
Q_OBJECT