[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
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sword2/driver d_sound.cpp,1.133,1.134
- Next message: [Scummvm-cvs-logs] CVS: scummvm/kyra codecs.cpp,1.8,1.9 codecs.h,1.4,1.5 cpsimage.cpp,1.4,1.5 font.cpp,1.5,1.6 kyra.cpp,1.23,1.24 kyra.h,1.8,1.9 palette.cpp,1.5,1.6 resource.cpp,1.8,1.9 resource.h,1.6,1.7 script.cpp,1.9,1.10 script.h,1.5,1.6 script_v1.cpp,1.7,1.8 sound.cpp,1.2,1.3 sound.h,1.2,1.3 wsamovie.cpp,1.5,1.6 wsamovie.h,1.4,1.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
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;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sword2/driver d_sound.cpp,1.133,1.134
- Next message: [Scummvm-cvs-logs] CVS: scummvm/kyra codecs.cpp,1.8,1.9 codecs.h,1.4,1.5 cpsimage.cpp,1.4,1.5 font.cpp,1.5,1.6 kyra.cpp,1.23,1.24 kyra.h,1.8,1.9 palette.cpp,1.5,1.6 resource.cpp,1.8,1.9 resource.h,1.6,1.7 script.cpp,1.9,1.10 script.h,1.5,1.6 script_v1.cpp,1.7,1.8 sound.cpp,1.2,1.3 sound.h,1.2,1.3 wsamovie.cpp,1.5,1.6 wsamovie.h,1.4,1.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list