Ticket #8066: imuse.nonullplayer.diff

File imuse.nonullplayer.diff, 2.4 KB (added by SF/jamieson630, 19 years ago)

Patch against a September 24 CVS snapshot

  • scummvm/scumm/imuse.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
    retrieving revision 1.12
    diff -u -r1.12 imuse.cpp
     
    31043106
    31053107void Part::set_detune(int8 detune)
    31063108{
    3107         _detune_eff = clamp((_detune = detune) + _player->_detune, -128, 127);
     3109        _detune_eff = clamp((_detune = detune) + (_player ? _player->_detune : 0), -128, 127);
    31083110        changed(IMuseDriver::pcMod);
    31093111}
    31103112
     
    31163118
    31173119void Part::set_vol(uint8 vol)
    31183120{
    3119         _vol_eff = ((_vol = vol) + 1) * _player->_vol_eff >> 7;
     3121        _vol_eff = ((_vol = vol) + 1) * (_player ? _player->_vol_eff : 0) >> 7;
    31203122        changed(IMuseDriver::pcVolume);
    31213123}
    31223124
    31233125void Part::set_pri(int8 pri)
    31243126{
    3125         _pri_eff = clamp((_pri = pri) + _player->_priority, 0, 255);
     3127        _pri_eff = clamp((_pri = pri) + (_player ? _player->_priority : 0), 0, 255);
    31263128}
    31273129
    31283130void Part::set_pan(int8 pan)
    31293131{
    3130         _pan_eff = clamp((_pan = pan) + _player->_pan, -64, 63);
     3132        _pan_eff = clamp((_pan = pan) + (_player ? _player->_pan : 0), -64, 63);
    31313133        changed(IMuseDriver::pcPan);
    31323134}
    31333135
    31343136void Part::set_transpose(int8 transpose)
    31353137{
    3136         _transpose_eff = transpose_clamp((_transpose = transpose) + _player->_transpose, -12, 12);
     3138        _transpose_eff = transpose_clamp((_transpose = transpose) + (_player ? _player->_transpose : 0), -12, 12);
    31373139        changed(IMuseDriver::pcMod);
    31383140}
    31393141
     
    43724511                midiNoteOn(mc->_chan, note, velocity);
    43734512        } else if (part->_percussion) {
    43744513                midiVolume(PERCUSSION_CHANNEL, part->_vol_eff);
    4375                 midiProgram(PERCUSSION_CHANNEL, part->_bank, part->_player->_mt32emulate);
     4514                midiProgram(PERCUSSION_CHANNEL, part->_bank, (part->_player ? part->_player->_mt32emulate : false));
    43764515                midiNoteOn(PERCUSSION_CHANNEL, note, velocity);
    43774516        }
    43784517}
     
    45914731        if (what & pcProgram) {
    45924732                if (part->_bank) {
    45934733                        midiControl0(mc->_chan, part->_bank);
    4594                         midiProgram(mc->_chan, part->_program, part->_player->_mt32emulate);
     4734                        midiProgram(mc->_chan, part->_program, (part->_player ? part->_player->_mt32emulate : false));
    45954735                        midiControl0(mc->_chan, 0);
    45964736                } else {
    4597                         midiProgram(mc->_chan, part->_program, part->_player->_mt32emulate);
     4737                        midiProgram(mc->_chan, part->_program, (part->_player ? part->_player->_mt32emulate : false));
    45984738                }
    45994739        }
    46004740