[Scummvm-cvs-logs] scummvm master -> dee4fd193d690baae5afaf906d7604a9df9155ef
dreammaster
dreammaster at scummvm.org
Fri Oct 17 03:54:35 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
dee4fd193d MADS: Fix stopping digital audio, music, and palette cycling when animation ends
Commit: dee4fd193d690baae5afaf906d7604a9df9155ef
https://github.com/scummvm/scummvm/commit/dee4fd193d690baae5afaf906d7604a9df9155ef
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-16T21:53:21-04:00
Commit Message:
MADS: Fix stopping digital audio, music, and palette cycling when animation ends
Changed paths:
engines/mads/audio.cpp
engines/mads/audio.h
engines/mads/menu_views.cpp
diff --git a/engines/mads/audio.cpp b/engines/mads/audio.cpp
index 9d62c3f..def2cd6 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 21f4bed..13c540b 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 6acf6cd..857db68 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;
}
More information about the Scummvm-git-logs
mailing list