fixed 'region' code

svn-id: r13526
This commit is contained in:
Paweł Kołodziejski 2004-04-09 21:44:29 +00:00
parent 6d4839d376
commit 95c17148ae
3 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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);