aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-01-09 22:36:40 +0000
committerPaweł Kołodziejski2004-01-09 22:36:40 +0000
commit9d7d23a7c6c938b9b205d7237ed21433a38a5914 (patch)
tree88ba535ead8583a217e0ac7226f4f5f928ee1f5b
parentd96ec8672b10fdebe11f6bdca3284773a6b4fdc4 (diff)
downloadscummvm-rg350-9d7d23a7c6c938b9b205d7237ed21433a38a5914.tar.gz
scummvm-rg350-9d7d23a7c6c938b9b205d7237ed21433a38a5914.tar.bz2
scummvm-rg350-9d7d23a7c6c938b9b205d7237ed21433a38a5914.zip
some changes to sync stuff
svn-id: r12286
-rw-r--r--scumm/imuse_digi/dimuse.cpp3
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp19
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.h3
3 files changed, 11 insertions, 14 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp
index 65f601b865..779ee89028 100644
--- a/scumm/imuse_digi/dimuse.cpp
+++ b/scumm/imuse_digi/dimuse.cpp
@@ -585,8 +585,7 @@ void IMuseDigital::getLipSync(int soundId, int syncId, int32 msPos, int32 &width
if (msPos < 65536) {
for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) {
if ((_track[l].idSound == soundId) && _track[l].used) {
- sync_size = _sound->getSyncSizeById(_track[l].soundHandle, syncId);
- sync_ptr = _sound->getSyncPtrById(_track[l].soundHandle, syncId);
+ _sound->getSyncSizeAndPtrById(_track[l].soundHandle, syncId, sync_size, &sync_ptr);
if ((sync_size != 0) && (sync_ptr != NULL)) {
sync_size /= 4;
while (sync_size--) {
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 87848d7853..d10c04f100 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -352,18 +352,17 @@ int ImuseDigiSndMgr::getJumpIdByRegionId(soundStruct *soundHandle, int number) {
return -1;
}
-int ImuseDigiSndMgr::getSyncSizeById(soundStruct *soundHandle, int number) {
+void ImuseDigiSndMgr::getSyncSizeAndPtrById(soundStruct *soundHandle, int number, int32 &sync_size, byte **sync_ptr) {
Common::StackLock tmpLock(_mutex);
assert(soundHandle && checkForProperHandle(soundHandle));
- assert(number >= 0 && number < soundHandle->numSyncs);
- return soundHandle->sync[number].size;
-}
-
-byte *ImuseDigiSndMgr::getSyncPtrById(soundStruct *soundHandle, int number) {
- Common::StackLock tmpLock(_mutex);
- assert(soundHandle && checkForProperHandle(soundHandle));
- assert(number >= 0 && number < soundHandle->numSyncs);
- return soundHandle->sync[number].ptr;
+ assert(number >= 0);
+ if (number < soundHandle->numSyncs) {
+ sync_size = soundHandle->sync[number].size;
+ *sync_ptr = soundHandle->sync[number].ptr;
+ } else {
+ sync_size = 0;
+ *sync_ptr = NULL;
+ }
}
int ImuseDigiSndMgr::getRegionIdByHookId(soundStruct *soundHandle, int number) {
diff --git a/scumm/imuse_digi/dimuse_sndmgr.h b/scumm/imuse_digi/dimuse_sndmgr.h
index 710ca62654..4131cb8313 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.h
+++ b/scumm/imuse_digi/dimuse_sndmgr.h
@@ -130,8 +130,7 @@ public:
int getJumpHookId(soundStruct *soundHandle, int number);
int getJumpFade(soundStruct *soundHandle, int number);
char *getMarker(soundStruct *soundHandle, int number);
- int getSyncSizeById(soundStruct *soundHandle, int number);
- byte *getSyncPtrById(soundStruct *soundHandle, int number);
+ void getSyncSizeAndPtrById(soundStruct *soundHandle, int number, int32 &sync_size, byte **sync_ptr);
int32 getDataFromRegion(soundStruct *soundHandle, int region, byte **buf, int32 offset, int32 size);
};