Changeset 3192 for code/branches/pch/src/core
- Timestamp:
- Jun 18, 2009, 10:00:15 AM (16 years ago)
- Location:
- code/branches/pch/src/core
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/core/Clock.cc
r1755 r3192 57 57 tickTime_ = storedTime_ + timersTime; 58 58 tickDt_ = timersTime - lastTimersTime_; 59 tickDtFloat_ = (float)tickDt_ / 1000000.0f;59 tickDtFloat_ = static_cast<float>(tickDt_ / 1000000.0f); 60 60 61 61 if (timersTime > 0x7FFFFFF0) -
code/branches/pch/src/core/Clock.h
r2896 r3192 39 39 40 40 #include "CorePrereqs.h" 41 #include <OgrePrerequisites.h>41 #include "util/OgreForwardRefs.h" 42 42 43 43 namespace orxonox … … 53 53 unsigned long long getMicroseconds() const { return tickTime_; } 54 54 unsigned long long getMilliseconds() const { return tickTime_ / 1000; } 55 int getSeconds() const { return tickTime_ / 1000000; }56 float getSecondsPrecise() const { return (float)tickTime_ / 1000000.0f; }55 unsigned long getSeconds() const { return static_cast<long> (tickTime_ / 1000000); } 56 float getSecondsPrecise() const { return static_cast<float>(tickTime_ / 1000000.0f); } 57 57 58 58 float getDeltaTime() const { return tickDtFloat_; } 59 intgetDeltaTimeMicroseconds() const { return tickDt_; }59 long getDeltaTimeMicroseconds() const { return tickDt_; } 60 60 61 61 unsigned long long getRealMicroseconds() const; … … 67 67 unsigned long long storedTime_; 68 68 unsigned long long tickTime_; 69 inttickDt_;69 long tickDt_; 70 70 float tickDtFloat_; 71 71 unsigned long lastTimersTime_; -
code/branches/pch/src/core/ConsoleCommandCompilation.cc
r3154 r3192 170 170 COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << "'" << std::endl; 171 171 } 172 return expr.getResult();172 return static_cast<float>(expr.getResult()); 173 173 } 174 174 else -
code/branches/pch/src/core/Core.cc
r3166 r3192 367 367 if (!bInitialized && this->bInitializeRandomNumberGenerator_) 368 368 { 369 srand( time(0));369 srand(static_cast<unsigned int>(time(0))); 370 370 rand(); 371 371 bInitialized = true; -
code/branches/pch/src/core/Game.cc
r3154 r3192 190 190 191 191 if ((*it)->getCountTickTime()) 192 this->addTickTime( this->gameClock_->getRealMicroseconds() - timeBeforeTick);192 this->addTickTime(static_cast<uint32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick)); 193 193 } 194 194 … … 212 212 213 213 uint32_t framesPerPeriod = this->statisticsTickTimes_.size(); 214 this->avgFPS_ = (float)framesPerPeriod / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0;215 this->avgTickTime_ = (float)this->periodTickTime_ / framesPerPeriod / 1000.0;214 this->avgFPS_ = static_cast<float>(framesPerPeriod) / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0f; 215 this->avgTickTime_ = static_cast<float>(this->periodTickTime_) / framesPerPeriod / 1000.0f; 216 216 217 217 this->periodTime_ -= this->statisticsRefreshCycle_; -
code/branches/pch/src/core/input/InputManager.cc
r3187 r3192 1166 1166 else 1167 1167 { 1168 float fValue = value - joyStickCalibrations_[iJoyStick].middleValue[axis];1168 float fValue = static_cast<float>(value - joyStickCalibrations_[iJoyStick].middleValue[axis]); 1169 1169 if (fValue > 0.0f) 1170 1170 fValue *= joyStickCalibrations_[iJoyStick].positiveCoeff[axis]; -
code/branches/pch/src/core/input/KeyBinder.cc
r3148 r3192 317 317 { 318 318 mouseAxes_[2*i + 0].absVal_ 319 = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;319 = -mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_; 320 320 mouseAxes_[2*i + 1].absVal_ = 0.0f; 321 321 } … … 324 324 mouseAxes_[2*i + 0].absVal_ = 0.0f; 325 325 mouseAxes_[2*i + 1].absVal_ 326 = mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;326 = mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_; 327 327 } 328 328 else
Note: See TracChangeset
for help on using the changeset viewer.