MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SetRate

Method SetRate

src/framerate_gui.cpp:421–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419 uint32_t value;
420
421 inline void SetRate(double value, double target)
422 {
423 const double threshold_good = target * 0.95;
424 const double threshold_bad = target * 2 / 3;
425 this->value = (uint32_t)(value * 100);
426 this->strid = (value > threshold_good) ? STR_FRAMERATE_FPS_GOOD : (value < threshold_bad) ? STR_FRAMERATE_FPS_BAD : STR_FRAMERATE_FPS_WARN;
427 }
428
429 inline void SetTime(double value, double target)
430 {

Callers 1

UpdateDataMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected