diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sky/music/gmchannel.cpp | 13 | ||||
-rw-r--r-- | engines/sky/music/gmchannel.h | 2 |
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); |