mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-22 05:33:02 +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:
parent
e9d2099f42
commit
72c268647f
|
@ -670,7 +670,8 @@ impl SettingsMenu {
|
|||
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 {
|
||||
let (new_mode, new_value) = match *value {
|
||||
0 => (InterpolationMode::Linear, 1),
|
||||
|
@ -679,11 +680,26 @@ impl SettingsMenu {
|
|||
3 => (InterpolationMode::Polyphase, 4),
|
||||
_ => (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;
|
||||
state.settings.organya_interpolation = new_mode;
|
||||
state.sound_manager.set_org_interpolation(new_mode);
|
||||
|
||||
let _ = state.settings.save(ctx);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue