aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-12-27 16:49:58 +0000
committerMax Horn2003-12-27 16:49:58 +0000
commitf6ff11509ccc3494e5160865b8f7fe38c6a75581 (patch)
treee3f13bd6ba5a43c4f36aa9971aeac773687d191a
parentc0cc941ea4be1190f7a046c7c36b55918e907c31 (diff)
downloadscummvm-rg350-f6ff11509ccc3494e5160865b8f7fe38c6a75581.tar.gz
scummvm-rg350-f6ff11509ccc3494e5160865b8f7fe38c6a75581.tar.bz2
scummvm-rg350-f6ff11509ccc3494e5160865b8f7fe38c6a75581.zip
update bundle music every 1/10th of a sec (there was a very noticable delay before music started playing at e.g. the chapter 1 screen in COMI
svn-id: r11975
-rw-r--r--scumm/imuse_digi.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp
index 6d730d64dc..d1ef25c8ae 100644
--- a/scumm/imuse_digi.cpp
+++ b/scumm/imuse_digi.cpp
@@ -1206,6 +1206,8 @@ void IMuseDigital::music_handler(void *refCon) {
((IMuseDigital *)refCon)->bundleMusicHandler();
}
+#define BUNDLE_MUSIC_ITER_PER_SEC 10
+
void IMuseDigital::playBundleMusic(const char *song) {
if (!_scumm->_mixer->isReady()) {
return;
@@ -1253,7 +1255,8 @@ void IMuseDigital::playBundleMusic(const char *song) {
_musicBundleToBeChanged = false;
_numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByName(song);
_nameBundleMusic = song;
- _scumm->_timer->installTimerProc(&music_handler, 1000000, this);
+ _outputMixerSize /= BUNDLE_MUSIC_ITER_PER_SEC;
+ _scumm->_timer->installTimerProc(&music_handler, 1000000 / BUNDLE_MUSIC_ITER_PER_SEC, this);
} else if (strcmp(_nameBundleMusic, song) != 0) {
_newNameBundleMusic = song;
_musicBundleToBeChanged = true;
@@ -1381,7 +1384,7 @@ void IMuseDigital::bundleMusicHandler() {
// gives the number of bytes used for one second, so if we compute the value of
// (_bundleMusicPosition / _outputMixerSize), that is an offset in seconds;
// multiplying that by 1000 gives milliseconds).
- _bundleSongPosInMs = 1000 * _bundleMusicPosition / _outputMixerSize;
+ _bundleSongPosInMs = 1000 * _bundleMusicPosition / (_outputMixerSize * BUNDLE_MUSIC_ITER_PER_SEC);
_bundleMusicPosition += final_size;
if (!_bundleMusicTrack.isActive())
_scumm->_mixer->newStream(&_bundleMusicTrack, rate, SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, 300000);