[Scummvm-cvs-logs] SF.net SVN: scummvm:[40886] scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
waltervn at users.sourceforge.net
waltervn at users.sourceforge.net
Mon May 25 14:38:20 CEST 2009
Revision: 40886
http://scummvm.svn.sourceforge.net/scummvm/?rev=40886&view=rev
Author: waltervn
Date: 2009-05-25 12:38:20 +0000 (Mon, 25 May 2009)
Log Message:
-----------
SCI: Adlib: fix crash in SQ4.
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
Modified: scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp 2009-05-25 11:44:24 UTC (rev 40885)
+++ scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp 2009-05-25 12:38:20 UTC (rev 40886)
@@ -443,17 +443,15 @@
_voices[voice].age = 0;
- if (channel == 9) {
+ if ((channel == 9) && _rhythmKeyMap) {
patch = CLIP(note, 27, 88) + 101;
} else {
patch = _channels[channel].patch;
}
// Set patch if different from current patch
- if ((patch != _voices[voice].patch) && _playSwitch) {
- _voices[voice].patch = patch;
+ if ((patch != _voices[voice].patch) && _playSwitch)
setPatch(voice, patch);
- }
_voices[voice].velocity = velocity;
setNote(voice, note, true);
@@ -567,9 +565,10 @@
void MidiDriver_Adlib::setPatch(int voice, int patch) {
if ((patch < 0) || ((uint)patch >= _patches.size())) {
warning("ADLIB: Invalid patch %i requested", patch);
- return;
+ patch = 0;
}
+ _voices[voice].patch = patch;
AdlibModulator &mod = _patches[patch].mod;
// Set the common settings for both operators
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