Merge pull request #354 from ludovic111/fix/cpu-defaults

Cap a fresh install at vanilla's 120 FPS
This commit is contained in:
Ludovic Marie
2026-10-15 18:42:36 +02:00
committed by GitHub
+13 -2
View File
@@ -194,8 +194,9 @@ impl Default for Settings {
gui_scale: 0,
view_bobbing: true,
gamma: 0.5,
// Vanilla defaults to 120; Horizon runs unlimited unless capped.
max_fps: 260,
// Vanilla's default, as for an options.txt without the key: a
// capped frame rate leaves the cores idle when VSync is off.
max_fps: 120,
vsync: true,
fullscreen: false,
smooth_lighting: true,
@@ -608,6 +609,16 @@ mod tests {
assert_eq!(again.keys.get("key.jump"), "key.keyboard.j");
}
#[test]
fn no_options_txt_paces_frames_like_an_empty_one() {
let (fresh, empty) = (Settings::default(), Settings::parse(""));
assert_eq!(fresh.max_fps, 120);
assert_eq!(fresh.max_fps, empty.max_fps);
assert_eq!(fresh.vsync, empty.vsync);
assert_eq!(fresh.inactivity_fps_limit, empty.inactivity_fps_limit);
assert_eq!(fresh.render_distance, empty.render_distance);
assert_eq!(fresh.simulation_distance, empty.simulation_distance);
}
#[test]
fn subtitle_options() {
let s = Settings::parse("showSubtitles:true\nnotificationDisplayTime:2.5\n");
assert!(s.show_subtitles);