aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2003-01-20 05:59:25 +0000
committerJonathan Gray2003-01-20 05:59:25 +0000
commit846d73c53686da151a83f310096421aa23676e74 (patch)
tree60f9f3df7f6903b090fb67e1e7459be8beda704e
parent26fa144a9df5439f584dcc88586043f4fe310b22 (diff)
downloadscummvm-rg350-846d73c53686da151a83f310096421aa23676e74.tar.gz
scummvm-rg350-846d73c53686da151a83f310096421aa23676e74.tar.bz2
scummvm-rg350-846d73c53686da151a83f310096421aa23676e74.zip
patch #670660 by Daniel Schepler, properly handle disc switching wrt voice file in comi
svn-id: r6522
-rw-r--r--scumm/bundle.h2
-rw-r--r--scumm/sound.cpp5
-rw-r--r--scumm/sound.h1
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;