[Scummvm-cvs-logs] SF.net SVN: scummvm:[39469] scummvm/trunk/engines/parallaction

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Mar 17 05:07:56 CET 2009


Revision: 39469
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39469&view=rev
Author:   Kirben
Date:     2009-03-17 04:07:56 +0000 (Tue, 17 Mar 2009)

Log Message:
-----------
Sound files don't always exist in the Amiga version of BRA.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/sound.h
    scummvm/trunk/engines/parallaction/sound_br.cpp

Modified: scummvm/trunk/engines/parallaction/sound.h
===================================================================
--- scummvm/trunk/engines/parallaction/sound.h	2009-03-17 04:07:02 UTC (rev 39468)
+++ scummvm/trunk/engines/parallaction/sound.h	2009-03-17 04:07:56 UTC (rev 39469)
@@ -236,7 +236,7 @@
 		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);

Modified: scummvm/trunk/engines/parallaction/sound_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/sound_br.cpp	2009-03-17 04:07:02 UTC (rev 39468)
+++ scummvm/trunk/engines/parallaction/sound_br.cpp	2009-03-17 04:07:56 UTC (rev 39469)
@@ -447,12 +447,18 @@
 	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 @@
 	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 @@
 	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;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list