diff options
author | Filippos Karapetis | 2010-01-01 19:23:23 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-01 19:23:23 +0000 |
commit | 98194bfe1307a7dc5b75546fb17c447844d6d5f9 (patch) | |
tree | de3605d10711de4e8d61e2e78e6cf447fb4e5b95 | |
parent | 74159e12eb77dfc7c9fc47ecd962395aa8fbbbab (diff) | |
download | scummvm-rg350-98194bfe1307a7dc5b75546fb17c447844d6d5f9.tar.gz scummvm-rg350-98194bfe1307a7dc5b75546fb17c447844d6d5f9.tar.bz2 scummvm-rg350-98194bfe1307a7dc5b75546fb17c447844d6d5f9.zip |
SCI/new music code: The MIDI driver is now reset whenever the game's VM respawns, like what the old music code does. Fixes the MIDI music in KQ5CD, Lonbgow and perhaps others
svn-id: r46843
-rw-r--r-- | engines/sci/engine/vm.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sfx/music.cpp | 1 | ||||
-rw-r--r-- | engines/sci/sfx/soundcmd.cpp | 6 | ||||
-rw-r--r-- | engines/sci/sfx/soundcmd.h | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 504f70b7ed..9eb3b85981 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1812,6 +1812,8 @@ static EngineState *_game_run(EngineState *&s, int restoring) { game_init(s); #ifdef USE_OLD_MUSIC_FUNCTIONS s->_sound.sfx_reset_player(); +#else + s->_soundCmd->resetDriver(); #endif _init_stack_base_with_selector(s, s->_kernel->_selectorCache.play); diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp index 2287151a89..beba2699f8 100644 --- a/engines/sci/sfx/music.cpp +++ b/engines/sci/sfx/music.cpp @@ -163,7 +163,6 @@ void SciMusic::resetDriver() { _pMidiDrv->close(); _pMidiDrv->open(); _pMidiDrv->setTimerCallback(this, &miditimerCallback); - _dwTempo = _pMidiDrv->getBaseTempo(); } static int f_compare(const void *arg1, const void *arg2) { diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp index 5ebbfb1206..b673af95aa 100644 --- a/engines/sci/sfx/soundcmd.cpp +++ b/engines/sci/sfx/soundcmd.cpp @@ -1010,4 +1010,10 @@ void SoundCommandParser::printPlayList(Console *con) { #endif } +void SoundCommandParser::resetDriver() { +#ifndef USE_OLD_MUSIC_FUNCTIONS + _music->resetDriver(); +#endif +} + } // End of namespace Sci diff --git a/engines/sci/sfx/soundcmd.h b/engines/sci/sfx/soundcmd.h index f241c2864b..04f1abc77e 100644 --- a/engines/sci/sfx/soundcmd.h +++ b/engines/sci/sfx/soundcmd.h @@ -58,6 +58,7 @@ public: void syncPlayList(Common::Serializer &s); void reconstructPlayList(int savegame_version); void printPlayList(Console *con); + void resetDriver(); #ifndef USE_OLD_MUSIC_FUNCTIONS /** |