Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 16, 2008, 7:10:28 PM (16 years ago)
Author:
landauf
Message:

maybe fixed backlight crash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/gamestates/GSDedicated.cc

    r2175 r2212  
    4949    {
    5050        RegisterObject(GSDedicated);
    51        
     51
    5252        this->setConfigValues();
    5353    }
     
    8282    {
    8383        static int timeSinceLastTick = 0; // in microseconds
    84         const int tickPeriod = 1000000. / this->tickrate_; // in microseconds
    85        
     84        const int tickPeriod = (int)(1000000.0f / this->tickrate_); // in microseconds
     85
    8686        GSLevel::ticked(time);
    87        
     87
    8888        timeSinceLastTick += time.getDeltaTimeMicroseconds();
    8989        if ( timeSinceLastTick >= tickPeriod )
     
    9696        {
    9797            unsigned int sleepTime;
    98            
     98
    9999#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
    100100            if ( tickPeriod-timeSinceLastTick < MIN_WIN32_SLEEP_TIME )
    101                 sleepTime = MIN_WIN32_SLEEP_TIME*1000000;
     101                sleepTime = (unsigned int)(MIN_WIN32_SLEEP_TIME * 1000000);
    102102            else
    103103                sleepTime = tickPeriod - timeSinceLastTick;
    104104            msleep( sleepTime / 1000 );
    105            
     105
    106106#else /* unix */
    107107            sleepTime = tickPeriod - timeSinceLastTick;
    108108            usleep( sleepTime );
    109109#endif
    110            
     110
    111111        }
    112        
     112
    113113        this->tickChild(time);
    114114    }
    115    
     115
    116116    void GSDedicated::setConfigValues()
    117117    {
Note: See TracChangeset for help on using the changeset viewer.