aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mads/audio.cpp4
-rw-r--r--engines/mads/audio.h1
-rw-r--r--engines/mads/menu_views.cpp9
3 files changed, 13 insertions, 1 deletions
diff --git a/engines/mads/audio.cpp b/engines/mads/audio.cpp
index 9d62c3f615..def2cd6c62 100644
--- a/engines/mads/audio.cpp
+++ b/engines/mads/audio.cpp
@@ -129,4 +129,8 @@ void AudioPlayer::playSound(int soundIndex, bool loop) {
*/
}
+void AudioPlayer::stop() {
+ _mixer->stopHandle(_handle);
+}
+
} // End of namespace M4
diff --git a/engines/mads/audio.h b/engines/mads/audio.h
index 21f4bed59a..13c540bf85 100644
--- a/engines/mads/audio.h
+++ b/engines/mads/audio.h
@@ -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;
diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp
index 6acf6cdf9f..857db68fa6 100644
--- a/engines/mads/menu_views.cpp
+++ b/engines/mads/menu_views.cpp
@@ -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;
}