mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-26 11:46:54 +00:00
fixed 'region' code
svn-id: r13526
This commit is contained in:
parent
6d4839d376
commit
95c17148ae
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user