Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 18, 2009, 10:00:15 AM (16 years ago)
Author:
rgrieder
Message:

Replaced <OgrePrerequisites.h> with "util/OgreForwardRefs.h": I haven't yet realised that OgrePrerequisites.h includes about every single std header by including the OgreMemoryManager.h file.
And while at it, I took care of some type conversions (partially revealed by the missing OgrePrerequisites.h that disabled warnings)

Location:
code/branches/pch/src/core
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/src/core/Clock.cc

    r1755 r3192  
    5757        tickTime_ = storedTime_ + timersTime;
    5858        tickDt_ = timersTime - lastTimersTime_;
    59         tickDtFloat_ = (float)tickDt_ / 1000000.0f;
     59        tickDtFloat_ = static_cast<float>(tickDt_ / 1000000.0f);
    6060
    6161        if (timersTime > 0x7FFFFFF0)
  • code/branches/pch/src/core/Clock.h

    r2896 r3192  
    3939
    4040#include "CorePrereqs.h"
    41 #include <OgrePrerequisites.h>
     41#include "util/OgreForwardRefs.h"
    4242
    4343namespace orxonox
     
    5353        unsigned long long getMicroseconds()   const { return tickTime_; }
    5454        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); }
    5757
    5858        float              getDeltaTime()      const { return tickDtFloat_; }
    59         int                getDeltaTimeMicroseconds() const { return tickDt_; }
     59        long               getDeltaTimeMicroseconds() const { return tickDt_; }
    6060
    6161        unsigned long long getRealMicroseconds() const;
     
    6767        unsigned long long storedTime_;
    6868        unsigned long long tickTime_;
    69         int                tickDt_;
     69        long               tickDt_;
    7070        float              tickDtFloat_;
    7171        unsigned long      lastTimersTime_;
  • code/branches/pch/src/core/ConsoleCommandCompilation.cc

    r3154 r3192  
    170170                COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << "'" << std::endl;
    171171            }
    172             return expr.getResult();
     172            return static_cast<float>(expr.getResult());
    173173        }
    174174        else
  • code/branches/pch/src/core/Core.cc

    r3166 r3192  
    367367        if (!bInitialized && this->bInitializeRandomNumberGenerator_)
    368368        {
    369             srand(time(0));
     369            srand(static_cast<unsigned int>(time(0)));
    370370            rand();
    371371            bInitialized = true;
  • code/branches/pch/src/core/Game.cc

    r3154 r3192  
    190190
    191191                if ((*it)->getCountTickTime())
    192                     this->addTickTime(this->gameClock_->getRealMicroseconds() - timeBeforeTick);
     192                    this->addTickTime(static_cast<uint32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick));
    193193            }
    194194
     
    212212
    213213                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;
    216216
    217217                this->periodTime_ -= this->statisticsRefreshCycle_;
  • code/branches/pch/src/core/input/InputManager.cc

    r3187 r3192  
    11661166        else
    11671167        {
    1168             float fValue = value - joyStickCalibrations_[iJoyStick].middleValue[axis];
     1168            float fValue = static_cast<float>(value - joyStickCalibrations_[iJoyStick].middleValue[axis]);
    11691169            if (fValue > 0.0f)
    11701170                fValue *= joyStickCalibrations_[iJoyStick].positiveCoeff[axis];
  • code/branches/pch/src/core/input/KeyBinder.cc

    r3148 r3192  
    317317                    {
    318318                        mouseAxes_[2*i + 0].absVal_
    319                             = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
     319                            = -mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
    320320                        mouseAxes_[2*i + 1].absVal_ = 0.0f;
    321321                    }
     
    324324                        mouseAxes_[2*i + 0].absVal_ = 0.0f;
    325325                        mouseAxes_[2*i + 1].absVal_
    326                             =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
     326                            =  mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
    327327                    }
    328328                    else
Note: See TracChangeset for help on using the changeset viewer.