mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-26 09:06:33 +11:00
Don't panic if the song has finished
This commit is contained in:
parent
773729de98
commit
c81d73f8d5
1 changed files with 15 additions and 15 deletions
|
@ -27,21 +27,21 @@ pub fn main() -> ! {
|
||||||
input.update();
|
input.update();
|
||||||
|
|
||||||
{
|
{
|
||||||
let channel = mixer.get_channel(&channel_id).unwrap();
|
if let Some(channel) = mixer.get_channel(&channel_id) {
|
||||||
|
let half: Num<i16, 4> = Num::new(1) / 2;
|
||||||
|
let half_usize: Num<usize, 8> = Num::new(1) / 2;
|
||||||
|
match input.x_tri() {
|
||||||
|
Tri::Negative => channel.panning(-half),
|
||||||
|
Tri::Zero => channel.panning(0.into()),
|
||||||
|
Tri::Positive => channel.panning(half),
|
||||||
|
};
|
||||||
|
|
||||||
let half: Num<i16, 4> = Num::new(1) / 2;
|
match input.y_tri() {
|
||||||
let half_usize: Num<usize, 8> = Num::new(1) / 2;
|
Tri::Negative => channel.playback(half_usize.change_base() + 1),
|
||||||
match input.x_tri() {
|
Tri::Zero => channel.playback(1.into()),
|
||||||
Tri::Negative => channel.panning(-half),
|
Tri::Positive => channel.playback(half_usize),
|
||||||
Tri::Zero => channel.panning(0.into()),
|
};
|
||||||
Tri::Positive => channel.panning(half),
|
}
|
||||||
};
|
|
||||||
|
|
||||||
match input.y_tri() {
|
|
||||||
Tri::Negative => channel.playback(half_usize.change_base() + 1),
|
|
||||||
Tri::Zero => channel.playback(1.into()),
|
|
||||||
Tri::Positive => channel.playback(half_usize),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vblank_provider.wait_for_VBlank();
|
vblank_provider.wait_for_VBlank();
|
||||||
|
|
Loading…
Add table
Reference in a new issue