aboutsummaryrefslogtreecommitdiff
path: root/engines/touche
diff options
context:
space:
mode:
Diffstat (limited to 'engines/touche')
-rw-r--r--engines/touche/touche.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index 5338387be9..ada12099c3 100644
--- a/engines/touche/touche.cpp
+++ b/engines/touche/touche.cpp
@@ -3335,12 +3335,14 @@ void ToucheEngine::initMusic() {
void ToucheEngine::startMusic(int num) {
debug(1, "startMusic(%d)", num);
uint32 size;
+
+ stopMusic();
+
if (_midiPlayer) {
const uint32 offs = res_getDataOffset(kResourceTypeMusic, num, &size);
_fData.seek(offs);
_midiPlayer->play(_fData, size, true);
} else {
- _extMusicFile.close();
Common::String extMusicFilename = Common::String::format("track%02d.ogg", num);
if (!_extMusicFile.open(extMusicFilename)) {
error("Unable to open %s for reading", extMusicFilename.c_str());
@@ -3358,6 +3360,7 @@ void ToucheEngine::stopMusic() {
_midiPlayer->stop();
else {
_mixer->stopHandle(_musicHandle);
+ _extMusicFile.close();
}
}