mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed title screen FPS cap not being applied correctly when background FPS is set to unlimited
This commit is contained in:
parent
479affe127
commit
be02e3ced0
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user