Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2558


Ignore:
Timestamp:
Dec 31, 2008, 11:44:41 AM (15 years ago)
Author:
scheusso
Message:

Fixed that problems with statistical info of tick time/fps

Location:
code/branches/presentation/src/orxonox/gamestates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/gamestates/GSRoot.cc

    r2555 r2558  
    104104
    105105        // reset frame counter
    106         this->frameCount_ = 0;
    107106        this->statisticsStartTime_ = 0;
    108107        this->statisticsTickTimes_.clear();
     
    223222
    224223        // STATISTICS
     224        assert(timeAfterTick - timeBeforeTick >= 0 );
    225225        statisticsTickInfo tickInfo = {timeAfterTick, timeAfterTick - timeBeforeTick};
    226226        statisticsTickTimes_.push_back(tickInfo);
     227        assert(statisticsTickTimes_.back().tickLength==tickInfo.tickLength);
    227228
    228229        // Ticks GSGraphics or GSDedicated
     
    230231
    231232        // Note: tickInfo.tickLength is modified by GSGraphics or GSDedicated!
    232         this->periodTickTime_ += statisticsTickTimes_.back().tickLength;
     233        this->periodTickTime_ += tickInfo.tickLength;
    233234        if (timeAfterTick > statisticsStartTime_ + statisticsRefreshCycle_)
    234235        {
     
    240241                do
    241242                {
     243                    assert(this->periodTickTime_ > it->tickLength);
    242244                    this->periodTickTime_ -= it->tickLength;
    243245                    ++it;
     
    254256        }
    255257
    256         ++this->frameCount_;
    257258    }
    258259
  • code/branches/presentation/src/orxonox/gamestates/GSRoot.h

    r2549 r2558  
    6767
    6868        inline void addTickTime(uint32_t length)
    69             { assert(!this->statisticsTickTimes_.empty()); this->statisticsTickTimes_.back().tickLength += length; }
     69            { assert(!this->statisticsTickTimes_.empty()); this->statisticsTickTimes_.back().tickLength += length;
     70              this->periodTickTime_+=length; }
    7071
    7172    private:
     
    8788
    8889        // variables for time statistics
    89         uint32_t              frameCount_;
    9090        uint64_t              statisticsStartTime_;
    9191        std::list<statisticsTickInfo>
Note: See TracChangeset for help on using the changeset viewer.