From 8cffa4ae3de0f18609a4ea78f110db811b3118da Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 31 Jul 2021 22:00:41 +0100 Subject: [PATCH] Better comparison --- agb/src/sound/mixer/sw_mixer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb/src/sound/mixer/sw_mixer.rs b/agb/src/sound/mixer/sw_mixer.rs index 54ad67c0..f44026bc 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -133,7 +133,7 @@ impl MixerBuffer { let right_amount = ((channel.panning + 1) / 2) * channel.volume; let left_amount = ((-channel.panning + 1) / 2) * channel.volume; - if channel.pos + channel.playback_speed * SOUND_BUFFER_SIZE >= channel.data.len().into() + if (channel.pos + channel.playback_speed * SOUND_BUFFER_SIZE).floor() >= channel.data.len() { // TODO: This should probably play what's left rather than skip the last bit if channel.should_loop {