aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-12-17 11:07:40 +0000
committerTorbjörn Andersson2003-12-17 11:07:40 +0000
commita739f3ae3b34044915d09ddb954fead713779850 (patch)
tree5316f7ff9ca01dfac62dba38c2b367c932ab4966 /sword2
parentf926ae108cd0816487eceac3c253149897a525cb (diff)
downloadscummvm-rg350-a739f3ae3b34044915d09ddb954fead713779850.tar.gz
scummvm-rg350-a739f3ae3b34044915d09ddb954fead713779850.tar.bz2
scummvm-rg350-a739f3ae3b34044915d09ddb954fead713779850.zip
The mixer handles little-endian samples now. Take advantage of that.
svn-id: r11707
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/d_draw.cpp2
-rw-r--r--sword2/driver/d_sound.cpp18
2 files changed, 3 insertions, 17 deletions
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp
index 82fa3a2415..3b0f96ca99 100644
--- a/sword2/driver/d_draw.cpp
+++ b/sword2/driver/d_draw.cpp
@@ -186,7 +186,7 @@ int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOu
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);
}
}
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 7ff29f3507..97e5c2b023 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -363,14 +363,6 @@ uint32 Sound::preFetchCompSpeech(const char *filename, uint32 speechid, uint16 *
}
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 @@ int32 Sound::playCompSpeech(const char *filename, uint32 speechid, uint8 vol, in
_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 @@ int32 Sound::openFx(int32 id, uint8 *data) {
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;