diff options
author | Paweł Kołodziejski | 2002-08-08 07:48:57 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2002-08-08 07:48:57 +0000 |
commit | a92a750f48f406435f949764cbc30547fbb9e6cd (patch) | |
tree | 9c72ee4c2931620e7cc4611b6ff46a4827d3e9a0 | |
parent | cdf61fdf469d4c6e1c2fd6ecbf7e1238c13b5edb (diff) | |
download | scummvm-rg350-a92a750f48f406435f949764cbc30547fbb9e6cd.tar.gz scummvm-rg350-a92a750f48f406435f949764cbc30547fbb9e6cd.tar.bz2 scummvm-rg350-a92a750f48f406435f949764cbc30547fbb9e6cd.zip |
DIG: replaced stopBundleMusic with pauseBundleMusic in SMUSH
svn-id: r4717
-rw-r--r-- | insane.cpp | 6 | ||||
-rw-r--r-- | scumm.h | 2 | ||||
-rw-r--r-- | scummvm.cpp | 2 | ||||
-rw-r--r-- | sound.cpp | 17 |
4 files changed, 20 insertions, 7 deletions
diff --git a/insane.cpp b/insane.cpp index c2379c0bb2..2d7bad16a9 100644 --- a/insane.cpp +++ b/insane.cpp @@ -1511,7 +1511,7 @@ void SmushPlayer::startVideo(short int arg, byte *videoFile) pcd37.table_last_pitch = 0; pcd37.table_last_flags = 0; - sm->stopBundleMusic(); + sm->pauseBundleMusic(true); init(); openFile(videoFile); @@ -1530,7 +1530,7 @@ void SmushPlayer::startVideo(short int arg, byte *videoFile) _frameChanged = 1; if (ftell(_in) >= fileSize) - return; + break; #ifdef INSANE_DEBUG warning("Playing frame %d", frameIndex); #endif @@ -1562,5 +1562,5 @@ void SmushPlayer::startVideo(short int arg, byte *videoFile) sm->_insaneState = 0; sm->exitCutscene(); - + sm->pauseBundleMusic(false); } @@ -756,6 +756,7 @@ public: int32 _offsetBufBundleMusic; byte * _musicBundleBufFinal; byte * _musicBundleBufOutput; + bool _pauseBundleMusic; void setupSound(); void processSoundQues(); @@ -781,6 +782,7 @@ public: bool isSfxFinished(); void playBundleSound(char *sound); void playBundleMusic(int32 song); + void pauseBundleMusic(bool state); void stopBundleMusic(); int bundleMusicHandler(int t); void decompressBundleSound(int index); diff --git a/scummvm.cpp b/scummvm.cpp index 212dcf82cc..2298dd6356 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -194,6 +194,8 @@ void Scumm::scummInit() #endif _numberBundleMusic = -1; + _musicBundleBufFinal = NULL; + _musicBundleBufOutput = NULL; _timer->installProcedure(&autosave, 5 * 60 * 1000); } @@ -796,6 +796,7 @@ void Scumm::playBundleMusic(int32 song) { _currentSampleBundleMusic = 0; _offsetSampleBundleMusic = 0; _offsetBufBundleMusic = 0; + _pauseBundleMusic = false; _numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByIndex(song); _numberBundleMusic = song; _timer->installProcedure(&music_handler, 1000); @@ -810,13 +811,21 @@ void Scumm::playBundleMusic(int32 song) { } } +void Scumm::pauseBundleMusic(bool state) { + _pauseBundleMusic = state; +} + void Scumm::stopBundleMusic() { _timer->releaseProcedure(&music_handler); _numberBundleMusic = -1; - if (_musicBundleBufFinal) + if (_musicBundleBufFinal) { free(_musicBundleBufFinal); - if (_musicBundleBufOutput) + _musicBundleBufFinal = NULL; + } + if (_musicBundleBufOutput) { free(_musicBundleBufOutput); + _musicBundleBufOutput = NULL; + } } int Scumm::bundleMusicHandler(int t) { @@ -824,11 +833,11 @@ int Scumm::bundleMusicHandler(int t) { int32 l, num = _numberSamplesBundleMusic, length, k; int32 rate = 22050; int32 tag, size = -1, header_size = 0; - if (_numberBundleMusic == -1) - _timer->releaseProcedure(&music_handler); ptr = _musicBundleBufOutput; + if (_pauseBundleMusic) + return t; for (k = 0, l = _currentSampleBundleMusic; l < num; k++) { length = _bundle->decompressMusicSampleByIndex(_numberBundleMusic, l, (_musicBundleBufOutput + ((k * 0x2000) + _offsetBufBundleMusic))); |