mirror of
https://github.com/libretro/RetroArch
synced 2025-04-15 23:42:30 +00:00
Fix refresh rate 59Hz rounding
This commit is contained in:
parent
11d5d3170d
commit
1e4557c09a
@ -6207,7 +6207,16 @@ int action_cb_push_dropdown_item_resolution(const char *path,
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
video_monitor_set_refresh_rate((float)refreshrate);
|
||||
unsigned refresh_mod = round(refreshrate / 60.0f);
|
||||
float refresh_exact = refreshrate;
|
||||
|
||||
/* 59 Hz is an inaccurate representation of the real value (59.94).
|
||||
* And since we at this point only have the integer to work with,
|
||||
* the exact float needs to be calculated for 'video_refresh_rate' */
|
||||
if (refreshrate == (60.0f * refresh_mod) - 1)
|
||||
refresh_exact = 59.94f * refresh_mod;
|
||||
|
||||
video_monitor_set_refresh_rate(refresh_exact);
|
||||
|
||||
settings->uints.video_fullscreen_x = width;
|
||||
settings->uints.video_fullscreen_y = height;
|
||||
|
Loading…
x
Reference in New Issue
Block a user