[Scummvm-cvs-logs] CVS: scummvm/sword2 function.cpp,1.64,1.65

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sat Sep 4 02:28:26 CEST 2004


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

Modified Files:
	function.cpp 
Log Message:
Added support for compressed music. I'm sure there are some glitches still
to fix, but it should work well enough for now.

In this rewrite of the music code, I removed the "save/restore music state"
function, since it just complicated things for a very small gain. It wasn't
in the original engine, and I added it just for the credits, so that the
previously playing music could be resumed afterwards. I might re-add it
later, but probably not.


Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/function.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- function.cpp	10 Jun 2004 06:48:50 -0000	1.64
+++ function.cpp	4 Sep 2004 09:27:16 -0000	1.65
@@ -369,6 +369,8 @@
 #define CREDITS_LINE_SPACING 20
 
 int32 Logic::fnPlayCredits(int32 *params) {
+	uint32 loopingMusicId = _vm->_loopingMusicId;
+
 	// This function just quits the game if this is the playable demo, ie.
 	// credits are NOT played in the demo any more!
 
@@ -383,11 +385,8 @@
 
 	_vm->setMouse(0);
 
-	_vm->_sound->saveMusicState();
-
 	_vm->_sound->muteFx(true);
 	_vm->_sound->muteSpeech(true);
-	_vm->_sound->stopMusic();
 
 	_vm->_graphics->waitForFade();
 	_vm->_graphics->fadeDown();
@@ -703,10 +702,16 @@
 	if (_vm->_quit)
 		return IR_CONT;
 
-	_vm->_sound->restoreMusicState();
 	_vm->_sound->muteFx(false);
 	_vm->_sound->muteSpeech(false);
 
+	if (loopingMusicId) {
+		pars[0] = loopingMusicId;
+		pars[1] = FX_LOOP;
+		fnPlayMusic(pars);
+	} else
+		fnStopMusic(NULL);
+
 	_vm->_thisScreen.new_palette = 99;
 
 	if (!_vm->_mouseStatus || _choosing)





More information about the Scummvm-git-logs mailing list