diff -ur ScummVM-cvs20020909/scummvm/scumm/imuse.cpp ScummVM-cvs20020909+hack/scummvm/scumm/imuse.cpp
old
|
new
|
|
170 | 170 | int query_param(int param); |
171 | 171 | |
172 | 172 | int fade_vol(byte vol, int time); |
| 173 | bool is_fading_out(); |
173 | 174 | void sequencer_timer(); |
174 | 175 | }; |
175 | 176 | |
… |
… |
|
1172 | 1173 | Player *player; |
1173 | 1174 | |
1174 | 1175 | 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 | } |
1176 | 1185 | return 1; |
| 1186 | } |
1177 | 1187 | } |
1178 | 1188 | return get_queue_sound_status(sound); |
1179 | 1189 | } |
… |
… |
|
1781 | 1791 | return 0; |
1782 | 1792 | } |
1783 | 1793 | |
| 1794 | bool 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 | |
1784 | 1806 | void Player::clear() |
1785 | 1807 | { |
1786 | 1808 | uninit_seq(); |