Showing the changes to interface/src/VoxelSystem.cpp (1 of 2 files). Show all
Unified · Split
| @@ -40,8 +40,6 @@ VoxelSystem::VoxelSystem() { · 39 unmodified lines | ||
| 40 | 40 | voxelsRendered = 0; |
| 41 | 41 | tree = new VoxelTree(); |
| 42 | 42 | pthread_mutex_init(&bufferWriteLock, NULL); |
| 43 | − lastBufferCopy.tv_sec = 0; | |
| 44 | − lastBufferCopy.tv_usec = 0; | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | 45 | VoxelSystem::~VoxelSystem() { |
| @@ -233,9 +231,7 @@ void VoxelSystem::render() { · 185 unmodified lines | ||
| 233 | 231 | |
| 234 | 232 | glPushMatrix(); |
| 235 | 233 | |
| 236 | − double timeSinceLastDraw = usecTimestampNow() - usecTimestamp(&lastBufferCopy); | |
| 237 | − if (readVerticesEndPointer != readVerticesArray && timeSinceLastDraw >= 500 * 1000) { | |
| 238 | − printf("The time since the last draw was %f\n", timeSinceLastDraw); | |
| 234 | + if (readVerticesEndPointer != readVerticesArray) { | |
| 239 | 235 | // try to lock on the buffer write |
| 240 | 236 | // just avoid pulling new data if it is currently being written |
| 241 | 237 | if (pthread_mutex_trylock(&bufferWriteLock) == 0) { |
| @@ -252,8 +248,6 @@ void VoxelSystem::render() { · 10 unmodified lines | ||
| 252 | 248 | |
| 253 | 249 | pthread_mutex_unlock(&bufferWriteLock); |
| 254 | 250 | } |
| 255 | − | |
| 256 | − gettimeofday(&lastBufferCopy, NULL); | |
| 257 | 251 | } |
| 258 | 252 | |
| 259 | 253 | // tell OpenGL where to find vertex and color information |