summaryrefslogtreecommitdiff
path: root/src/framerate_gui.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-17 15:31:09 +0100
committerPatric Stout <github@truebrain.nl>2021-02-19 10:43:15 +0100
commitfa170b9ace1a2f45833627676b0106ee13914bd4 (patch)
treede0471ae9fcbd98799a1626e178758d7edbd01e7 /src/framerate_gui.cpp
parenteb9b1ad68d84ddbebb3d9e50f3ec8d3ad195c75c (diff)
downloadopenttd-fa170b9ace1a2f45833627676b0106ee13914bd4.tar.xz
Feature: configurable refresh-rate and change default to 60fps
Most modern games run on 60 fps, and for good reason. This gives a much smoother experiences. As some people have monitors that can do 144Hz or even 240Hz, allow people to configure the refresh rate. Of course, the higher you set the value, the more time the game spends on drawing pixels instead of simulating the game, which has an effect on simulation speed. The simulation will still always run at 33.33 fps, and is not influences by this setting.
Diffstat (limited to 'src/framerate_gui.cpp')
-rw-r--r--src/framerate_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp
index 0afb533f6..26a40c451 100644
--- a/src/framerate_gui.cpp
+++ b/src/framerate_gui.cpp
@@ -189,7 +189,7 @@ namespace {
PerformanceData(1), // PFE_ACC_GL_AIRCRAFT
PerformanceData(1), // PFE_GL_LANDSCAPE
PerformanceData(1), // PFE_GL_LINKGRAPH
- PerformanceData(GL_RATE), // PFE_DRAWING
+ PerformanceData(1000.0 / 30), // PFE_DRAWING
PerformanceData(1), // PFE_ACC_DRAWWORLD
PerformanceData(60.0), // PFE_VIDEO
PerformanceData(1000.0 * 8192 / 44100), // PFE_SOUND
@@ -468,7 +468,7 @@ struct FramerateWindow : Window {
this->speed_gameloop.SetRate(gl_rate / _pf_data[PFE_GAMELOOP].expected_rate, 1.0);
if (this->small) return; // in small mode, this is everything needed
- this->rate_drawing.SetRate(_pf_data[PFE_DRAWING].GetRate(), _pf_data[PFE_DRAWING].expected_rate);
+ this->rate_drawing.SetRate(_pf_data[PFE_DRAWING].GetRate(), _settings_client.gui.refresh_rate);
int new_active = 0;
for (PerformanceElement e = PFE_FIRST; e < PFE_MAX; e++) {