History

Converted double timestamps to long long (64 bit integers), fixed bug with updating agent timestamps.

Andrzej Kapolka committed 13 years ago

Commit db729a01 parent 677c2ee18 files · +99 −100Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+7−7
@@ -165,15 +165,15 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 164 unmodified lines
165165
166166 void VoxelSystem::setupNewVoxelsForDrawing() {
167167 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;
170170
171171 bool iAmDebugging = false; // if you're debugging set this to true, so you won't get skipped for slow debugging
172172 if (!iAmDebugging && sinceLastTime <= std::max(_setupNewVoxelsForDrawingLastElapsed, SIXTY_FPS_IN_MILLISECONDS)) {
173173 return; // bail early, it hasn't been long enough since the last time we ran
174174 }
175175
176− double sinceLastViewCulling = (start - _lastViewCulling) / 1000.0;
176+ long long sinceLastViewCulling = (start - _lastViewCulling) / 1000;
177177 // If the view frustum is no longer changing, but has changed, since last time, then remove nodes that are out of view
178178 if ((sinceLastViewCulling >= std::max(_lastViewCullingElapsed, VIEW_CULLING_RATE_IN_MILLISECONDS))
179179 && !isViewChanging() && hasViewChanged()) {
@@ -189,8 +189,8 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 9 unmodified lines
189189 // VBO reubuilding. Possibly we should do this only if our actual VBO usage crosses some lower boundary.
190190 cleanupRemovedVoxels();
191191
192− double endViewCulling = usecTimestampNow();
193− _lastViewCullingElapsed = (endViewCulling - start) / 1000.0;
192+ long long endViewCulling = usecTimestampNow();
193+ _lastViewCullingElapsed = (endViewCulling - start) / 1000;
194194 }
195195
196196 bool didWriteFullVBO = _writeRenderFullVBO;
@@ -226,8 +226,8 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 29 unmodified lines
226226
227227 pthread_mutex_unlock(&_bufferWriteLock);
228228
229− double end = usecTimestampNow();
230− double elapsedmsec = (end - start) / 1000.0;
229+ long long end = usecTimestampNow();
230+ long long elapsedmsec = (end - start) / 1000;
231231 _setupNewVoxelsForDrawingLastFinished = end;
232232 _setupNewVoxelsForDrawingLastElapsed = elapsedmsec;
233233 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t