From 4f9c7fed59da00933a304c0d1e7175ac30f57e46 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 21 May 2013 11:25:50 -0700 Subject: [PATCH] removed UI for want exists bits, defaults to true --- interface/src/Application.cpp | 6 ------ interface/src/Application.h | 1 - interface/src/VoxelSystem.cpp | 5 ++--- interface/src/VoxelSystem.h | 6 ------ libraries/avatars/src/AvatarData.cpp | 5 +---- libraries/avatars/src/AvatarData.h | 4 ---- libraries/voxels/src/VoxelTree.h | 2 ++ voxel-server/src/main.cpp | 4 ++-- 8 files changed, 7 insertions(+), 26 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3c565d5eea..68237bf63f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1116,11 +1116,6 @@ void Application::setWantsResIn(bool wantsResIn) { _myAvatar.setWantResIn(wantsResIn); } -void Application::setWantsExistsBits(bool wantsExistsBits) { - _myAvatar.setWantExistsBits(wantsExistsBits); - _voxels.setWantExistsBits(wantsExistsBits); -} - void Application::setWantsDelta(bool wantsDelta) { _myAvatar.setWantDelta(wantsDelta); } @@ -1283,7 +1278,6 @@ void Application::initMenu() { debugMenu->addAction("Wants Res-In", this, SLOT(setWantsResIn(bool)))->setCheckable(true); debugMenu->addAction("Wants Monochrome", this, SLOT(setWantsMonochrome(bool)))->setCheckable(true); debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true); - debugMenu->addAction("Wants Exists Bits", this, SLOT(setWantsExistsBits(bool)), Qt::CTRL | Qt::Key_M)->setCheckable(true); } void Application::updateFrustumRenderModeAction() { diff --git a/interface/src/Application.h b/interface/src/Application.h index 95f448d120..dae7f8d71b 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -90,7 +90,6 @@ private slots: void doTreeStats(); void setWantsMonochrome(bool wantsMonochrome); void setWantsResIn(bool wantsResIn); - void setWantsExistsBits(bool wantsExistsBits); void setWantsDelta(bool wantsDelta); void updateVoxelModeActions(); void addVoxelInFrontOfAvatar(); diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 5ead332fbf..e6d27a3921 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -106,14 +106,14 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { { PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()"); // ask the VoxelTree to read the bitstream into the tree - _tree->readBitstreamToTree(voxelData, numBytes - 1, true, _wantsExistBits); + _tree->readBitstreamToTree(voxelData, numBytes - 1, true, WANT_EXISTS_BITS); } break; case PACKET_HEADER_VOXEL_DATA_MONOCHROME: { PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()"); // ask the VoxelTree to read the MONOCHROME bitstream into the tree - _tree->readBitstreamToTree(voxelData, numBytes - 1, false, _wantsExistBits); + _tree->readBitstreamToTree(voxelData, numBytes - 1, false, WANT_EXISTS_BITS); } break; case PACKET_HEADER_Z_COMMAND: @@ -424,7 +424,6 @@ int VoxelSystem::updateNodeInArraysAsPartialVBO(VoxelNode* node) { void VoxelSystem::init() { - _wantsExistBits = false; _renderWarningsOn = false; _callsToTreesToArrays = 0; _setupNewVoxelsForDrawingLastFinished = 0; diff --git a/interface/src/VoxelSystem.h b/interface/src/VoxelSystem.h index 9997444d37..316ed46f67 100644 --- a/interface/src/VoxelSystem.h +++ b/interface/src/VoxelSystem.h @@ -79,10 +79,6 @@ public: void createLine(glm::vec3 point1, glm::vec3 point2, float unitSize, rgbColor color, bool destructive = false); void createSphere(float r,float xc, float yc, float zc, float s, bool solid, creationMode mode, bool destructive = false, bool debug = false); - - void setWantExistsBits(bool on) { _wantsExistBits = on; }; - bool getWantExistsBits() const { return _wantsExistBits; }; - private: // disallow copying of VoxelSystem objects VoxelSystem(const VoxelSystem&); @@ -157,8 +153,6 @@ private: bool _voxelsDirty; - bool _wantsExistBits; - public: void updateVBOs(); void updateFullVBOs(); // all voxels in the VBO diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index b6e8c4be6a..ad969853e1 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -57,8 +57,7 @@ AvatarData::AvatarData() : _keyState(NO_KEY_DOWN), _wantResIn(false), _wantColor(true), - _wantDelta(false), - _wantExistsBits(false) + _wantDelta(false) { }; @@ -137,7 +136,6 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) { if (_wantResIn) { setAtBit(wantItems,WANT_RESIN_AT_BIT); } if (_wantColor) { setAtBit(wantItems,WANT_COLOR_AT_BIT); } if (_wantDelta) { setAtBit(wantItems,WANT_DELTA_AT_BIT); } - if (_wantExistsBits) { setAtBit(wantItems,WANT_EXISTS_BITS_BIT); } *destinationBuffer++ = wantItems; return destinationBuffer - bufferStart; @@ -224,7 +222,6 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) { _wantResIn = oneAtBit(wantItems,WANT_RESIN_AT_BIT); _wantColor = oneAtBit(wantItems,WANT_COLOR_AT_BIT); _wantDelta = oneAtBit(wantItems,WANT_DELTA_AT_BIT); - _wantExistsBits = oneAtBit(wantItems,WANT_EXISTS_BITS_BIT); return sourceBuffer - startPosition; } diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 41335c33fe..c961ff596a 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -18,7 +18,6 @@ const int WANT_RESIN_AT_BIT = 0; const int WANT_COLOR_AT_BIT = 1; const int WANT_DELTA_AT_BIT = 2; -const int WANT_EXISTS_BITS_BIT = 4; enum KeyState { @@ -105,11 +104,9 @@ public: bool getWantResIn() const { return _wantResIn; } bool getWantColor() const { return _wantColor; } bool getWantDelta() const { return _wantDelta; } - bool getWantExistsBits() const { return _wantExistsBits; } void setWantResIn(bool wantResIn) { _wantResIn = wantResIn; } void setWantColor(bool wantColor) { _wantColor = wantColor; } void setWantDelta(bool wantDelta) { _wantDelta = wantDelta; } - void setWantExistsBits(bool wantExistsBits) { _wantExistsBits = wantExistsBits; } protected: // privatize the copy constructor and assignment operator so they cannot be called @@ -161,7 +158,6 @@ protected: bool _wantResIn; bool _wantColor; bool _wantDelta; - bool _wantExistsBits; }; #endif /* defined(__hifi__AvatarData__) */ diff --git a/libraries/voxels/src/VoxelTree.h b/libraries/voxels/src/VoxelTree.h index c4a5631abf..b2b50da169 100644 --- a/libraries/voxels/src/VoxelTree.h +++ b/libraries/voxels/src/VoxelTree.h @@ -19,6 +19,8 @@ typedef bool (*RecurseVoxelTreeOperation)(VoxelNode* node, void* extraData); typedef enum {GRADIENT, RANDOM, NATURAL} creationMode; +#define WANT_EXISTS_BITS true + class VoxelTree { public: // when a voxel is created in the tree (object new'd) diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index e5d70567ca..a55e415e50 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -168,7 +168,7 @@ void resInVoxelDistributor(AgentList* agentList, bytesWritten = randomTree.encodeTreeBitstream(agentData->getMaxSearchLevel(), subTree, &tempOutputBuffer[0], MAX_VOXEL_PACKET_SIZE - 1, agentData->nodeBag, &viewFrustum, - agentData->getWantColor(),agentData->getWantExistsBits()); + agentData->getWantColor(),WANT_EXISTS_BITS); if (agentData->getAvailable() >= bytesWritten) { agentData->writeToPacket(&tempOutputBuffer[0], bytesWritten); @@ -306,7 +306,7 @@ printf("huh... bag STILL empty, what to do? Add the root?...\n"); bytesWritten = randomTree.encodeTreeBitstream(INT_MAX, subTree, &tempOutputBuffer[0], MAX_VOXEL_PACKET_SIZE - 1, agentData->nodeBag, &agentData->getCurrentViewFrustum(), - agentData->getWantColor(), agentData->getWantExistsBits(), + agentData->getWantColor(), WANT_EXISTS_BITS, wantDelta, lastViewFrustum); if (agentData->getAvailable() >= bytesWritten) {