Ignore:
Timestamp:
Aug 22, 2010, 7:52:12 PM (10 years ago)
Author:
sam
Message:

Store the frame number in the Ticker instead of duplicating the information
in each class that uses it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/profiler.cpp

    r154 r167  
    2222    friend class Profiler;
    2323
    24     static int const HISTORY = 30;
     24    static int const HISTORY = 32;
    2525
    2626public:
     
    2929        for (int i = 0; i < HISTORY; i++)
    3030            history[i] = 0.0f;
    31         frame = 0;
    3231        avg = max = 0.0f;
    3332    }
     
    3635    float history[HISTORY];
    3736    Timer timer;
    38     int frame;
    3937    float avg, max;
    4038}
     
    5452    float deltams = data[id].timer.GetMs();
    5553
    56     data[id].history[data->frame % ProfilerData::HISTORY] = deltams;
    57     data[id].frame++;
     54    data[id].history[Ticker::GetFrameNum() % ProfilerData::HISTORY] = deltams;
    5855    data[id].avg = 0.0f;
    5956    data[id].max = 0.0f;
Note: See TracChangeset for help on using the changeset viewer.