1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-22 13:42:47 +00:00

Fix changing BGM Interpolation setting with left and right keys (#161)

* Fix changing BGM Interpolation setting with left and right keys

* Actually fix changing BGM Interpolation Setting with left and right keys
This commit is contained in:
Awesomegamer6566 2022-09-16 12:08:19 -07:00 committed by GitHub
parent e9d2099f42
commit 72c268647f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -670,7 +670,8 @@ impl SettingsMenu {
let _ = state.settings.save(ctx); let _ = state.settings.save(ctx);
} }
} }
MenuSelectionResult::Selected(SoundMenuEntry::BGMInterpolation, toggle) => { MenuSelectionResult::Selected(SoundMenuEntry::BGMInterpolation, toggle)
| MenuSelectionResult::Right(SoundMenuEntry::BGMInterpolation, toggle, _) => {
if let MenuEntry::DescriptiveOptions(_, value, _, _) = toggle { if let MenuEntry::DescriptiveOptions(_, value, _, _) = toggle {
let (new_mode, new_value) = match *value { let (new_mode, new_value) = match *value {
0 => (InterpolationMode::Linear, 1), 0 => (InterpolationMode::Linear, 1),
@ -679,11 +680,26 @@ impl SettingsMenu {
3 => (InterpolationMode::Polyphase, 4), 3 => (InterpolationMode::Polyphase, 4),
_ => (InterpolationMode::Nearest, 0), _ => (InterpolationMode::Nearest, 0),
}; };
*value = new_value;
state.settings.organya_interpolation = new_mode;
state.sound_manager.set_org_interpolation(new_mode);
let _ = state.settings.save(ctx);
}
}
MenuSelectionResult::Left(SoundMenuEntry::BGMInterpolation, toggle, _) => {
if let MenuEntry::DescriptiveOptions(_, value, _, _) = toggle {
let (new_mode, new_value) = match *value {
0 => (InterpolationMode::Polyphase, 4),
1 => (InterpolationMode::Nearest, 0),
2 => (InterpolationMode::Linear, 1),
3 => (InterpolationMode::Cosine, 2),
_ => (InterpolationMode::Cubic, 3),
};
*value = new_value; *value = new_value;
state.settings.organya_interpolation = new_mode; state.settings.organya_interpolation = new_mode;
state.sound_manager.set_org_interpolation(new_mode); state.sound_manager.set_org_interpolation(new_mode);
let _ = state.settings.save(ctx); let _ = state.settings.save(ctx);
} }
} }