[Scummvm-cvs-logs] CVS: scummvm/sword2/driver d_draw.cpp,1.47,1.48 d_sound.cpp,1.83,1.84

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Wed Dec 17 03:08:03 CET 2003


Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv18463/driver

Modified Files:
	d_draw.cpp d_sound.cpp 
Log Message:
The mixer handles little-endian samples now. Take advantage of that.


Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_draw.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- d_draw.cpp	14 Dec 2003 16:32:21 -0000	1.47
+++ d_draw.cpp	17 Dec 2003 11:07:40 -0000	1.48
@@ -186,7 +186,7 @@
 				openTextObject(text[textCounter]);
 				drawTextObject(text[textCounter]);
 				if (text[textCounter]->speech) {
-					_vm->_mixer->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, SoundMixer::FLAG_16BITS);
+					_vm->_mixer->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN);
 				}
 			}
 

Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_sound.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- d_sound.cpp	2 Dec 2003 07:41:04 -0000	1.83
+++ d_sound.cpp	17 Dec 2003 11:07:40 -0000	1.84
@@ -363,14 +363,6 @@
 	}
 
 	free(data8);
-
-#ifndef SCUMM_BIG_ENDIAN
-	// Until the mixer supports LE samples natively, we need to convert
-	// our LE ones to BE
-	for (uint j = 0; j < bufferSize / 2; j++)
-		data16[j] = SWAP_BYTES_16(data16[j]);
-#endif
-
 	return bufferSize;
 }
 
@@ -406,7 +398,7 @@
 
 		_speechPaused = true;
 			
-		uint32 flags = SoundMixer::FLAG_16BITS | SoundMixer::FLAG_AUTOFREE;
+		uint32 flags = SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN | SoundMixer::FLAG_AUTOFREE;
 
 		_vm->_mixer->playRaw(&_soundHandleSpeech, data16, bufferSize, 22050, flags, -1, volume, p);
 
@@ -596,17 +588,11 @@
 			free(_fx[fxi]._buf);
 		_fx[fxi]._buf = (uint16 *) malloc(_fx[fxi]._bufSize);
 		memcpy(_fx[fxi]._buf, (uint8 *) (data32 + 2), _fx[fxi]._bufSize);
-		_fx[fxi]._flags = SoundMixer::FLAG_16BITS;
+		_fx[fxi]._flags = SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN;
 		if (FROM_LE_16(wav->channels) == 2)
 			_fx[fxi]._flags |= SoundMixer::FLAG_STEREO;
 
 		_fx[fxi]._rate = FROM_LE_16(wav->samplesPerSec);
-
-		// Until the mixer supports LE samples natively, we need to
-		// convert our LE ones to BE
-		for (int32 j = 0; j < _fx[fxi]._bufSize / 2; j++)
-			_fx[fxi]._buf[j] = SWAP_BYTES_16(_fx[fxi]._buf[j]);
-
 		_fx[fxi]._id = id;
 	}
 	return RD_OK;





More information about the Scummvm-git-logs mailing list