Showing the changes to interface/src/VoxelSystem.cpp (1 of 3 files). Show all
Unified · Split
| @@ -170,16 +170,16 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 169 unmodified lines | ||
| 170 | 170 | void VoxelSystem::setupNewVoxelsForDrawing() { |
| 171 | 171 | PerformanceWarning warn(_renderWarningsOn, "setupNewVoxelsForDrawing()"); // would like to include _voxelsInArrays, _voxelsUpdated |
| 172 | 172 | uint64_t start = usecTimestampNow(); |
| 173 | − int sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000; | |
| 173 | + uint64_t sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000; | |
| 174 | 174 | |
| 175 | 175 | bool iAmDebugging = false; // if you're debugging set this to true, so you won't get skipped for slow debugging |
| 176 | − if (!iAmDebugging && sinceLastTime <= std::max(_setupNewVoxelsForDrawingLastElapsed, SIXTY_FPS_IN_MILLISECONDS)) { | |
| 176 | + if (!iAmDebugging && sinceLastTime <= std::max((float) _setupNewVoxelsForDrawingLastElapsed, SIXTY_FPS_IN_MILLISECONDS)) { | |
| 177 | 177 | return; // bail early, it hasn't been long enough since the last time we ran |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | int sinceLastViewCulling = (start - _lastViewCulling) / 1000; |
| 181 | 181 | // If the view frustum is no longer changing, but has changed, since last time, then remove nodes that are out of view |
| 182 | − if ((sinceLastViewCulling >= std::max(_lastViewCullingElapsed, VIEW_CULLING_RATE_IN_MILLISECONDS)) | |
| 182 | + if ((sinceLastViewCulling >= std::max((float) _lastViewCullingElapsed, VIEW_CULLING_RATE_IN_MILLISECONDS)) | |
| 183 | 183 | && !isViewChanging() && hasViewChanged()) { |
| 184 | 184 | _lastViewCulling = start; |
| 185 | 185 | |