mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Codechange: Simplify iteration of framerate performance elements.
This commit is contained in:
parent
97bea563d7
commit
830c9e2de8
@ -817,8 +817,8 @@ struct FrametimeGraphWindow : Window {
|
||||
{ TIMESTAMP_PRECISION * 3, 4 },
|
||||
{ TIMESTAMP_PRECISION * 1, 2 },
|
||||
};
|
||||
for (const ScaleDef *sc = hscales; sc < hscales + lengthof(hscales); sc++) {
|
||||
if (range < sc->range) this->horizontal_scale = sc->scale;
|
||||
for (const auto &sc : hscales) {
|
||||
if (range < sc.range) this->horizontal_scale = sc.scale;
|
||||
}
|
||||
}
|
||||
|
||||
@ -836,8 +836,8 @@ struct FrametimeGraphWindow : Window {
|
||||
TIMESTAMP_PRECISION / 50,
|
||||
TIMESTAMP_PRECISION / 200,
|
||||
};
|
||||
for (const TimingMeasurement *sc = vscales; sc < vscales + lengthof(vscales); sc++) {
|
||||
if (range < *sc) this->vertical_scale = (int)*sc;
|
||||
for (const auto &sc : vscales) {
|
||||
if (range < sc) this->vertical_scale = (int)sc;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1070,11 +1070,11 @@ void ConPrintFramerate()
|
||||
|
||||
bool printed_anything = false;
|
||||
|
||||
for (const PerformanceElement *e = rate_elements; e < rate_elements + lengthof(rate_elements); e++) {
|
||||
auto &pf = _pf_data[*e];
|
||||
for (const auto &e : rate_elements) {
|
||||
auto &pf = _pf_data[e];
|
||||
if (pf.num_valid == 0) continue;
|
||||
IConsolePrint(TC_GREEN, "{} rate: {:.2f}fps (expected: {:.2f}fps)",
|
||||
MEASUREMENT_NAMES[*e],
|
||||
MEASUREMENT_NAMES[e],
|
||||
pf.GetRate(),
|
||||
pf.expected_rate);
|
||||
printed_anything = true;
|
||||
|
Loading…
Reference in New Issue
Block a user