Showing the changes to interface/src/VoxelSystem.cpp (1 of 18 files). Show all
Unified · Split
| @@ -165,15 +165,15 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 164 unmodified lines | ||
| 165 | 165 | |
| 166 | 166 | void VoxelSystem::setupNewVoxelsForDrawing() { |
| 167 | 167 | PerformanceWarning warn(_renderWarningsOn, "setupNewVoxelsForDrawing()"); // would like to include _voxelsInArrays, _voxelsUpdated |
| 168 | − double start = usecTimestampNow(); | |
| 169 | − double sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000.0; | |
| 168 | + long long start = usecTimestampNow(); | |
| 169 | + long long sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000; | |
| 170 | 170 | |
| 171 | 171 | bool iAmDebugging = false; // if you're debugging set this to true, so you won't get skipped for slow debugging |
| 172 | 172 | if (!iAmDebugging && sinceLastTime <= std::max(_setupNewVoxelsForDrawingLastElapsed, SIXTY_FPS_IN_MILLISECONDS)) { |
| 173 | 173 | return; // bail early, it hasn't been long enough since the last time we ran |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | − double sinceLastViewCulling = (start - _lastViewCulling) / 1000.0; | |
| 176 | + long long sinceLastViewCulling = (start - _lastViewCulling) / 1000; | |
| 177 | 177 | // If the view frustum is no longer changing, but has changed, since last time, then remove nodes that are out of view |
| 178 | 178 | if ((sinceLastViewCulling >= std::max(_lastViewCullingElapsed, VIEW_CULLING_RATE_IN_MILLISECONDS)) |
| 179 | 179 | && !isViewChanging() && hasViewChanged()) { |
| @@ -189,8 +189,8 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 9 unmodified lines | ||
| 189 | 189 | // VBO reubuilding. Possibly we should do this only if our actual VBO usage crosses some lower boundary. |
| 190 | 190 | cleanupRemovedVoxels(); |
| 191 | 191 | |
| 192 | − double endViewCulling = usecTimestampNow(); | |
| 193 | − _lastViewCullingElapsed = (endViewCulling - start) / 1000.0; | |
| 192 | + long long endViewCulling = usecTimestampNow(); | |
| 193 | + _lastViewCullingElapsed = (endViewCulling - start) / 1000; | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | bool didWriteFullVBO = _writeRenderFullVBO; |
| @@ -226,8 +226,8 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 29 unmodified lines | ||
| 226 | 226 | |
| 227 | 227 | pthread_mutex_unlock(&_bufferWriteLock); |
| 228 | 228 | |
| 229 | − double end = usecTimestampNow(); | |
| 230 | − double elapsedmsec = (end - start) / 1000.0; | |
| 229 | + long long end = usecTimestampNow(); | |
| 230 | + long long elapsedmsec = (end - start) / 1000; | |
| 231 | 231 | _setupNewVoxelsForDrawingLastFinished = end; |
| 232 | 232 | _setupNewVoxelsForDrawingLastElapsed = elapsedmsec; |
| 233 | 233 | } |