From f7a901c862563c73acd04b3a36feeb78239cf1c1 Mon Sep 17 00:00:00 2001 From: Stian Skjelstad Date: Fri, 29 Mar 2024 12:53:44 +0100 Subject: [PATCH] Playback via Game-Music-Emulator, the global loop module setting was not honored. Fixes #112 --- playgme/gmeplay.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/playgme/gmeplay.c b/playgme/gmeplay.c index 8f315ff2..cb1f6b30 100644 --- a/playgme/gmeplay.c +++ b/playgme/gmeplay.c @@ -40,6 +40,7 @@ static Music_Emu *gmesession; static int gmelooped; +static int doloop; static unsigned long voll,volr; static int bal; @@ -97,7 +98,12 @@ static void gmeIdler (struct cpifaceSessionAPI_t *cpifaceSession) { if (gmeactivetrack + 1 >= gme_track_count (gmesession)) { - gmelooped |= 1; + if (doloop) + { + gme_start_track (gmesession, gmeactivetrack = 0); + } else { + gmelooped |= 1; + } return; } else { if ((result = gme_start_track (gmesession, ++gmeactivetrack))) @@ -527,10 +533,7 @@ void gmeClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession) OCP_INTERNAL void gmeSetLoop (int s) { - if (gmesession) - { - gme_set_autoload_playback_limit (gmesession, !s); - } + doloop = s; } OCP_INTERNAL void gmeStartSong (struct cpifaceSessionAPI_t *cpifaceSession, int song)