Added FSR support in game launching

This commit is contained in:
Observer KRypt0n_ 2022-07-01 21:14:08 +02:00
parent eb2620f9cc
commit 40e6de29cf
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 18 additions and 1 deletions

View file

@ -195,3 +195,19 @@ impl Default for Fsr {
}
}
}
impl Fsr {
/// Get environment variables corresponding to used amd fsr options
pub fn get_env_vars(&self) -> HashMap<&str, String> {
if self.enabled {
HashMap::from([
("WINE_FULLSCREEN_FSR", String::from("1")),
("WINE_FULLSCREEN_FSR_STRENGTH", self.strength.to_string())
])
}
else {
HashMap::new()
}
}
}

View file

@ -96,9 +96,10 @@ pub fn run(debug: bool) -> Result<(), Error> {
}
command.env("WINEPREFIX", &config.game.wine.prefix);
command.envs(config.game.wine.sync.get_env_vars());
command.envs(config.game.enhancements.hud.get_env_vars());
command.envs(config.game.enhancements.fsr.get_env_vars());
command.envs(config.game.environment)
.current_dir(config.game.path)