| 463 | }}; |
| 464 | |
| 465 | void UpdateData() |
| 466 | { |
| 467 | double gl_rate = _pf_data[PFE_GAMELOOP].GetRate(); |
| 468 | this->rate_gameloop.SetRate(gl_rate, _pf_data[PFE_GAMELOOP].expected_rate); |
| 469 | this->speed_gameloop.SetRate(gl_rate / _pf_data[PFE_GAMELOOP].expected_rate, 1.0); |
| 470 | if (this->IsShaded()) return; // in small mode, this is everything needed |
| 471 | |
| 472 | this->rate_drawing.SetRate(_pf_data[PFE_DRAWING].GetRate(), _settings_client.gui.refresh_rate); |
| 473 | |
| 474 | int new_active = 0; |
| 475 | for (PerformanceElement e = PFE_FIRST; e < PFE_MAX; e++) { |
| 476 | this->times_shortterm[e].SetTime(_pf_data[e].GetAverageDurationMilliseconds(8), MILLISECONDS_PER_TICK); |
| 477 | this->times_longterm[e].SetTime(_pf_data[e].GetAverageDurationMilliseconds(NUM_FRAMERATE_POINTS), MILLISECONDS_PER_TICK); |
| 478 | if (_pf_data[e].num_valid > 0) { |
| 479 | new_active++; |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | if (new_active != this->num_active) { |
| 484 | this->num_active = new_active; |
| 485 | Scrollbar *sb = this->GetScrollbar(WID_FRW_SCROLLBAR); |
| 486 | sb->SetCount(this->num_active); |
| 487 | sb->SetCapacity(std::min(this->num_displayed, this->num_active)); |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
| 492 | { |
no test coverage detected