aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2009-03-17 04:07:56 +0000
committerTravis Howell2009-03-17 04:07:56 +0000
commit4a45b4408cf93896bd28f2ca83a8196f69812b21 (patch)
treeb0388ed3c86ac188992f7077095c89692b2e0a65 /engines
parent2e321f81ed11b647e7caebf9111d7437c72f8bd1 (diff)
downloadscummvm-rg350-4a45b4408cf93896bd28f2ca83a8196f69812b21.tar.gz
scummvm-rg350-4a45b4408cf93896bd28f2ca83a8196f69812b21.tar.bz2
scummvm-rg350-4a45b4408cf93896bd28f2ca83a8196f69812b21.zip
Sound files don't always exist in the Amiga version of BRA.
svn-id: r39469
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/sound.h2
-rw-r--r--engines/parallaction/sound_br.cpp12
2 files changed, 11 insertions, 3 deletions
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h
index 3a66aea049..140d4d974d 100644
--- a/engines/parallaction/sound.h
+++ b/engines/parallaction/sound.h
@@ -236,7 +236,7 @@ class AmigaSoundMan_br : public SoundMan_br {
uint32 flags;
} _channels[NUM_AMIGA_CHANNELS];
- void loadChannelData(const char *filename, Channel *ch);
+ bool loadChannelData(const char *filename, Channel *ch);
public:
AmigaSoundMan_br(Parallaction_br *vm);
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 4851d11b94..5083ead2c1 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -447,12 +447,18 @@ AmigaSoundMan_br::~AmigaSoundMan_br() {
stopSfx(3);
}
-void AmigaSoundMan_br::loadChannelData(const char *filename, Channel *ch) {
+bool AmigaSoundMan_br::loadChannelData(const char *filename, Channel *ch) {
Common::ReadStream *stream = _vm->_disk->loadSound(filename);
+ // NOTE: Sound files don't always exist
+ if (!stream)
+ return false;
+
Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
decoder.decode();
ch->dispose = true;
delete stream;
+
+ return true;
}
void AmigaSoundMan_br::playSfx(const char *filename, uint channel, bool looping, int volume) {
@@ -466,7 +472,8 @@ void AmigaSoundMan_br::playSfx(const char *filename, uint channel, bool looping,
debugC(1, kDebugAudio, "AmigaSoundMan_ns::playSfx(%s, %i)", filename, channel);
Channel *ch = &_channels[channel];
- loadChannelData(filename, ch);
+ if (!loadChannelData(filename, ch))
+ return;
uint32 loopStart, loopEnd, flags;
if (looping) {
@@ -509,6 +516,7 @@ void AmigaSoundMan_br::playMusic() {
debugC(1, kDebugAudio, "AmigaSoundMan_ns::playMusic()");
Common::SeekableReadStream *stream = _vm->_disk->loadMusic(_musicFile.c_str());
+ // NOTE: Music files don't always exist
if (!stream)
return;