History

switch usec timestamps to uint64_t

Stephen Birarda committed 13 years ago

Commit ca8f2591 parent 9ba3bfc20 files · +58 −57Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 20 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+6−6
@@ -168,15 +168,15 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 167 unmodified lines
168168
169169 void VoxelSystem::setupNewVoxelsForDrawing() {
170170 PerformanceWarning warn(_renderWarningsOn, "setupNewVoxelsForDrawing()"); // would like to include _voxelsInArrays, _voxelsUpdated
171− long long start = usecTimestampNow();
172− long long sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000;
171+ uint64_t start = usecTimestampNow();
172+ int sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000;
173173
174174 bool iAmDebugging = false; // if you're debugging set this to true, so you won't get skipped for slow debugging
175175 if (!iAmDebugging && sinceLastTime <= std::max(_setupNewVoxelsForDrawingLastElapsed, SIXTY_FPS_IN_MILLISECONDS)) {
176176 return; // bail early, it hasn't been long enough since the last time we ran
177177 }
178178
179− long long sinceLastViewCulling = (start - _lastViewCulling) / 1000;
179+ int sinceLastViewCulling = (start - _lastViewCulling) / 1000;
180180 // If the view frustum is no longer changing, but has changed, since last time, then remove nodes that are out of view
181181 if ((sinceLastViewCulling >= std::max(_lastViewCullingElapsed, VIEW_CULLING_RATE_IN_MILLISECONDS))
182182 && !isViewChanging() && hasViewChanged()) {
@@ -192,7 +192,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 9 unmodified lines
192192 // VBO reubuilding. Possibly we should do this only if our actual VBO usage crosses some lower boundary.
193193 cleanupRemovedVoxels();
194194
195− long long endViewCulling = usecTimestampNow();
195+ uint64_t endViewCulling = usecTimestampNow();
196196 _lastViewCullingElapsed = (endViewCulling - start) / 1000;
197197 }
198198
@@ -229,8 +229,8 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 30 unmodified lines
229229
230230 pthread_mutex_unlock(&_bufferWriteLock);
231231
232− long long end = usecTimestampNow();
233− long long elapsedmsec = (end - start) / 1000;
232+ uint64_t end = usecTimestampNow();
233+ int elapsedmsec = (end - start) / 1000;
234234 _setupNewVoxelsForDrawingLastFinished = end;
235235 _setupNewVoxelsForDrawingLastElapsed = elapsedmsec;
236236 }