diff options
author | Paweł Kołodziejski | 2004-01-15 06:37:00 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-01-15 06:37:00 +0000 |
commit | 5d9c4bfd1ea215eaa69228e7dbab8356ea665edd (patch) | |
tree | 2080245cd82f5a918aec2e7d8d95c962fd739257 /scumm/imuse_digi | |
parent | d09aea93181cfd6cde9bf3333d9dfefe834bc698 (diff) | |
download | scummvm-rg350-5d9c4bfd1ea215eaa69228e7dbab8356ea665edd.tar.gz scummvm-rg350-5d9c4bfd1ea215eaa69228e7dbab8356ea665edd.tar.bz2 scummvm-rg350-5d9c4bfd1ea215eaa69228e7dbab8356ea665edd.zip |
position should be based on data offset
svn-id: r12403
Diffstat (limited to 'scumm/imuse_digi')
-rw-r--r-- | scumm/imuse_digi/dimuse.cpp | 4 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse.h | 1 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.cpp | 6 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.h | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp index e606352f3a..6c001d1ac6 100644 --- a/scumm/imuse_digi/dimuse.cpp +++ b/scumm/imuse_digi/dimuse.cpp @@ -230,6 +230,7 @@ void IMuseDigital::switchToNextRegion(int track) { } debug(5, "switchToNextRegion-sound(%d) select %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId); + _track[track].dataOffset += _track[track].regionOffset; _track[track].regionOffset = 0; } @@ -250,6 +251,7 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, _track[l].soundGroup = soundGroup; _track[l].curHookId = hookId; _track[l].curRegion = -1; + _track[l].dataOffset = 0; _track[l].regionOffset = 0; _track[l].trackOffset = 0; _track[l].mod = 0; @@ -622,7 +624,7 @@ int32 IMuseDigital::getPosInMs(int soundId) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { _track[l].locked = true; if ((_track[l].soundId == soundId) && _track[l].used) { - int32 pos = 1000 * _track[l].trackOffset / _track[l].iteration; + int32 pos = 1000 * (_track[l].dataOffset + _track[l].regionOffset) / _track[l].iteration; _track[l].locked = false; return pos; } diff --git a/scumm/imuse_digi/dimuse.h b/scumm/imuse_digi/dimuse.h index c5a841a880..3f0744a3ef 100644 --- a/scumm/imuse_digi/dimuse.h +++ b/scumm/imuse_digi/dimuse.h @@ -54,6 +54,7 @@ private: bool started; int32 regionOffset; int32 trackOffset; + int32 dataOffset; bool sequence; int curRegion; int curHookId; diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp index bdc6acf4ff..0ff6b32be0 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -331,6 +331,12 @@ int ImuseDigiSndMgr::getNumMarkers(soundStruct *soundHandle) { return soundHandle->numMarkers; } +int ImuseDigiSndMgr::getRegionOffset(soundStruct *soundHandle, int region) { + assert(soundHandle && checkForProperHandle(soundHandle)); + assert(region >= 0 && region < soundHandle->numRegions); + return soundHandle->region[region].offset; +} + int ImuseDigiSndMgr::getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId) { assert(soundHandle && checkForProperHandle(soundHandle)); assert(region >= 0 && region < soundHandle->numRegions); diff --git a/scumm/imuse_digi/dimuse_sndmgr.h b/scumm/imuse_digi/dimuse_sndmgr.h index 4522b62235..146d3c93db 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.h +++ b/scumm/imuse_digi/dimuse_sndmgr.h @@ -124,6 +124,7 @@ public: int getNumRegions(soundStruct *soundHandle); int getNumJumps(soundStruct *soundHandle); int getNumMarkers(soundStruct *soundHandle); + int getRegionOffset(soundStruct *soundHandle, int region); int getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId); int getRegionIdByJumpId(soundStruct *soundHandle, int jumpId); int getJumpHookId(soundStruct *soundHandle, int number); |