aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kyra/kyra.cpp3
-rw-r--r--kyra/sound.cpp15
2 files changed, 15 insertions, 3 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp
index 47e6472f8f..d680d58508 100644
--- a/kyra/kyra.cpp
+++ b/kyra/kyra.cpp
@@ -1763,9 +1763,6 @@ void KyraEngine::snd_playWanderScoreViaMap(int command, int restart) {
} else {
_lastMusicCommand = 1;
_midi->beginFadeOut();
- while (_midi->fadeOut()) {
- _system->delayMillis(10);
- }
}
}
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) {