Repeating SG1 with the same number is no-op

This commit is contained in:
kichikuou
2019-05-01 19:35:56 +09:00
parent c850d1cd46
commit 8fa417b290
3 changed files with 6 additions and 1 deletions
-1
View File
@@ -159,7 +159,6 @@ void commandSG() {
if (num == 0) {
mus_midi_stop();
} else {
mus_midi_stop();
mus_midi_start(num, loopcnt);
}
DEBUG_COMMAND("SG1 %d:\n", num);
+3
View File
@@ -67,6 +67,9 @@ static int midi_exit() {
}
static int midi_start(int no, int loop, char *data, int datalen) {
if (midino == no)
return OK;
EM_ASM_ARGS({ xsystem35.midiPlayer.play($0, $1, $2); }, loop, data, datalen);
midino = no;
+3
View File
@@ -75,6 +75,9 @@ static int midi_exit() {
}
static int midi_start(int no, int loop, char *data, int datalen) {
if (midino == no)
return OK;
midi_stop();
SDL_RWops *rwops = SDL_RWFromConstMem(data, datalen);