Ticket #8038: fadefix.diff

File fadefix.diff, 1.3 KB (added by eriktorbjorn, 22 years ago)

Patch against a September 9 CVS snapshot

  • scummvm/scumm/imuse.cpp

    diff -ur ScummVM-cvs20020909/scummvm/scumm/imuse.cpp ScummVM-cvs20020909+hack/scummvm/scumm/imuse.cpp
    old new  
    170170        int query_param(int param);
    171171
    172172        int fade_vol(byte vol, int time);
     173        bool is_fading_out();
    173174        void sequencer_timer();
    174175};
    175176
     
    11721173        Player *player;
    11731174
    11741175        for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
    1175                 if (player->_active && player->_id == (uint16)sound)
     1176                if (player->_active && player->_id == (uint16)sound) {
     1177                        // Assume that anyone asking for the sound status is
     1178                        // really asking "is it ok if I start playing this
     1179                        // sound now?" So if the sound is about to fade out,
     1180                        // shut it down and pretend it wasn't playing.
     1181                        if (player->is_fading_out()) {
     1182                                player->clear();
     1183                                continue;
     1184                        }
    11761185                        return 1;
     1186                }
    11771187        }
    11781188        return get_queue_sound_status(sound);
    11791189}
     
    17811791        return 0;
    17821792}
    17831793
     1794bool Player::is_fading_out()
     1795{
     1796        VolumeFader *vf = _se->_volume_fader;
     1797        int i;
     1798
     1799        for (i = 0; i < 8; i++, vf++) {
     1800                if (vf->active && vf->direction < 0 && vf->player == this)
     1801                        return true;
     1802        }
     1803        return false;
     1804}
     1805
    17841806void Player::clear()
    17851807{
    17861808        uninit_seq();