aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/music.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2013-11-16 20:18:39 -0500
committerMatthew Hoops2013-11-20 21:36:16 -0500
commit55583214ad7f421c59b2b742c43a49ae372fc824 (patch)
treeed762946fe2bd91723f070e545088ec622bebf35 /engines/sword1/music.cpp
parentb1b9844f3d7562bea7c512ada326b60c10b0c8d3 (diff)
downloadscummvm-rg350-55583214ad7f421c59b2b742c43a49ae372fc824.tar.gz
scummvm-rg350-55583214ad7f421c59b2b742c43a49ae372fc824.tar.bz2
scummvm-rg350-55583214ad7f421c59b2b742c43a49ae372fc824.zip
Revert "SWORD1: Let the XA audio use its own looping"
This reverts commit 481a5e0e7c65674728eb31694a787723166a72ae. Turns out that not all the sounds have the built-in loop flag, such as the piano in the Hotel Ubu.
Diffstat (limited to 'engines/sword1/music.cpp')
-rw-r--r--engines/sword1/music.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index c34630aceb..f31faffd5e 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -110,7 +110,7 @@ bool MusicHandle::play(const Common::String &filename, bool loop) {
return true;
}
-bool MusicHandle::playPSX(uint16 id) {
+bool MusicHandle::playPSX(uint16 id, bool loop) {
stop();
if (!_file.isOpen())
@@ -131,7 +131,7 @@ bool MusicHandle::playPSX(uint16 id) {
// not over file size
if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) {
_file.seek(offset, SEEK_SET);
- _audioSource = Audio::makeXAStream(_file.readStream(size), 11025);
+ _audioSource = Audio::makeLoopingAudioStream(Audio::makeXAStream(_file.readStream(size), 11025), loop ? 0 : 1);
fadeUp();
} else {
_audioSource = NULL;
@@ -297,7 +297,7 @@ void Music::startMusic(int32 tuneId, int32 loopFlag) {
the mutex before, to have the soundthread playing normally.
As the corresponding _converter is NULL, the handle will be ignored by the playing thread */
if (SwordEngine::isPsx()) {
- if (_handles[newStream].playPSX(tuneId)) {
+ if (_handles[newStream].playPSX(tuneId, loopFlag != 0)) {
_mutex.lock();
_converter[newStream] = Audio::makeRateConverter(_handles[newStream].getRate(), _mixer->getOutputRate(), _handles[newStream].isStereo(), false);
_mutex.unlock();