aboutsummaryrefslogtreecommitdiff
path: root/scumm/sound.cpp
diff options
context:
space:
mode:
authorJames Brown2003-01-12 19:15:30 +0000
committerJames Brown2003-01-12 19:15:30 +0000
commit374e3a3f261a13dc68de8ccad9fae96970387312 (patch)
tree63143f1fdcdb9c83a8b9021ca41feca7565f4aef /scumm/sound.cpp
parent458ecbffcff89f7d10dcdd0abcb9afec793515ae (diff)
downloadscummvm-rg350-374e3a3f261a13dc68de8ccad9fae96970387312.tar.gz
scummvm-rg350-374e3a3f261a13dc68de8ccad9fae96970387312.tar.bz2
scummvm-rg350-374e3a3f261a13dc68de8ccad9fae96970387312.zip
Fix ComI music bundle switching on disk change
svn-id: r6434
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r--scumm/sound.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index cd634d5c33..95a92caf23 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -40,6 +40,7 @@ Sound::Sound(Scumm *parent) {
_nameBundleMusic = NULL;
_musicBundleBufFinal = NULL;
_musicBundleBufOutput = NULL;
+ _musicDisk = 0;
_talkChannel = -1;
}
@@ -960,9 +961,15 @@ void Sound::playBundleMusic(char * song) {
if (_scumm->_gameId == GID_CMI) {
char bunfile[20];
sprintf(bunfile, "musdisk%d.bun", _scumm->_vars[_scumm->VAR_CURRENTDISK]);
- printf("Opening bundle\n");
- if (_scumm->_bundle->openMusicFile(bunfile, _scumm->getGameDataPath()) == false)
+ if (_musicDisk != _scumm->_vars[_scumm->VAR_CURRENTDISK])
+ _scumm->_bundle->_musicFile.close();
+
+ if (_scumm->_bundle->openMusicFile(bunfile, _scumm->getGameDataPath()) == false) {
+ _outputMixerSize = 0;
return;
+ }
+
+ _musicDisk = _scumm->_vars[_scumm->VAR_CURRENTDISK];
_outputMixerSize = 88140; // ((22050 * 2 * 2)
} else {
if (_scumm->_bundle->openMusicFile("digmusic.bun", _scumm->getGameDataPath()) == false)