diff options
author | Paul Gilbert | 2015-09-21 21:33:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-09-21 21:33:28 -0400 |
commit | 4850924b4759b2051a8905eac6298b724d4119e0 (patch) | |
tree | b48bfc6b5cf258dec67fdf9ccda56f5b7248eefb | |
parent | 4a8ab68327412597b9be2b22990f52d7acaddd2e (diff) | |
download | scummvm-rg350-4850924b4759b2051a8905eac6298b724d4119e0.tar.gz scummvm-rg350-4850924b4759b2051a8905eac6298b724d4119e0.tar.bz2 scummvm-rg350-4850924b4759b2051a8905eac6298b724d4119e0.zip |
SHERLOCK: RT: Start next music song when a previous one finishes
-rw-r--r-- | engines/sherlock/music.cpp | 7 | ||||
-rw-r--r-- | engines/sherlock/music.h | 6 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_map.cpp | 1 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_scene.cpp | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp index 7802bf5eeb..7ab5cd4b4f 100644 --- a/engines/sherlock/music.cpp +++ b/engines/sherlock/music.cpp @@ -397,6 +397,7 @@ bool Music::playMusic(const Common::String &name) { if (!_musicOn) return false; + _nextSongName = _currentSongName = name; debugC(kDebugLevelMusic, "Music: playMusic('%s')", name.c_str()); if (!IS_3DO) { @@ -613,4 +614,10 @@ void Music::getSongNames(Common::StringArray &songs) { Common::sort(songs.begin(), songs.end()); } +void Music::checkSongProgress() { + if (!isPlaying()) { + playMusic(_nextSongName); + } +} + } // End of namespace Sherlock diff --git a/engines/sherlock/music.h b/engines/sherlock/music.h index afd3a429be..72a5f48833 100644 --- a/engines/sherlock/music.h +++ b/engines/sherlock/music.h @@ -127,6 +127,12 @@ public: * Gets the names of all the songs in the game. Used by the debugger. */ void getSongNames(Common::StringArray &songs); + + /** + * Checks to see if the currently playing song has finished, then the music specified + * in _nextSongName will be started + */ + void checkSongProgress(); }; } // End of namespace Sherlock diff --git a/engines/sherlock/tattoo/tattoo_map.cpp b/engines/sherlock/tattoo/tattoo_map.cpp index 9aa7a513f9..8438734996 100644 --- a/engines/sherlock/tattoo/tattoo_map.cpp +++ b/engines/sherlock/tattoo/tattoo_map.cpp @@ -134,6 +134,7 @@ int TattooMap::show() { screen.slamArea(screen._currentScroll.x, screen._currentScroll.y, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_WIDTH); } + music.checkSongProgress(); checkMapNames(true); if (mousePos.x < (SHERLOCK_SCREEN_WIDTH / 6)) diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp index 816220361b..ca536f3e64 100644 --- a/engines/sherlock/tattoo/tattoo_scene.cpp +++ b/engines/sherlock/tattoo/tattoo_scene.cpp @@ -340,12 +340,14 @@ void TattooScene::doBgAnimCheckCursor() { void TattooScene::doBgAnim() { TattooEngine &vm = *(TattooEngine *)_vm; Events &events = *_vm->_events; + Music &music = *_vm->_music; TattooPeople &people = *(TattooPeople *)_vm->_people; Screen &screen = *_vm->_screen; Talk &talk = *_vm->_talk; TattooUserInterface &ui = *((TattooUserInterface *)_vm->_ui); doBgAnimCheckCursor(); + music.checkSongProgress(); talk._talkToAbort = false; |