Changeset 6502 for code/trunk/src/libraries/core/Game.cc
- Timestamp:
- Mar 11, 2010, 11:34:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Game.cc
r6422 r6502 284 284 uint64_t currentTime = gameClock_->getMicroseconds(); 285 285 uint64_t currentRealTime = gameClock_->getRealMicroseconds(); 286 this->statisticsTickTimes_.back().tickLength += currentRealTime - currentTime;287 this->periodTickTime_ += currentRealTime - currentTime;286 this->statisticsTickTimes_.back().tickLength += (uint32_t)(currentRealTime - currentTime); 287 this->periodTickTime_ += (uint32_t)(currentRealTime - currentTime); 288 288 if (this->periodTime_ > this->statisticsRefreshCycle_) 289 289 { … … 318 318 while (currentRealTime < nextTime - minimumSleepTime_) 319 319 { 320 usleep( nextTime - currentRealTime);320 usleep((unsigned long)(nextTime - currentRealTime)); 321 321 currentRealTime = gameClock_->getRealMicroseconds(); 322 322 } 323 323 // Integrate excess to avoid steady state error 324 excessSleepTime_ = currentRealTime - nextTime;324 excessSleepTime_ = (int)(currentRealTime - nextTime); 325 325 // Anti windup 326 326 if (excessSleepTime_ > 50000) // 20ms is about the maximum time Windows would sleep for too long
Note: See TracChangeset
for help on using the changeset viewer.