History

debugging voxel sending behavior

ZappoMan committed 13 years ago

Commit 275772b1 parent 174c3ee3 files · +28 −2Browse files

Showing the changes to interface/src/main.cpp (1 of 3 files). Show all

Unified · Split

interface/src/main.cpp+17−0
@@ -130,6 +130,9 @@ glm::vec3 box(WORLD_SIZE,WORLD_SIZE,WORLD_SIZE); · 129 unmodified lines
130130
131131 VoxelSystem voxels;
132132
133+bool wantToKillLocalVoxels = false;
134+
135+
133136 #ifndef _WIN32
134137 Audio audio(&audioScope, &myAvatar);
135138 #endif
@@ -1071,6 +1074,13 @@ int setFrustumRenderMode(int state) { · 935 unmodified lines
10711074 return ::frustumDrawingMode;
10721075 }
10731076
1077+int doKillLocalVoxels(int state) {
1078+ if (state == MENU_ROW_PICKED) {
1079+ ::wantToKillLocalVoxels = true;
1080+ }
1081+ return state;
1082+}
1083+
10741084 int doRandomizeVoxelColors(int state) {
10751085 if (state == MENU_ROW_PICKED) {
10761086 ::voxels.randomizeVoxelColors();
@@ -1168,6 +1178,7 @@ void initMenu() { · 91 unmodified lines
11681178
11691179 // Debug
11701180 menuColumnDebug = menu.addColumn("Debug");
1181+ menuColumnDebug->addRow("Kill Local Voxels", doKillLocalVoxels);
11711182 menuColumnDebug->addRow("Randomize Voxel TRUE Colors", doRandomizeVoxelColors);
11721183 menuColumnDebug->addRow("FALSE Color Voxels Randomly", doFalseRandomizeVoxelColors);
11731184 menuColumnDebug->addRow("FALSE Color Voxels by Distance", doFalseColorizeByDistance);
@@ -1412,6 +1423,12 @@ void* networkReceive(void* args) · 238 unmodified lines
14121423 ssize_t bytesReceived;
14131424
14141425 while (!stopNetworkReceiveThread) {
1426+ // check to see if the UI thread asked us to kill the voxel tree. since we're the only thread allowed to do that
1427+ if (::wantToKillLocalVoxels) {
1428+ ::voxels.killLocalVoxels();
1429+ ::wantToKillLocalVoxels = false;
1430+ }
1431+
14151432 if (AgentList::getInstance()->getAgentSocket().receive(&senderAddress, incomingPacket, &bytesReceived)) {
14161433 packetCount++;
14171434 bytesCount += bytesReceived;