[Scummvm-cvs-logs] scummvm master -> 4850924b4759b2051a8905eac6298b724d4119e0

dreammaster dreammaster at scummvm.org
Tue Sep 22 03:33:58 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4850924b47 SHERLOCK: RT: Start next music song when a previous one finishes


Commit: 4850924b4759b2051a8905eac6298b724d4119e0
    https://github.com/scummvm/scummvm/commit/4850924b4759b2051a8905eac6298b724d4119e0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-09-21T21:33:28-04:00

Commit Message:
SHERLOCK: RT: Start next music song when a previous one finishes

Changed paths:
    engines/sherlock/music.cpp
    engines/sherlock/music.h
    engines/sherlock/tattoo/tattoo_map.cpp
    engines/sherlock/tattoo/tattoo_scene.cpp



diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 7802bf5..7ab5cd4 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 afd3a42..72a5f48 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 9aa7a51..8438734 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 8162203..ca536f3 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;
 






More information about the Scummvm-git-logs mailing list