diff options
author | Paweł Kołodziejski | 2004-04-09 05:43:24 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-04-09 05:43:24 +0000 |
commit | 5763122a69d7f33b93601a73c0add87576f2ce37 (patch) | |
tree | 8e41c6e58718ebed669e37ae4f23da72b391e4f4 /scumm | |
parent | d368d2e7fa03670c5f0a468caab1dda7da217ac2 (diff) | |
download | scummvm-rg350-5763122a69d7f33b93601a73c0add87576f2ce37.tar.gz scummvm-rg350-5763122a69d7f33b93601a73c0add87576f2ce37.tar.bz2 scummvm-rg350-5763122a69d7f33b93601a73c0add87576f2ce37.zip |
back refreshScript only for DIG, add stopping music while changing bundle
svn-id: r13513
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse_digi/dimuse.h | 1 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_script.cpp | 14 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_sndmgr.cpp | 13 | ||||
-rw-r--r-- | scumm/scumm.cpp | 2 |
4 files changed, 28 insertions, 2 deletions
diff --git a/scumm/imuse_digi/dimuse.h b/scumm/imuse_digi/dimuse.h index e888b6bfde..61a4c8da4c 100644 --- a/scumm/imuse_digi/dimuse.h +++ b/scumm/imuse_digi/dimuse.h @@ -146,6 +146,7 @@ public: void stopAllSounds(bool waitForStop); void pause(bool pause); void parseScriptCmds(int a, int b, int c, int d, int e, int f, int g, int h); + void refreshScripts(); int getSoundStatus(int sound) const; int32 getCurMusicPosInMs(); int32 getCurVoiceLipSyncWidth(); diff --git a/scumm/imuse_digi/dimuse_script.cpp b/scumm/imuse_digi/dimuse_script.cpp index 63b2cf1fbc..db9e0d8ece 100644 --- a/scumm/imuse_digi/dimuse_script.cpp +++ b/scumm/imuse_digi/dimuse_script.cpp @@ -159,6 +159,20 @@ void IMuseDigital::parseScriptCmds(int a, int b, int c, int d, int e, int f, int } } +void IMuseDigital::refreshScripts() { + Common::StackLock lock(_mutex, "IMuseDigital::refreshScripts()"); + bool found = false; + for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { + if ((_track[l].used) && (_track[l].volGroupId == IMUSE_VOLGRP_MUSIC) && (!_track[l].volFadeUsed)) { + found = true; + } + } + + if ((!found) && (_curMusicSeq != 0)) { + parseScriptCmds(0x2000, 0, 0, 0, 0, 0, 0, 0); + } +} + void IMuseDigital::startVoice(int soundId, AudioStream *input) { debug(5, "startVoiceStream(%d)", soundId); startSound(soundId, NULL, 0, IMUSE_VOLGRP_VOICE, input, 0, 127, 127); diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp index 0491340407..010283c916 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -23,6 +23,7 @@ #include "common/util.h" #include "sound/voc.h" #include "scumm/scumm.h" +#include "scumm/imuse_digi/dimuse.h" #include "scumm/imuse_digi/dimuse_sndmgr.h" #include "scumm/imuse_digi/dimuse_bndmgr.h" @@ -221,8 +222,12 @@ bool ImuseDigiSndMgr::openMusicBundle(int slot) { } else { char musicfile[20]; sprintf(musicfile, "musdisk%d.bun", _vm->VAR(_vm->VAR_CURRENTDISK)); - if (_disk != _vm->VAR(_vm->VAR_CURRENTDISK)) + if (_disk != _vm->VAR(_vm->VAR_CURRENTDISK)) { + _vm->_imuseDigital->parseScriptCmds(0x1000, 0, 0, 0, 0, 0, 0, 0); + _vm->_imuseDigital->parseScriptCmds(0x2000, 0, 0, 0, 0, 0, 0, 0); + _vm->_imuseDigital->stopAllSounds(true); _sounds[slot].bundle->closeFile(); + } result = _sounds[slot].bundle->openFile(musicfile, _vm->getGameDataPath()); @@ -248,8 +253,12 @@ bool ImuseDigiSndMgr::openVoiceBundle(int slot) { } else { char voxfile[20]; sprintf(voxfile, "voxdisk%d.bun", _vm->VAR(_vm->VAR_CURRENTDISK)); - if (_disk != _vm->VAR(_vm->VAR_CURRENTDISK)) + if (_disk != _vm->VAR(_vm->VAR_CURRENTDISK)) { + _vm->_imuseDigital->parseScriptCmds(0x1000, 0, 0, 0, 0, 0, 0, 0); + _vm->_imuseDigital->parseScriptCmds(0x2000, 0, 0, 0, 0, 0, 0, 0); + _vm->_imuseDigital->stopAllSounds(true); _sounds[slot].bundle->closeFile(); + } result = _sounds[slot].bundle->openFile(voxfile, _vm->getGameDataPath()); diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 8cfc17689a..42b8a3adc5 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -1577,6 +1577,8 @@ load_game: } _sound->processSoundQues(); + if ((_imuseDigital) && (_gameId == GID_DIG)) + _imuseDigital->refreshScripts(); camera._last = camera._cur; |