diff options
author | Jamieson Christian | 2003-08-16 09:34:19 +0000 |
---|---|---|
committer | Jamieson Christian | 2003-08-16 09:34:19 +0000 |
commit | 121b00a6f718f4b691c77708120083da2fedd018 (patch) | |
tree | 9a28315710f3a7b870ccecd4637bb1fe78f4974a /scumm/imuse.cpp | |
parent | 8281c2eecc64a1d4a97cc29e2f0af7bfc14cbf3a (diff) | |
download | scummvm-rg350-121b00a6f718f4b691c77708120083da2fedd018.tar.gz scummvm-rg350-121b00a6f718f4b691c77708120083da2fedd018.tar.bz2 scummvm-rg350-121b00a6f718f4b691c77708120083da2fedd018.zip |
Corrected timing mechanism for RO music streams.
RO streams have built-in timer markers (the
unknown 0xA0 mentioned in FR [742249]) that
override automated methods of updating
VAR_MUSIC_TIMER. Since these timer markers
do not seem to be present in AD resources, the
old mechanism is used if MD_ADLIB is the current
MidiDriver.
svn-id: r9720
Diffstat (limited to 'scumm/imuse.cpp')
-rw-r--r-- | scumm/imuse.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 542fcbeb78..ceed012148 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -317,6 +317,21 @@ void IMuseInternal::on_timer(MidiDriver *midi) { sequencer_timers(midi); } +int IMuseInternal::getMusicTimer() { + int best_time = 0; + Player *player = _players; + int i; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + if (player->isActive()) { + int timer = player->getMusicTimer(); + if (timer > best_time) + best_time = timer; + } + } + return best_time / 1000000; +} + void IMuseInternal::sequencer_timers(MidiDriver *midi) { Player *player = _players; int i; @@ -1744,6 +1759,7 @@ int IMuse::stopSound(int sound) { in(); int ret = _target->stopSound(sound); out int IMuse::stop_all_sounds() { in(); int ret = _target->stop_all_sounds(); out(); return ret; } int IMuse::getSoundStatus(int sound) { in(); int ret = _target->getSoundStatus(sound, true); out(); return ret; } bool IMuse::get_sound_active(int sound) { in(); bool ret = _target->getSoundStatus(sound, false) ? 1 : 0; out(); return ret; } +int IMuse::getMusicTimer() { in(); int ret = _target->getMusicTimer(); out(); return ret; } int32 IMuse::doCommand (int a, int b, int c, int d, int e, int f, int g, int h) { in(); int32 ret = _target->doCommand(a,b,c,d,e,f,g,h); out(); return ret; } int32 IMuse::doCommand (int numargs, int args[]) { in(); int32 ret = _target->doCommand (numargs, args); out(); return ret; } int IMuse::clear_queue() { in(); int ret = _target->clear_queue(); out(); return ret; } |