diff --git a/Cargo.lock b/Cargo.lock index 8f9d397..1345b3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,7 +31,7 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "0.3.0" +version = "0.3.1" dependencies = [ "bzip2", "curl", @@ -51,7 +51,7 @@ dependencies = [ [[package]] name = "anime-game-launcher" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anime-game-core", "dirs", diff --git a/Cargo.toml b/Cargo.toml index 1cc7dde..f9c85fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anime-game-launcher" -version = "0.7.0" +version = "0.7.1" description = "Anime Game launcher" authors = ["Nikita Podvirnyy "] license = "GPL-3.0" diff --git a/anime-game-core b/anime-game-core index 8c7a8f9..4009dc5 160000 --- a/anime-game-core +++ b/anime-game-core @@ -1 +1 @@ -Subproject commit 8c7a8f9bcbe008f164e810aeddbe33366fa541ec +Subproject commit 4009dc5bfe93d4b56437bda4f484affe9c5170f2 diff --git a/assets/ui/preferences/enhancements.blp b/assets/ui/preferences/enhancements.blp index 6f2b821..f2df365 100644 --- a/assets/ui/preferences/enhancements.blp +++ b/assets/ui/preferences/enhancements.blp @@ -84,6 +84,7 @@ Adw.PreferencesPage page { Adw.ActionRow gamescope_row { title: "Gamescope"; + subtitle: "Gamescope is a tool from Valve that allows for games to run in an isolated Xwayland instance and supports AMD, Intel, and Nvidia GPUs"; Gtk.Button gamescope_settings { icon-name: "emblem-system-symbolic"; diff --git a/assets/ui/preferences/gamescope.blp b/assets/ui/preferences/gamescope.blp index e25e107..fbcc852 100644 --- a/assets/ui/preferences/gamescope.blp +++ b/assets/ui/preferences/gamescope.blp @@ -80,13 +80,21 @@ Adw.PreferencesWindow window { } Adw.ActionRow { - title: "Use integer scaling"; + title: "Integer scaling"; Gtk.Switch integer_scaling { valign: center; } } + Adw.ActionRow { + title: "Nvidia Image Scaling"; + + Gtk.Switch nvidia_image_scaling { + valign: center; + } + } + Adw.ActionRow { title: "Window type"; diff --git a/src/lib/config/mod.rs b/src/lib/config/mod.rs index a8ee1ef..c1d844e 100644 --- a/src/lib/config/mod.rs +++ b/src/lib/config/mod.rs @@ -226,8 +226,13 @@ impl Config { gamescope += " -n"; } - // Set FSR support - if self.game.enhancements.fsr.enabled { + // Set NIS (Nvidia Image Scaling) support + if self.game.enhancements.gamescope.nvidia_image_scaling { + gamescope += " -Y"; + } + + // Set FSR support (only if NIS is not enabled) + else if self.game.enhancements.fsr.enabled { gamescope += " -U"; } @@ -418,6 +423,7 @@ pub struct Gamescope { pub gamescope: Size, pub framerate: Framerate, pub integer_scaling: bool, + pub nvidia_image_scaling: bool, pub window_type: WindowType } @@ -429,6 +435,7 @@ impl Default for Gamescope { gamescope: Size::default(), framerate: Framerate::default(), integer_scaling: true, + nvidia_image_scaling: false, window_type: WindowType::default() } } diff --git a/src/ui/preferences/gamescope.rs b/src/ui/preferences/gamescope.rs index d7e3a42..b5bc109 100644 --- a/src/ui/preferences/gamescope.rs +++ b/src/ui/preferences/gamescope.rs @@ -24,6 +24,7 @@ pub struct AppWidgets { pub framerate_limit: gtk::Entry, pub framerate_unfocused_limit: gtk::Entry, pub integer_scaling: gtk::Switch, + pub nvidia_image_scaling: gtk::Switch, pub borderless: gtk::ToggleButton, pub fullscreen: gtk::ToggleButton @@ -45,6 +46,7 @@ impl AppWidgets { framerate_limit: get_object(&builder, "framerate_limit")?, framerate_unfocused_limit: get_object(&builder, "framerate_unfocused_limit")?, integer_scaling: get_object(&builder, "integer_scaling")?, + nvidia_image_scaling: get_object(&builder, "nvidia_image_scaling")?, borderless: get_object(&builder, "borderless")?, fullscreen: get_object(&builder, "fullscreen")? @@ -147,6 +149,15 @@ impl App { } }); + // Use NIS (Nvidia Image Scaling) + self.widgets.nvidia_image_scaling.connect_state_notify(move |switch| { + if let Ok(mut config) = config::get() { + config.game.enhancements.gamescope.nvidia_image_scaling = switch.state(); + + config::update(config); + } + }); + // Window type let borderless = self.widgets.borderless.clone(); @@ -217,6 +228,7 @@ impl App { set_text(&self.widgets.framerate_unfocused_limit, config.game.enhancements.gamescope.framerate.unfocused); self.widgets.integer_scaling.set_state(config.game.enhancements.gamescope.integer_scaling); + self.widgets.nvidia_image_scaling.set_state(config.game.enhancements.gamescope.nvidia_image_scaling); match config.game.enhancements.gamescope.window_type { config::WindowType::Borderless => self.widgets.borderless.set_active(true),