aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2003-01-12 19:15:30 +0000
committerJames Brown2003-01-12 19:15:30 +0000
commit374e3a3f261a13dc68de8ccad9fae96970387312 (patch)
tree63143f1fdcdb9c83a8b9021ca41feca7565f4aef
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
-rw-r--r--scumm/bundle.h2
-rw-r--r--scumm/sound.cpp11
2 files changed, 10 insertions, 3 deletions
diff --git a/scumm/bundle.h b/scumm/bundle.h
index 84b3c6f797..d4d2df7850 100644
--- a/scumm/bundle.h
+++ b/scumm/bundle.h
@@ -45,7 +45,6 @@ struct BundleAudioTable {
CompTable _compVoiceTable[50];
CompTable _compMusicTable[2500];
File _voiceFile;
- File _musicFile;
BundleAudioTable *_bundleVoiceTable;
BundleAudioTable *_bundleMusicTable;
int32 _numVoiceFiles;
@@ -60,6 +59,7 @@ public:
Bundle();
~Bundle();
+ File _musicFile;
void initializeImcTables();
bool openVoiceFile(const char *filename, const char *directory);
bool openMusicFile(const char *filename, const char *directory);
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)