diff --git a/CHANGELOG.md b/CHANGELOG.md index 28571cf25a..5b45252e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an error where '{amount} Exp' floater did not use existing localizations - Fix villagers seeing cultists and familiar enemies through objects. - Menacing agents are now less spammy with their menacing messages +- Fixed the title screen FPS cap not applying when the background FPS limit was set higher than 60 FPS ## [0.12.0] - 2022-02-19 diff --git a/voxygen/src/run.rs b/voxygen/src/run.rs index a3d57ce4f4..13fd444657 100644 --- a/voxygen/src/run.rs +++ b/voxygen/src/run.rs @@ -238,14 +238,22 @@ fn handle_main_events_cleared( // running at hundreds/thousands of FPS resulting in high GPU usage for // effectively doing nothing. let max_fps = get_fps(global_state.settings.graphics.max_fps); - let max_background_fps = get_fps(global_state.settings.graphics.max_background_fps); - const TITLE_SCREEN_FPS_CAP: u32 = 60; - let target_fps = if !global_state.window.focused { - u32::min(max_background_fps, max_fps) - } else if capped_fps { - u32::min(TITLE_SCREEN_FPS_CAP, max_fps) - } else { + let max_background_fps = u32::min( + max_fps, + get_fps(global_state.settings.graphics.max_background_fps), + ); + let max_fps_focus_adjusted = if global_state.window.focused { max_fps + } else { + max_background_fps + }; + + const TITLE_SCREEN_FPS_CAP: u32 = 60; + + let target_fps = if capped_fps { + u32::min(TITLE_SCREEN_FPS_CAP, max_fps_focus_adjusted) + } else { + max_fps_focus_adjusted }; global_state