aboutsummaryrefslogtreecommitdiff
path: root/engines/sky
diff options
context:
space:
mode:
authorRobert Göffringmann2007-03-18 17:58:26 +0000
committerRobert Göffringmann2007-03-18 17:58:26 +0000
commit139608f451b40a3cb341188f9cd77bb8037b6352 (patch)
tree18dfce6f406a6bfae7354789f2c7a7b4f068044e /engines/sky
parentdd61b256349d3eabb57e45625913e29a6437eb90 (diff)
downloadscummvm-rg350-139608f451b40a3cb341188f9cd77bb8037b6352.tar.gz
scummvm-rg350-139608f451b40a3cb341188f9cd77bb8037b6352.tar.bz2
scummvm-rg350-139608f451b40a3cb341188f9cd77bb8037b6352.zip
Fixed bug #1678349: BASS: music is off, but drum track plays
svn-id: r26219
Diffstat (limited to 'engines/sky')
-rw-r--r--engines/sky/music/gmchannel.cpp13
-rw-r--r--engines/sky/music/gmchannel.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/engines/sky/music/gmchannel.cpp b/engines/sky/music/gmchannel.cpp
index 3ba6d46969..460cea545e 100644
--- a/engines/sky/music/gmchannel.cpp
+++ b/engines/sky/music/gmchannel.cpp
@@ -39,7 +39,7 @@ GmChannel::GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv
_veloTab = veloTab;
_musicVolume = 0x7F;
- _lastVolume = 0xFF;
+ _currentChannelVolume = 0x7F;
}
GmChannel::~GmChannel(void) {
@@ -55,10 +55,9 @@ void GmChannel::updateVolume(uint16 pVolume) {
_musicVolume = pVolume;
if (_musicVolume > 0)
_musicVolume = (_musicVolume * 2) / 3 + 43;
- if (_lastVolume < 0xFF) {
- uint8 newVol = (_lastVolume * _musicVolume) >> 7;
- _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
- }
+
+ uint8 newVol = (_currentChannelVolume * _musicVolume) >> 7;
+ _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
}
void GmChannel::stopNote(void) {
@@ -175,8 +174,8 @@ void GmChannel::com90_getPitch(void) {
void GmChannel::com90_getChannelVolume(void) {
- _lastVolume = _musicData[_channelData.eventDataPtr];
- uint8 newVol = (uint8)((_musicData[_channelData.eventDataPtr++] * _musicVolume) >> 7);
+ _currentChannelVolume = _musicData[_channelData.eventDataPtr++];
+ uint8 newVol = (uint8)((_currentChannelVolume * _musicVolume) >> 7);
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
}
diff --git a/engines/sky/music/gmchannel.h b/engines/sky/music/gmchannel.h
index c3031d73f2..ffe898a400 100644
--- a/engines/sky/music/gmchannel.h
+++ b/engines/sky/music/gmchannel.h
@@ -53,7 +53,7 @@ private:
uint8 *_musicData;
uint16 _musicVolume;
MidiChannelType _channelData;
- uint8 _lastVolume;
+ uint8 _currentChannelVolume;
//- normal subs
void setRegister(uint8 regNum, uint8 value);
int32 getNextEventTime(void);