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
130 130
131VoxelSystem voxels;131VoxelSystem voxels;
132 132
133bool wantToKillLocalVoxels = false;
134
135
133#ifndef _WIN32136#ifndef _WIN32
134Audio audio(&audioScope, &myAvatar);137Audio audio(&audioScope, &myAvatar);
135#endif138#endif
@@ -1071,6 +1074,13 @@ int setFrustumRenderMode(int state) { · 935 unmodified lines
1071 return ::frustumDrawingMode;1074 return ::frustumDrawingMode;
1072}1075}
1073 1076
1077int doKillLocalVoxels(int state) {
1078 if (state == MENU_ROW_PICKED) {
1079 ::wantToKillLocalVoxels = true;
1080 }
1081 return state;
1082}
1083
1074int doRandomizeVoxelColors(int state) {1084int doRandomizeVoxelColors(int state) {
1075 if (state == MENU_ROW_PICKED) {1085 if (state == MENU_ROW_PICKED) {
1076 ::voxels.randomizeVoxelColors();1086 ::voxels.randomizeVoxelColors();
@@ -1168,6 +1178,7 @@ void initMenu() { · 91 unmodified lines
1168 1178
1169 // Debug1179 // Debug
1170 menuColumnDebug = menu.addColumn("Debug");1180 menuColumnDebug = menu.addColumn("Debug");
1181 menuColumnDebug->addRow("Kill Local Voxels", doKillLocalVoxels);
1171 menuColumnDebug->addRow("Randomize Voxel TRUE Colors", doRandomizeVoxelColors);1182 menuColumnDebug->addRow("Randomize Voxel TRUE Colors", doRandomizeVoxelColors);
1172 menuColumnDebug->addRow("FALSE Color Voxels Randomly", doFalseRandomizeVoxelColors);1183 menuColumnDebug->addRow("FALSE Color Voxels Randomly", doFalseRandomizeVoxelColors);
1173 menuColumnDebug->addRow("FALSE Color Voxels by Distance", doFalseColorizeByDistance);1184 menuColumnDebug->addRow("FALSE Color Voxels by Distance", doFalseColorizeByDistance);
@@ -1412,6 +1423,12 @@ void* networkReceive(void* args) · 238 unmodified lines
1412 ssize_t bytesReceived;1423 ssize_t bytesReceived;
1413 1424
1414 while (!stopNetworkReceiveThread) {1425 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
1415 if (AgentList::getInstance()->getAgentSocket().receive(&senderAddress, incomingPacket, &bytesReceived)) {1432 if (AgentList::getInstance()->getAgentSocket().receive(&senderAddress, incomingPacket, &bytesReceived)) {
1416 packetCount++;1433 packetCount++;
1417 bytesCount += bytesReceived;1434 bytesCount += bytesReceived;