~armagetronad-dev/armagetronad/0.2.9-armagetronad-work

« back to all changes in this revision

Viewing changes to src/engine/eTimer.cpp

  • Committer: Manuel Moos
  • Date: 2024-02-09 23:18:59 UTC
  • Revision ID: z-man@users.sf.net-20240209231859-xhkd10vtr0kj701l
Increase FPS backlog to 5 buckets

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
 
103
103
    // if the bcket is full, we write the current frames per second
104
104
    // into these rolling buffers
105
 
    std::array<int, 3> lastFPS_;
 
105
    std::array<int, 5> lastFPS_;
106
106
    int bestFPS_;
107
107
 
108
108
    int GetBestFPS() const noexcept
124
124
    void AddDataPoint(int fps) noexcept
125
125
    {
126
126
        // record FPS
127
 
        for (int i = 1; i >= 0; --i)
 
127
        for (int i = lastFPS_.size() - 2; i >= 0; --i)
128
128
            lastFPS_[i] = lastFPS_[i + 1];
129
129
        lastFPS_.back() = fps;
130
130