Showing the changes to interface/src/main.cpp (1 of 3 files). Show all
Unified · Split
| @@ -130,6 +130,9 @@ glm::vec3 box(WORLD_SIZE,WORLD_SIZE,WORLD_SIZE); · 129 unmodified lines | |||
| 130 | 130 | ||
| 131 | VoxelSystem voxels; | 131 | VoxelSystem voxels; |
| 132 | 132 | ||
| 133 | bool wantToKillLocalVoxels = false; | ||
| 134 | |||
| 135 | |||
| 133 | #ifndef _WIN32 | 136 | #ifndef _WIN32 |
| 134 | Audio audio(&audioScope, &myAvatar); | 137 | Audio audio(&audioScope, &myAvatar); |
| 135 | #endif | 138 | #endif |
| @@ -1071,6 +1074,13 @@ int setFrustumRenderMode(int state) { · 935 unmodified lines | |||
| 1071 | return ::frustumDrawingMode; | 1074 | return ::frustumDrawingMode; |
| 1072 | } | 1075 | } |
| 1073 | 1076 | ||
| 1077 | int doKillLocalVoxels(int state) { | ||
| 1078 | if (state == MENU_ROW_PICKED) { | ||
| 1079 | ::wantToKillLocalVoxels = true; | ||
| 1080 | } | ||
| 1081 | return state; | ||
| 1082 | } | ||
| 1083 | |||
| 1074 | int doRandomizeVoxelColors(int state) { | 1084 | int 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 | // Debug | 1179 | // 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; |