[Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.64,1.65 sound.cpp,1.48,1.49

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Tue Jan 11 00:32:25 CET 2005


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

Modified Files:
	anims.cpp sound.cpp 
Log Message:
Use Fingolfin's new WAV code.


Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/anims.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- anims.cpp	1 Jan 2005 15:07:01 -0000	1.64
+++ anims.cpp	11 Jan 2005 08:31:14 -0000	1.65
@@ -462,18 +462,16 @@
 }
 
 int32 Logic::fnSmackerLeadIn(int32 *params) {
-	byte *leadIn;
-	uint32 rv;
-
 	// params:	0 id of lead-in music
-	leadIn = _vm->_resman->openResource(params[0]);
+	byte *leadIn = _vm->_resman->openResource(params[0]);
 
 	StandardHeader *header = (StandardHeader *) leadIn;
 	assert(header->fileType == WAV_FILE);
 
 	leadIn += sizeof(StandardHeader);
-	// wav data gets copied to sound memory
-	rv = _vm->_sound->playFx(0, leadIn, 0, 0, RDSE_FXLEADIN);
+
+	uint32 len = _vm->_resman->fetchLen(params[0]) - sizeof(StandardHeader);
+	uint32 rv = _vm->_sound->playFx(0, len, leadIn, 0, 0, RDSE_FXLEADIN);
 
 	if (rv)
 		debug(5, "SFX ERROR: playFx() returned %.8x", rv);
@@ -500,6 +498,7 @@
 	char filename[30];
 	MovieTextObject *sequenceSpeechArray[MAX_SEQUENCE_TEXT_LINES + 1];
 	byte *leadOut = NULL;
+	uint32 leadOutLen = 0;
 
 	// The original code had some #ifdef blocks for skipping or muting the
 	// cutscenes - fondly described as "the biggest fudge in the history
@@ -529,9 +528,9 @@
 		assert(header->fileType == WAV_FILE);
 
 		leadOut += sizeof(StandardHeader);
-	}
 
-	// play the smacker
+		leadOutLen = _vm->_resman->fetchLen(_smackerLeadOut) - sizeof(StandardHeader);
+	}
 
 	// don't want to carry on streaming game music when smacker starts!
 	fnStopMusic(NULL);
@@ -543,9 +542,9 @@
  	uint32 rv;
 
 	if (_sequenceTextLines && !_scriptVars[DEMO])
-		rv = player.play(filename, sequenceSpeechArray, leadOut);
+		rv = player.play(filename, sequenceSpeechArray, leadOut, leadOutLen);
 	else
-		rv = player.play(filename, NULL, leadOut);
+		rv = player.play(filename, NULL, leadOut, leadOutLen);
 
 	// check the error return-value
 	if (rv)

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sound.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- sound.cpp	1 Jan 2005 15:07:03 -0000	1.48
+++ sound.cpp	11 Jan 2005 08:31:14 -0000	1.49
@@ -128,7 +128,9 @@
 	else
 		type = RDSE_FXSPOT;
 
-	uint32 rv = _sound->playFx(i + 1, fxQueue[i].data, fxQueue[i].volume, fxQueue[i].pan, type);
+	uint32 len = _resman->fetchLen(fxQueue[i].resource) - sizeof(StandardHeader);
+	uint32 rv = _sound->playFx(i + 1, len, fxQueue[i].data,	fxQueue[i].volume, fxQueue[i].pan, type);
+
 	if (rv)
 		debug(5, "SFX ERROR: playFx() returned %.8x", rv);
 }





More information about the Scummvm-git-logs mailing list