mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-08 08:19:09 +01:00
settings: Move settings sanitization to its own function
Creates a new function that can be expanded later to fix other settings that are known to cause emulation errors across executables.
This commit is contained in:
parent
8160e142e1
commit
6d1477f214
4 changed files with 11 additions and 4 deletions
|
@ -184,4 +184,10 @@ void RestoreGlobalState() {
|
|||
values.sound_index.SetGlobal(true);
|
||||
}
|
||||
|
||||
void Sanitize() {
|
||||
values.use_asynchronous_gpu_emulation.SetValue(
|
||||
values.use_asynchronous_gpu_emulation.GetValue() ||
|
||||
values.use_multi_core.GetValue());
|
||||
}
|
||||
|
||||
} // namespace Settings
|
||||
|
|
|
@ -539,4 +539,7 @@ void LogSettings();
|
|||
// Restore the global state of all applicable settings in the Values struct
|
||||
void RestoreGlobalState();
|
||||
|
||||
// Fixes settings that are known to cause issues with the emulator
|
||||
void Sanitize();
|
||||
|
||||
} // namespace Settings
|
||||
|
|
|
@ -1342,11 +1342,13 @@ void Config::WriteSettingGlobal(const QString& name, const QVariant& value, bool
|
|||
|
||||
void Config::Reload() {
|
||||
ReadValues();
|
||||
Settings::Sanitize();
|
||||
// To apply default value changes
|
||||
SaveValues();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
void Config::Save() {
|
||||
Settings::Sanitize();
|
||||
SaveValues();
|
||||
}
|
||||
|
|
|
@ -1053,10 +1053,6 @@ void GMainWindow::BootGame(const QString& filename) {
|
|||
if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) {
|
||||
// Load per game settings
|
||||
Config per_game_config(fmt::format("{:016X}.ini", title_id), false);
|
||||
|
||||
Settings::values.use_asynchronous_gpu_emulation.SetValue(
|
||||
Settings::values.use_asynchronous_gpu_emulation.GetValue() ||
|
||||
Settings::values.use_multi_core.GetValue());
|
||||
}
|
||||
|
||||
Settings::LogSettings();
|
||||
|
|
Loading…
Reference in a new issue