aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2008-01-20 17:02:28 +0000
committerPaweł Kołodziejski2008-01-20 17:02:28 +0000
commit77838d91e65ddeccd53ce93d9d37632123a4d174 (patch)
tree065740b8af4c8af987f6cb82fcb97aa289885b89
parenteafc9f58f2c58452e64cdd28d12fdba326514b93 (diff)
downloadscummvm-rg350-77838d91e65ddeccd53ce93d9d37632123a4d174.tar.gz
scummvm-rg350-77838d91e65ddeccd53ce93d9d37632123a4d174.tar.bz2
scummvm-rg350-77838d91e65ddeccd53ce93d9d37632123a4d174.zip
fix/workaround for bug #1624464, as we do not support game playing on two different CDs
svn-id: r30588
-rw-r--r--engines/scumm/imuse_digi/dimuse.cpp11
-rw-r--r--engines/scumm/imuse_digi/dimuse_sndmgr.cpp8
-rw-r--r--engines/scumm/imuse_digi/dimuse_track.cpp14
3 files changed, 26 insertions, 7 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp
index c883bdf2e9..db5ec9dafe 100644
--- a/engines/scumm/imuse_digi/dimuse.cpp
+++ b/engines/scumm/imuse_digi/dimuse.cpp
@@ -166,11 +166,14 @@ void IMuseDigital::saveOrLoad(Serializer *ser) {
// TODO: The code below has a lot in common with that in IMuseDigital::startSound.
// Try to refactor them to reduce the code duplication.
- track->soundDesc = _sound->openSound(track->soundId,
- track->soundName, track->soundType,
- track->volGroupId, -1);
+ track->soundDesc = _sound->openSound(track->soundId, track->soundName, track->soundType, track->volGroupId, -1);
+ if (!track->soundDesc)
+ track->soundDesc = _sound->openSound(track->soundId, track->soundName, track->soundType, track->volGroupId, 1);
+ if (!track->soundDesc)
+ track->soundDesc = _sound->openSound(track->soundId, track->soundName, track->soundType, track->volGroupId, 2);
+
if (!track->soundDesc) {
- warning("IMuseDigital::saveOrLoad: Can't open sound so will not be resumed, propably on diffrent CD");
+ warning("IMuseDigital::saveOrLoad: Can't open sound so will not be resumed");
track->used = false;
continue;
}
diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
index aab53fc449..5600ac21a1 100644
--- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -497,9 +497,15 @@ void ImuseDigiSndMgr::closeSound(SoundDesc *soundDesc) {
}
ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::cloneSound(SoundDesc *soundDesc) {
+ ImuseDigiSndMgr::SoundDesc *desc;
assert(checkForProperHandle(soundDesc));
- return openSound(soundDesc->soundId, soundDesc->name, soundDesc->type, soundDesc->volGroupId, soundDesc->disk);
+ desc = openSound(soundDesc->soundId, soundDesc->name, soundDesc->type, soundDesc->volGroupId, soundDesc->disk);
+ if (!desc)
+ desc = openSound(soundDesc->soundId, soundDesc->name, soundDesc->type, soundDesc->volGroupId, 1);
+ if (!desc)
+ desc = openSound(soundDesc->soundId, soundDesc->name, soundDesc->type, soundDesc->volGroupId, 2);
+ return desc;
}
bool ImuseDigiSndMgr::checkForProperHandle(SoundDesc *soundDesc) {
diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp
index 1729cadf87..111f3acbde 100644
--- a/engines/scumm/imuse_digi/dimuse_track.cpp
+++ b/engines/scumm/imuse_digi/dimuse_track.cpp
@@ -116,8 +116,12 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType,
} else {
strcpy(track->soundName, soundName);
track->soundDesc = _sound->openSound(soundId, soundName, soundType, volGroupId, -1);
+ if (!track->soundDesc)
+ track->soundDesc = _sound->openSound(soundId, soundName, soundType, volGroupId, 1);
+ if (!track->soundDesc)
+ track->soundDesc = _sound->openSound(soundId, soundName, soundType, volGroupId, 2);
- if (track->soundDesc == NULL)
+ if (!track->soundDesc)
return;
track->sndDataExtComp = _sound->isSndDataExtComp(track->soundDesc);
@@ -353,7 +357,13 @@ Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) {
// Clone the sound.
// leaving bug number for now #1635361
- track->soundDesc = _sound->cloneSound(track->soundDesc);
+ ImuseDigiSndMgr::SoundDesc *soundDesc = _sound->cloneSound(track->soundDesc);
+ if (!soundDesc) {
+ // it fail load open old song after switch to diffrent CDs
+ // so gave up
+ error("Game not supported while playing on 2 diffrent CDs");
+ }
+ track->soundDesc = soundDesc;
// Set the volume fading parameters to indicate a fade out
fadeTrack->volFadeDelay = fadeDelay;