From 40f7975f465384b0594888430ce84327352f2fa1 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sun, 6 Jun 2021 15:48:52 +0100 Subject: [PATCH] Loop if requested --- agb/src/sound/mixer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agb/src/sound/mixer.rs b/agb/src/sound/mixer.rs index f97c674f..3c0fbfdc 100644 --- a/agb/src/sound/mixer.rs +++ b/agb/src/sound/mixer.rs @@ -43,7 +43,11 @@ impl Mixer { some_channel.pos += SOUND_BUFFER_SIZE; if some_channel.pos >= some_channel.data.len() { - has_finished = true; + if some_channel.should_loop { + some_channel.pos = 0; + } else { + has_finished = true; + } } }