From 826bf093ddf8748c456bfe9aa683167afd9fa00a Mon Sep 17 00:00:00 2001 From: xCollateral <> Date: Fri, 26 Apr 2024 16:50:54 +0200 Subject: [PATCH] Fix missing resolution on config file creation - Refactor: get the highest resolution available --- src/main/java/net/vulkanmod/Initializer.java | 6 +++--- src/main/java/net/vulkanmod/config/video/VideoModeSet.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/vulkanmod/Initializer.java b/src/main/java/net/vulkanmod/Initializer.java index e552a1724..e99a46eb1 100644 --- a/src/main/java/net/vulkanmod/Initializer.java +++ b/src/main/java/net/vulkanmod/Initializer.java @@ -27,14 +27,14 @@ public void onInitializeClient() { LOGGER.info("== VulkanMod =="); + Platform.init(); + VideoModeManager.init(); + var configPath = FabricLoader.getInstance() .getConfigDir() .resolve("vulkanmod_settings.json"); CONFIG = loadConfig(configPath); - - Platform.init(); - VideoModeManager.init(); } private static Config loadConfig(Path path) { diff --git a/src/main/java/net/vulkanmod/config/video/VideoModeSet.java b/src/main/java/net/vulkanmod/config/video/VideoModeSet.java index bd56eacff..cb6f3881d 100644 --- a/src/main/java/net/vulkanmod/config/video/VideoModeSet.java +++ b/src/main/java/net/vulkanmod/config/video/VideoModeSet.java @@ -64,7 +64,8 @@ public VideoMode getVideoMode(int refresh) { } public VideoMode getVideoMode() { - return new VideoMode(this.width, this.height, this.bitDepth, this.refreshRates.get(0)); + int refreshRate = this.refreshRates.get(this.refreshRates.size() - 1); + return new VideoMode(this.width, this.height, this.bitDepth, refreshRate); } public static final class VideoMode {