Video: fix incorrect refresh rate value being returned (fixes #9594)
Regression from b859060627
This commit is contained in:
parent
6fb5488464
commit
bb4eb0bf1b
2 changed files with 8 additions and 1 deletions
|
@ -486,7 +486,11 @@ int get_pixel_scale()
|
|||
int current_refresh_rate()
|
||||
{
|
||||
// TODO: this should be more clever, depending on usage
|
||||
return std::min(prefs::get().refresh_rate(), refresh_rate_);
|
||||
if(auto preferred = prefs::get().refresh_rate(); preferred > 0) {
|
||||
return std::min(preferred, refresh_rate_);
|
||||
} else {
|
||||
return refresh_rate_;
|
||||
}
|
||||
}
|
||||
|
||||
void force_render_target(const texture& t)
|
||||
|
|
|
@ -135,6 +135,9 @@ std::vector<std::string> enumerate_drivers();
|
|||
/**
|
||||
* The refresh rate of the screen.
|
||||
*
|
||||
* In most cases, this will be the native refresh rate of the display, but
|
||||
* could be lower if FPS has been artificially capped (i.e., through --max-fps).
|
||||
*
|
||||
* If a refresh cannot be detected, this may return 0, or it may return a
|
||||
* substitute value.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue