aboutsummaryrefslogtreecommitdiff
path: root/kyra/sound.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2006-01-12 15:38:04 +0000
committerJohannes Schickel2006-01-12 15:38:04 +0000
commit7398e8648750db34110931f8f88f1623fcbc8d02 (patch)
tree48a1c1accc4411d05f71e2222bf5b8602c17ea0f /kyra/sound.cpp
parentf0544b2e6bfbb8cf51c44215e8dafd377d7cfa05 (diff)
downloadscummvm-rg350-7398e8648750db34110931f8f88f1623fcbc8d02.tar.gz
scummvm-rg350-7398e8648750db34110931f8f88f1623fcbc8d02.tar.bz2
scummvm-rg350-7398e8648750db34110931f8f88f1623fcbc8d02.zip
Fixed some issues with fading sound.
svn-id: r19990
Diffstat (limited to 'kyra/sound.cpp')
-rw-r--r--kyra/sound.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/kyra/sound.cpp b/kyra/sound.cpp
index 07895d3fb5..baf097b398 100644
--- a/kyra/sound.cpp
+++ b/kyra/sound.cpp
@@ -234,6 +234,10 @@ void MusicPlayer::stopMusic() {
_parser = 0;
delete [] _parserSource;
_parserSource = 0;
+
+ _fadeStartTime = 0;
+ _fadeMusicOut = false;
+ setVolume(255);
}
}
@@ -263,6 +267,17 @@ void MusicPlayer::onTimer(void *refCon) {
music->_fadeMusicOut = false;
music->_isLooping = false;
music->_isPlaying = false;
+
+ music->_eventFromMusic = true;
+ // from sound/midiparser.cpp
+ for (int i = 0; i < 128; ++i) {
+ for (int j = 0; j < 16; ++j) {
+ music->send(0x80 | j | i << 8);
+ }
+ }
+ for (int i = 0; i < 16; ++i) {
+ music->send(0x007BB0 | i);
+ }
}
if (music->_isPlaying) {