aboutsummaryrefslogtreecommitdiff
path: root/sound/gmidi.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2002-04-12 21:26:59 +0000
committerLudvig Strigeus2002-04-12 21:26:59 +0000
commitd2b0070c5f39661561484f8e2dfd6be271ed21cf (patch)
tree0e751495a08c9514e82879d78a977ad6f27469a7 /sound/gmidi.cpp
parentb195bb597c32384bf4ce6f9c22ffc281c0828ca4 (diff)
downloadscummvm-rg350-d2b0070c5f39661561484f8e2dfd6be271ed21cf.tar.gz
scummvm-rg350-d2b0070c5f39661561484f8e2dfd6be271ed21cf.tar.bz2
scummvm-rg350-d2b0070c5f39661561484f8e2dfd6be271ed21cf.zip
new video engine (expect broken non-sdl builds),
simon the sorcerer 1 & 2 support (non SCUMM games) svn-id: r3912
Diffstat (limited to 'sound/gmidi.cpp')
-rw-r--r--sound/gmidi.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/sound/gmidi.cpp b/sound/gmidi.cpp
index 7d90614171..9fea3c0472 100644
--- a/sound/gmidi.cpp
+++ b/sound/gmidi.cpp
@@ -523,11 +523,32 @@ void MidiSoundDriver::part_key_off(Part *part, byte note)
}
}
-void MidiSoundDriver::init(SoundEngine *eng)
+int MidiSoundDriver::midi_driver_thread(void *param) {
+ MidiSoundDriver *mid = (MidiSoundDriver*) param;
+ int old_time, cur_time;
+
+ old_time = mid->_system->get_msecs();
+
+ for(;;) {
+ mid->_system->delay_msecs(10);
+
+ cur_time = mid->_system->get_msecs();
+ while (old_time < cur_time) {
+ old_time += 10;
+ mid->_se->on_timer();
+ }
+ }
+}
+
+void MidiSoundDriver::init(SoundEngine *eng, OSystem *syst)
{
int i;
MidiChannelGM *mc;
+ _system = syst;
+
+ /* Install the on_timer thread */
+ syst->create_thread(midi_driver_thread, this);
_se = eng;
for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++)