Skip to content

Commit

Permalink
Playback via Game-Music-Emulator, the global loop module setting was …
Browse files Browse the repository at this point in the history
…not honored. Fixes #112
  • Loading branch information
mywave82 committed Mar 29, 2024
1 parent 374f027 commit f7a901c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions playgme/gmeplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
static Music_Emu *gmesession;

static int gmelooped;
static int doloop;

static unsigned long voll,volr;
static int bal;
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f7a901c

Please sign in to comment.