[Scummvm-cvs-logs] CVS: scummvm/sword1 music.cpp,1.35,1.36 sound.cpp,1.41,1.42

Max Horn fingolfin at users.sourceforge.net
Sun Jan 9 07:58:16 CET 2005


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

Modified Files:
	music.cpp sound.cpp 
Log Message:
Mark some places which probably should use loadWAVFromStream(); maybe some of the engine maintainers can look into using it

Index: music.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/music.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- music.cpp	1 Jan 2005 16:09:24 -0000	1.35
+++ music.cpp	9 Jan 2005 15:57:38 -0000	1.36
@@ -26,6 +26,7 @@
 #include "common/file.h"
 #include "sound/mp3.h"
 #include "sound/vorbis.h"
+#include "sound/wave.h"
 
 #define SMP_BUFSIZE 8192
 
@@ -43,6 +44,15 @@
 	_sampleBuf = (uint8*)malloc(SMP_BUFSIZE);
 	_sourceFile->incRef();
 	if (_sourceFile->isOpen()) {
+		// TODO: use loadWAVFromStream to load the WAVE data!
+		/*
+		int rate, size;
+		bye flags;
+		const uint32 initialPos = _sourceFile->pos();
+		isValidWAV = loadWAVFromStream(*_sourceFile, size, rate, flags);
+		*/
+
+
 		_sourceFile->read(wavHeader, WAVEHEADERSIZE);
 		_isStereo = (READ_LE_UINT16(wavHeader + 0x16) == 2);
 		_rate = READ_LE_UINT16(wavHeader + 0x18);

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sound.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- sound.cpp	1 Jan 2005 16:09:25 -0000	1.41
+++ sound.cpp	9 Jan 2005 15:57:38 -0000	1.42
@@ -28,6 +28,7 @@
 
 #include "sound/mp3.h"
 #include "sound/vorbis.h"
+#include "sound/wave.h"
 
 namespace Sword1 {
 
@@ -221,6 +222,15 @@
 	_cowFile.seek(index);
 	_cowFile.read(fBuf, cSize);
 	uint32 headerPos = 0;
+
+	// TODO: use loadWAVFromStream to load the WAVE data!
+	/*
+	int rate, size;
+	bye flags;
+	Common::MemoryReadStream stream(fBuf, cSize);
+	isValidWAV = loadWAVFromStream(stream, size, rate, flags);
+	*/
+
 	while ((READ_BE_UINT32(fBuf + headerPos) != 'data') && (headerPos < 100))
 		headerPos++;
 	if (headerPos < 100) {
@@ -235,9 +245,9 @@
 			if (READ_LE_UINT16(fBuf + headerPos) == 1) {				
 				resSize = READ_LE_UINT16(fBuf + headerPos + 2);
 				resSize |= READ_LE_UINT16(fBuf + headerPos + 6) << 16;
-				resSize >>= 1;
 			} else
-				resSize = READ_LE_UINT32(fBuf + headerPos + 2) >> 1;
+				resSize = READ_LE_UINT32(fBuf + headerPos + 2);
+			resSize >>= 1;
 		}
 		assert(!(headerPos & 1));
 		int16 *srcData = (int16*)fBuf;





More information about the Scummvm-git-logs mailing list