diff options
-rw-r--r-- | scumm/bundle.h | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 5 | ||||
-rw-r--r-- | scumm/sound.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/scumm/bundle.h b/scumm/bundle.h index c4c9c68a41..0c29e7f960 100644 --- a/scumm/bundle.h +++ b/scumm/bundle.h @@ -44,7 +44,6 @@ struct BundleAudioTable { int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size, int32 index, int32 & channels); CompTable *_compVoiceTable; CompTable *_compMusicTable; - File _voiceFile; BundleAudioTable *_bundleVoiceTable; BundleAudioTable *_bundleMusicTable; int32 _numVoiceFiles; @@ -60,6 +59,7 @@ public: ~Bundle(); File _musicFile; + File _voiceFile; 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 618c1651d0..bc72f183a5 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1140,7 +1140,12 @@ int Sound::playBundleSound(char *sound) { if (_scumm->_gameId == GID_CMI) { char voxfile[20]; sprintf(voxfile, "voxdisk%d.bun", _scumm->_vars[_scumm->VAR_CURRENTDISK]); + if (_voiceDisk != _scumm->_vars[_scumm->VAR_CURRENTDISK]) + _scumm->_bundle->_voiceFile.close(); + result = _scumm->_bundle->openVoiceFile(voxfile, _scumm->getGameDataPath()); + + _voiceDisk = (byte)_scumm->_vars[_scumm->VAR_CURRENTDISK]; } else if (_scumm->_gameId == GID_DIG) result = _scumm->_bundle->openVoiceFile("digvoice.bun", _scumm->getGameDataPath()); else diff --git a/scumm/sound.h b/scumm/sound.h index 3604142746..7ef1a9538f 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -45,6 +45,7 @@ enum { char * _nameBundleMusic; char * _newNameBundleMusic; byte _musicDisk; + byte _voiceDisk; int32 _currentSampleBundleMusic; int32 _numberSamplesBundleMusic; int32 _offsetSampleBundleMusic; |