aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-10-16 21:53:21 -0400
committerPaul Gilbert2014-10-16 21:53:21 -0400
commitdee4fd193d690baae5afaf906d7604a9df9155ef (patch)
tree97609b31307cea99f6a7419679062fc8a23fd333 /engines
parentfa5c22393138034efceb908e012f6783b65f36f5 (diff)
downloadscummvm-rg350-dee4fd193d690baae5afaf906d7604a9df9155ef.tar.gz
scummvm-rg350-dee4fd193d690baae5afaf906d7604a9df9155ef.tar.bz2
scummvm-rg350-dee4fd193d690baae5afaf906d7604a9df9155ef.zip
MADS: Fix stopping digital audio, music, and palette cycling when animation ends
Diffstat (limited to 'engines')
-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;
}