diff options
author | Paweł Kołodziejski | 2004-04-09 21:44:29 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-04-09 21:44:29 +0000 |
commit | 95c17148aeef394d27d2055b4764f32ca1dcdade (patch) | |
tree | f0dca4780d1c0c6093f3c9015e6be5fbf11aef84 /scumm | |
parent | 6d4839d376a0eabd1cd5251e0a5b3f74deff798a (diff) | |
download | scummvm-rg350-95c17148aeef394d27d2055b4764f32ca1dcdade.tar.gz scummvm-rg350-95c17148aeef394d27d2055b4764f32ca1dcdade.tar.bz2 scummvm-rg350-95c17148aeef394d27d2055b4764f32ca1dcdade.zip |
fixed 'region' code
svn-id: r13526
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse_digi/dimuse.cpp | 4 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.cpp | 5 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.h | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp index 3c58872e33..19c5ce80b7 100644 --- a/scumm/imuse_digi/dimuse.cpp +++ b/scumm/imuse_digi/dimuse.cpp @@ -222,7 +222,9 @@ void IMuseDigital::switchToNextRegion(int track) { return; } - int jumpId = _sound->getJumpIdByRegion(_track[track].soundHandle, _track[track].curRegion); + int jumpId = _sound->getJumpIdByRegionAndHookId(_track[track].soundHandle, _track[track].curRegion, _track[track].curHookId); + if (jumpId == -1) + jumpId = _sound->getJumpIdByRegionAndHookId(_track[track].soundHandle, _track[track].curRegion, 0); if (jumpId != -1) { int region = _sound->getRegionIdByJumpId(_track[track].soundHandle, jumpId); assert(region != -1); diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp index 010283c916..67a12475f4 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -404,12 +404,13 @@ int ImuseDigiSndMgr::getRegionOffset(soundStruct *soundHandle, int region) { return soundHandle->region[region].offset; } -int ImuseDigiSndMgr::getJumpIdByRegion(soundStruct *soundHandle, int region) { +int ImuseDigiSndMgr::getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId) { assert(soundHandle && checkForProperHandle(soundHandle)); assert(region >= 0 && region < soundHandle->numRegions); for (int l = 0; l < soundHandle->numJumps; l++) { if (soundHandle->jump[l].offset == soundHandle->region[region].offset) { - return l; + if (soundHandle->jump[l].hookId == hookId) + return l; } } diff --git a/scumm/imuse_digi/dimuse_sndmgr.h b/scumm/imuse_digi/dimuse_sndmgr.h index 063775fff9..c6055e5e0a 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.h +++ b/scumm/imuse_digi/dimuse_sndmgr.h @@ -115,7 +115,7 @@ public: int getNumRegions(soundStruct *soundHandle); int getNumJumps(soundStruct *soundHandle); int getRegionOffset(soundStruct *soundHandle, int region); - int getJumpIdByRegion(soundStruct *soundHandle, int region); + int getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId); int getRegionIdByJumpId(soundStruct *soundHandle, int jumpId); int getJumpHookId(soundStruct *soundHandle, int number); int getJumpFade(soundStruct *soundHandle, int number); |