[Scummvm-cvs-logs] CVS: scummvm/sword2 mouse.cpp,1.54,1.55 save_rest.cpp,1.50,1.51 sword2.cpp,1.106,1.107

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sat Mar 27 04:19:02 CET 2004


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8907

Modified Files:
	mouse.cpp save_rest.cpp sword2.cpp 
Log Message:
Make sure looping music is restarted after loading a savegame, regardless
of how the savegame is loaded. (ScummVM adds two alternative methods: the
-x command-line parameter, and the restart/restore dialog at the beginning
of the game, which is only shown when there are savegames available.)


Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/mouse.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- mouse.cpp	17 Mar 2004 09:03:14 -0000	1.54
+++ mouse.cpp	27 Mar 2004 12:07:06 -0000	1.55
@@ -246,20 +246,15 @@
 	_sound->unpauseFx();
 
 	// If there was looping music before coming into the control panels
-	// then restart it! NB. This will also start music required when a game
-	// has been restored
+	// then restart it! NB. If a game has been restored the music will be
+	// restarted twice, but this shouldn't cause any harm.
 
 	if (_loopingMusicId) {
 		pars[0] = _loopingMusicId;
 		pars[1] = FX_LOOP;
 		_logic->fnPlayMusic(pars);
-
-		// cross-fades into the required music: either a restored game
-		// tune, or music playing prior to entering control panels
-	} else {
-		// stop the control panel music
+	} else
 		_logic->fnStopMusic(NULL);
-	}
 }
 
 void Sword2Engine::dragMouse(void) {

Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/save_rest.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- save_rest.cpp	17 Mar 2004 09:03:15 -0000	1.50
+++ save_rest.cpp	27 Mar 2004 12:07:06 -0000	1.51
@@ -404,6 +404,17 @@
 
 	_loopingMusicId = _saveGameHeader.music_id;
 
+	// Restart any looping music. Originally this was - and still is - done
+	// in systemMenuMouse(), but with ScummVM we have other ways of
+	// restoring savegames so it's easier to put it here as well.
+
+	if (_loopingMusicId) {
+		pars[0] = _loopingMusicId;
+		pars[1] = FX_LOOP;
+		_logic->fnPlayMusic(pars);
+	} else
+		_logic->fnStopMusic(NULL);
+
 	// Write to walkthrough file (zebug0.txt)
 
 	debug(5, "RESTORED GAME \"%s\"", _saveGameHeader.description);

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- sword2.cpp	17 Mar 2004 09:03:15 -0000	1.106
+++ sword2.cpp	27 Mar 2004 12:07:07 -0000	1.107
@@ -320,7 +320,10 @@
 		setMouse(NORMAL_MOUSE_ID);
 		_logic->fnPlayMusic(pars);
 		result = _gui->startControl();
-		_logic->fnStopMusic(NULL);
+
+		// If the game is started from the beginning, the cutscene
+		// player will kill the music for us. Otherwise, the restore
+		// will either have killed the music, or done a crossfade.
 
 		if (_quit)
 			return;





More information about the Scummvm-git-logs mailing list