Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6161


Ignore:
Timestamp:
Nov 26, 2009, 2:15:28 PM (15 years ago)
Author:
rgrieder
Message:

Fixed uninitialised value problem with the statistics (at least for the first few calls to getAvgFPS() before Game::run()).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/Game.cc

    r6150 r6161  
    9292#endif
    9393
     94        // reset statistics
     95        this->statisticsStartTime_ = 0;
     96        this->statisticsTickTimes_.clear();
     97        this->periodTickTime_ = 0;
     98        this->periodTime_ = 0;
     99        this->avgFPS_ = 0.0f;
     100        this->avgTickTime_ = 0.0f;
     101        this->excessSleepTime_ = 0;
     102
    94103        // Create an empty root state
    95104        this->declareGameState<GameState>("GameState", "emptyRootGameState", true, false);
     
    152161        if (this->requestedStateNodes_.empty())
    153162            COUT(0) << "Warning: Starting game without requesting GameState. This automatically terminates the program." << std::endl;
    154 
    155         // reset statistics
    156         this->statisticsStartTime_ = 0;
    157         this->statisticsTickTimes_.clear();
    158         this->periodTickTime_ = 0;
    159         this->periodTime_ = 0;
    160         this->avgFPS_ = 0.0f;
    161         this->avgTickTime_ = 0.0f;
    162         this->excessSleepTime_ = 0;
    163163
    164164        // START GAME
Note: See TracChangeset for help on using the changeset viewer.