[Scummvm-cvs-logs] SF.net SVN: scummvm:[34798] scummvm/trunk/engines/agi

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Mon Oct 13 21:17:53 CEST 2008


Revision: 34798
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34798&view=rev
Author:   buddha_
Date:     2008-10-13 19:17:51 +0000 (Mon, 13 Oct 2008)

Log Message:
-----------
Patch #2131406: AGI: Fix Crash with Apple][ Instruments.
Applied the patch as it is, thanks clone2727.
Now Apple IIGS AGI games don't crash anymore if the
instruments (They're in *.SYS16) or the instrument
samples (They're in SIERRASTANDARD) aren't found.

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

Modified: scummvm/trunk/engines/agi/sound.cpp
===================================================================
--- scummvm/trunk/engines/agi/sound.cpp	2008-10-13 18:44:30 UTC (rev 34797)
+++ scummvm/trunk/engines/agi/sound.cpp	2008-10-13 19:17:51 UTC (rev 34798)
@@ -454,7 +454,7 @@
 		_waveform = waveformMac;
 		break;
 	case SOUND_EMU_APPLE2GS:
-		loadInstruments();
+		_disabledMidi = !loadInstruments();
 		break;
 	}
 
@@ -514,6 +514,9 @@
 }
 
 void SoundMgr::playMidiSound() {
+	if (_disabledMidi)
+		return;
+
 	const uint8 *p;
 	uint8 parm1, parm2;
 	static uint8 cmd, ch;
@@ -1218,6 +1221,7 @@
 	_playing = false;
 	_sndBuffer = (int16 *)calloc(2, BUFFER_SIZE);
 	_waveform = 0;
+	_disabledMidi = false;
 }
 
 void SoundMgr::premixerCall(int16 *data, uint len) {

Modified: scummvm/trunk/engines/agi/sound.h
===================================================================
--- scummvm/trunk/engines/agi/sound.h	2008-10-13 18:44:30 UTC (rev 34797)
+++ scummvm/trunk/engines/agi/sound.h	2008-10-13 19:17:51 UTC (rev 34798)
@@ -467,6 +467,7 @@
 	int _endflag;
 	int _playingSound;
 	uint8 _env;
+	bool _disabledMidi;
 
 	int16 *_sndBuffer;
 	const int16 *_waveform;


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