aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/script_v8.cpp2
-rw-r--r--scumm/sound.cpp4
-rw-r--r--scumm/sound.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index b6339f3d09..a0a5242d03 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -1497,7 +1497,7 @@ void ScummEngine_v8::o8_kernelGetFunctions() {
case 0xE1: // imGetMusicPosition
warning("o8_kernelGetFunctions: imGetMusicPosition(stub)");
// FIXME - get this stuff to be properly implemented
- push(_sound->_bundleMusicPosition);
+ push(_sound->_bundleSongPosInMs);
break;
case 0xE2: // musicLipSyncWidth
case 0xE3: // musicLipSyncHeight
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 91e3e60466..32c2fb26be 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -1039,6 +1039,7 @@ void Sound::playBundleMusic(const char *song) {
_offsetSampleBundleMusic = 0;
_offsetBufBundleMusic = 0;
_bundleMusicPosition = 0;
+ _bundleSongPosInMs = 0;
_pauseBundleMusic = false;
_musicBundleToBeChanged = false;
_bundleMusicTrack = 0;
@@ -1087,6 +1088,7 @@ void Sound::bundleMusicHandler(ScummEngine *scumm) {
_offsetBufBundleMusic = 0;
_musicBundleToBeChanged = false;
_bundleMusicPosition = 0;
+ _bundleSongPosInMs = 0;
}
ptr = _musicBundleBufOutput;
@@ -1153,6 +1155,7 @@ void Sound::bundleMusicHandler(ScummEngine *scumm) {
_offsetSampleBundleMusic = 0;
_offsetBufBundleMusic = 0;
_bundleMusicPosition = 0;
+ _bundleSongPosInMs = 0;
}
ptr = _musicBundleBufFinal;
@@ -1170,6 +1173,7 @@ void Sound::bundleMusicHandler(ScummEngine *scumm) {
return;
}
+ _bundleSongPosInMs = (_bundleMusicPosition * 5) / (_outputMixerSize / 200);
_bundleMusicPosition += final_size;
if (_bundleMusicTrack == 0) {
_scumm->_mixer->newStream(&_bundleMusicTrack, buffer, final_size, rate,
diff --git a/scumm/sound.h b/scumm/sound.h
index eb9ff522a7..28e9d135a6 100644
--- a/scumm/sound.h
+++ b/scumm/sound.h
@@ -42,6 +42,7 @@ protected:
public:
const char *_nameBundleMusic;
int32 _bundleMusicPosition;
+ int32 _bundleSongPosInMs;
protected:
const char *_newNameBundleMusic;