aboutsummaryrefslogtreecommitdiff
path: root/simon/midi.cpp
diff options
context:
space:
mode:
authorTravis Howell2003-01-03 12:06:30 +0000
committerTravis Howell2003-01-03 12:06:30 +0000
commit3a4782f16656c180b48be4afa1270a7ec351ed72 (patch)
tree063280408ebd9536376aae69d6f2e7a9108a96ab /simon/midi.cpp
parentf1365f4f2b861ecfed42dea4b534ee14eca245ac (diff)
downloadscummvm-rg350-3a4782f16656c180b48be4afa1270a7ec351ed72.tar.gz
scummvm-rg350-3a4782f16656c180b48be4afa1270a7ec351ed72.tar.bz2
scummvm-rg350-3a4782f16656c180b48be4afa1270a7ec351ed72.zip
Add olki's patch for sound effects in simon1dos
Plus hack to allow choice between midi music and sound effects via 's' key svn-id: r6326
Diffstat (limited to 'simon/midi.cpp')
-rw-r--r--simon/midi.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/simon/midi.cpp b/simon/midi.cpp
index ad9c7d24f8..306cbca6ee 100644
--- a/simon/midi.cpp
+++ b/simon/midi.cpp
@@ -61,7 +61,16 @@ void MidiPlayer::read_all_songs_old(File *in, uint music)
}
}
-void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music)
+void MidiPlayer::read_all_songs_old(File *in, uint music, uint16 size)
+{
+ _currentSong = _songs;
+
+ _lastDelay = 0;
+
+ read_one_song(in, &_songs[0], music, size);
+}
+
+void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music, uint16 size)
{
Track *t;
uint i;
@@ -98,6 +107,9 @@ void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music)
6570, 5384, 8909, 6457, 16321, 2742, 8968, 4804, 8442, 7717,
9444, 5800, 1381, 5660, 6684, 2456, 4744, 2455, 1177, 1232,
17256, 5103, 8794, 4884, 16};
+ if (size)
+ t->data_size = size - 8;
+ else
t->data_size = music_data_size[music] - 8;
}
@@ -123,7 +135,7 @@ void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music)
}
}
-void MidiPlayer::read_one_song(File *in, Song *s, uint music)
+void MidiPlayer::read_one_song(File *in, Song *s, uint music, uint16 size)
{
_lastDelay = 0;
@@ -136,11 +148,11 @@ void MidiPlayer::read_one_song(File *in, Song *s, uint music)
switch (id) {
case 'MThd':
- read_mthd(in, s, false, music);
+ read_mthd(in, s, false, music, size);
break;
case 'GMF\x1':
- read_mthd(in, s, true, music);
+ read_mthd(in, s, true, music, size);
break;
default:
@@ -281,6 +293,9 @@ bool MidiPlayer::fill_helper(NoteRec *nr, MidiEvent *me)
void MidiPlayer::reset_tracks()
{
+ if (_midi_sfx_toggle)
+ return;
+
Track *t;
uint i;