diff options
author | Paweł Kołodziejski | 2004-04-08 21:13:25 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-04-08 21:13:25 +0000 |
commit | 83b7d7f84ca7f8c56288518883abe0a2898334df (patch) | |
tree | 84bafafa3e624c503cff6987b209164275f8ad8e /scumm | |
parent | 5ab0ba430bad8afd693241dd2b28048848a28020 (diff) | |
download | scummvm-rg350-83b7d7f84ca7f8c56288518883abe0a2898334df.tar.gz scummvm-rg350-83b7d7f84ca7f8c56288518883abe0a2898334df.tar.bz2 scummvm-rg350-83b7d7f84ca7f8c56288518883abe0a2898334df.zip |
fix for region code
svn-id: r13501
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse_digi/dimuse.cpp | 20 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.cpp | 5 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.h | 2 |
3 files changed, 13 insertions, 14 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp index 3a1700c25b..736e456c76 100644 --- a/scumm/imuse_digi/dimuse.cpp +++ b/scumm/imuse_digi/dimuse.cpp @@ -222,21 +222,21 @@ void IMuseDigital::switchToNextRegion(int track) { return; } - int jumpId = _sound->getJumpIdByRegionAndHookId(_track[track].soundHandle, _track[track].curRegion, _track[track].curHookId); + int jumpId = _sound->getJumpIdByRegion(_track[track].soundHandle, _track[track].curRegion); if (jumpId != -1) { int region = _sound->getRegionIdByJumpId(_track[track].soundHandle, jumpId); - if (region != -1) { - int sampleHookId = _sound->getJumpHookId(_track[track].soundHandle, jumpId); - if (sampleHookId != 0) { - if (_track[track].curHookId == sampleHookId) { - _track[track].curRegion = region; - debug(5, "switchToNextRegion-sound(%d) jump to %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId); - _track[track].curHookId = 0; - } - } else { + assert(region != -1); + int sampleHookId = _sound->getJumpHookId(_track[track].soundHandle, jumpId); + assert(sampleHookId != -1); + if (sampleHookId != 0) { + if (_track[track].curHookId == sampleHookId) { _track[track].curRegion = region; debug(5, "switchToNextRegion-sound(%d) jump to %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId); + _track[track].curHookId = 0; } + } else { + _track[track].curRegion = region; + debug(5, "switchToNextRegion-sound(%d) jump to %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId); } } diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp index afdc36d3f0..0491340407 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -395,13 +395,12 @@ int ImuseDigiSndMgr::getRegionOffset(soundStruct *soundHandle, int region) { return soundHandle->region[region].offset; } -int ImuseDigiSndMgr::getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId) { +int ImuseDigiSndMgr::getJumpIdByRegion(soundStruct *soundHandle, int region) { 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) { - if (soundHandle->jump[l].hookId == hookId) - return l; + return l; } } diff --git a/scumm/imuse_digi/dimuse_sndmgr.h b/scumm/imuse_digi/dimuse_sndmgr.h index c6055e5e0a..063775fff9 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 getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId); + int getJumpIdByRegion(soundStruct *soundHandle, int region); int getRegionIdByJumpId(soundStruct *soundHandle, int jumpId); int getJumpHookId(soundStruct *soundHandle, int number); int getJumpFade(soundStruct *soundHandle, int number); |