Added support for GMF loop specifier
svn-id: r7874
This commit is contained in:
parent
bcdf2286f8
commit
1b4b6030fe
2 changed files with 11 additions and 5 deletions
|
@ -298,10 +298,15 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
|
||||||
p->data = (byte *) calloc (size + 4, 1);
|
p->data = (byte *) calloc (size + 4, 1);
|
||||||
in->read (p->data, size);
|
in->read (p->data, size);
|
||||||
|
|
||||||
// For GMF files, we're going to have to use
|
if (!memcmp (p->data, "GMF\x1", 4)) {
|
||||||
// hardcoded size tables.
|
if (!sfx)
|
||||||
if (!memcmp (p->data, "GMF\x1", 4) && size == 64000)
|
setLoop (p->data[6] != 0);
|
||||||
size = simon1_gmf_size [song];
|
|
||||||
|
// For GMF files, we're going to have to use
|
||||||
|
// hardcoded size tables.
|
||||||
|
if (size == 64000)
|
||||||
|
size = simon1_gmf_size [song];
|
||||||
|
}
|
||||||
|
|
||||||
MidiParser *parser = MidiParser::createParser_SMF();
|
MidiParser *parser = MidiParser::createParser_SMF();
|
||||||
parser->property (MidiParser::mpMalformedPitchBends, 1);
|
parser->property (MidiParser::mpMalformedPitchBends, 1);
|
||||||
|
|
|
@ -5307,6 +5307,8 @@ void SimonState::loadMusic (uint music) {
|
||||||
// TODO Add music support for simon1demo
|
// TODO Add music support for simon1demo
|
||||||
} else {
|
} else {
|
||||||
midi.stop();
|
midi.stop();
|
||||||
|
midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.)
|
||||||
|
|
||||||
if (_game & GF_WIN) {
|
if (_game & GF_WIN) {
|
||||||
_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
|
_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
|
||||||
midi.loadMultipleSMF (_game_file);
|
midi.loadMultipleSMF (_game_file);
|
||||||
|
@ -5326,7 +5328,6 @@ void SimonState::loadMusic (uint music) {
|
||||||
delete f;
|
delete f;
|
||||||
}
|
}
|
||||||
|
|
||||||
midi.setLoop (true);
|
|
||||||
midi.startTrack (0);
|
midi.startTrack (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue