mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
MADS: Fix stopping digital audio, music, and palette cycling when animation ends
This commit is contained in:
@@ -129,4 +129,8 @@ void AudioPlayer::playSound(int soundIndex, bool loop) {
|
||||
*/
|
||||
}
|
||||
|
||||
void AudioPlayer::stop() {
|
||||
_mixer->stopHandle(_handle);
|
||||
}
|
||||
|
||||
} // End of namespace M4
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
void setSoundGroup(const Common::String &filename);
|
||||
void setDefaultSoundGroup();
|
||||
void playSound(int soundIndex, bool loop = false);
|
||||
void stop();
|
||||
void setVolume(int volume);
|
||||
bool isPlaying() const;
|
||||
|
||||
|
||||
@@ -475,6 +475,13 @@ AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) {
|
||||
}
|
||||
|
||||
AnimationView::~AnimationView() {
|
||||
// Turn off palette cycling as well as any playing sound
|
||||
Scene &scene = _vm->_game->_scene;
|
||||
scene._cyclingActive = false;
|
||||
_vm->_sound->stop();
|
||||
_vm->_audio->stop();
|
||||
|
||||
// Delete data
|
||||
delete _currentAnimation;
|
||||
delete _sceneInfo;
|
||||
}
|
||||
@@ -505,7 +512,7 @@ void AnimationView::display() {
|
||||
bool AnimationView::onEvent(Common::Event &event) {
|
||||
// Wait for the Escape key or a mouse press
|
||||
if (((event.type == Common::EVENT_KEYDOWN) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) ||
|
||||
(event.type == Common::EVENT_RBUTTONUP)) {
|
||||
(event.type == Common::EVENT_LBUTTONUP)) {
|
||||
scriptDone();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user