From 5adb6277eb3bf0badd6d2403177ce4411c89ee13 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 27 Dec 2009 23:46:11 +0000 Subject: SCI/new music code: - Switched to Common::StackLock for mutexes - Renamed Music::stopAll() -> Music::clearPlayList() - Implemented a better Music::stopAll method, which stops all sounds with proper signals, instead of destroying them - Renamed the SCI0 command cmdGetPlayNext -> cmdStopAllSounds and implemented it svn-id: r46665 --- engines/sci/engine/game.cpp | 2 +- engines/sci/engine/savegame.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index d6b4c9cdb7..633d01f7f4 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -441,7 +441,7 @@ int game_exit(EngineState *s) { game_init_sound(s, SFX_STATE_FLAG_NOSOUND, s->detectDoSoundType()); #else s->_audio->stopAllAudio(); - s->_soundCmd->_music->stopAll(); + s->_soundCmd->_music->clearPlayList(); #endif } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 7c0b33a6d6..7677157f48 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -619,7 +619,7 @@ static void sync_songlib(Common::Serializer &s, SongLibrary &obj) { void SciMusic::saveLoadWithSerializer(Common::Serializer &s) { // Sync song lib data. When loading, the actual song lib will be initialized // afterwards in gamestate_restore() - _mutex.lock(); + Common::StackLock lock(_mutex); int songcount = 0; byte masterVolume = soundGetMasterVolume(); @@ -645,7 +645,7 @@ void SciMusic::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsUint32LE(songcount); if (s.isLoading()) { - stopAll(); + clearPlayList(); for (int i = 0; i < songcount; i++) { MusicEntry *curSong = new MusicEntry(); @@ -657,8 +657,6 @@ void SciMusic::saveLoadWithSerializer(Common::Serializer &s) { syncSong(s, _playList[i]); } } - - _mutex.unlock(); } #endif -- cgit v1.2.3