Changeset 2212 for code/branches/objecthierarchy2/src/orxonox/gamestates
- Timestamp:
- Nov 16, 2008, 7:10:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/gamestates/GSDedicated.cc
r2175 r2212 49 49 { 50 50 RegisterObject(GSDedicated); 51 51 52 52 this->setConfigValues(); 53 53 } … … 82 82 { 83 83 static int timeSinceLastTick = 0; // in microseconds 84 const int tickPeriod = 1000000. / this->tickrate_; // in microseconds85 84 const int tickPeriod = (int)(1000000.0f / this->tickrate_); // in microseconds 85 86 86 GSLevel::ticked(time); 87 87 88 88 timeSinceLastTick += time.getDeltaTimeMicroseconds(); 89 89 if ( timeSinceLastTick >= tickPeriod ) … … 96 96 { 97 97 unsigned int sleepTime; 98 98 99 99 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 100 100 if ( tickPeriod-timeSinceLastTick < MIN_WIN32_SLEEP_TIME ) 101 sleepTime = MIN_WIN32_SLEEP_TIME*1000000;101 sleepTime = (unsigned int)(MIN_WIN32_SLEEP_TIME * 1000000); 102 102 else 103 103 sleepTime = tickPeriod - timeSinceLastTick; 104 104 msleep( sleepTime / 1000 ); 105 105 106 106 #else /* unix */ 107 107 sleepTime = tickPeriod - timeSinceLastTick; 108 108 usleep( sleepTime ); 109 109 #endif 110 110 111 111 } 112 112 113 113 this->tickChild(time); 114 114 } 115 115 116 116 void GSDedicated::setConfigValues() 117 117 {
Note: See TracChangeset
for help on using the changeset viewer.