From 41e6bba0098f3b5e6148d015060e63eca2b3bcdb Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Tue, 2 Mar 2004 20:35:48 +0000 Subject: synced local imuse. many bug fixes, and few new bugs :) svn-id: r13153 --- scumm/imuse_digi/dimuse.cpp | 74 ++++++----- scumm/imuse_digi/dimuse.h | 37 ++++-- scumm/imuse_digi/dimuse_music.cpp | 138 ++++++++++--------- scumm/imuse_digi/dimuse_tables.cpp | 266 ++++++++++++++++++------------------- scumm/saveload.cpp | 6 + scumm/scummvm.cpp | 3 + 6 files changed, 275 insertions(+), 249 deletions(-) (limited to 'scumm') diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp index 5cdab989c6..ab01d34438 100644 --- a/scumm/imuse_digi/dimuse.cpp +++ b/scumm/imuse_digi/dimuse.cpp @@ -73,12 +73,6 @@ void IMuseDigital::callback() { for (l = 0; l < MAX_DIGITAL_TRACKS;l ++) { if (_track[l].used) { - if (_track[l].waitForEndSeq) { - if ((_curMusicState != 0) && (_curMusicSeq == 0)) - _track[l].waitForEndSeq = false; - else - continue; - } if (_track[l].stream2) { if (!_track[l].handle.isActive() && _track[l].started) { debug(5, "IMuseDigital::callback(): stoped sound: %d", _track[l].soundId); @@ -88,12 +82,11 @@ void IMuseDigital::callback() { continue; } } else if (_track[l].stream) { - if ((_track[l].toBeRemoved)) { + if (_track[l].toBeRemoved) { debug(5, "IMuseDigital::callback(): stoped sound: %d", _track[l].soundId); _track[l].stream->finish(); _track[l].stream = NULL; _sound->closeSound(_track[l].soundHandle); - _curMusicSeq = 0; _track[l].used = false; continue; } @@ -229,7 +222,7 @@ void IMuseDigital::switchToNextRegion(int track) { _track[track].regionOffset = 0; } -void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int soundGroup, AudioStream *input, bool sequence, int hookId, int volume, bool wait) { +void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int soundGroup, AudioStream *input, int hookId, int volume) { Common::StackLock lock(_mutex, g_system, "IMuseDigital::startSound()"); debug(5, "IMuseDigital::startSound(%d)", soundId); int l; @@ -252,8 +245,6 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, _track[l].trackOffset = 0; _track[l].mod = 0; _track[l].toBeRemoved = false; - _track[l].sequence = sequence; - _track[l].waitForEndSeq = wait; int bits = 0, freq = 0, channels = 0, mixerFlags = 0; @@ -370,18 +361,36 @@ void IMuseDigital::setFade(int soundId, int destVolume, int delay60HzTicks) { } } +void IMuseDigital::refreshScripts() { + bool found = false; + { + Common::StackLock lock(_mutex, g_system, "IMuseDigital::refreshScripts()"); + for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { + if ((_track[l].used) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { + found = true; + } + } + } + + if ((!found) && (_curMusicSeq != 0)) { + parseScriptCmds(0x1001, 0, 0, 0, 0, 0, 0, 0); + } +} + void IMuseDigital::stopAllSounds(bool waitForStop) { - Common::StackLock lock(_mutex, g_system, "IMuseDigital::stopAllSounds()"); debug(5, "IMuseDigital::stopAllSounds"); - for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { - if (_track[l].used) { - if (_track[l].stream) { - _track[l].toBeRemoved = true; - } else if (_track[l].stream2) - _vm->_mixer->stopHandle(_track[l].handle); + { + Common::StackLock lock(_mutex, g_system, "IMuseDigital::stopAllSounds()"); + for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { + if (_track[l].used) { + if (_track[l].stream) { + _track[l].toBeRemoved = true; + } else if (_track[l].stream2) + _vm->_mixer->stopHandle(_track[l].handle); + } } } -/* + if (waitForStop) { bool used; do { @@ -392,14 +401,14 @@ void IMuseDigital::stopAllSounds(bool waitForStop) { } g_system->delay_msecs(10); } while (used); - }*/ + } } void IMuseDigital::fadeOutMusic(int fadeDelay) { Common::StackLock lock(_mutex, g_system, "IMuseDigital::fadeOutMusic()"); debug(5, "IMuseDigital::fadeOutMusic"); for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { - if ((_track[l].used) && (!_track[l].waitForEndSeq) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { + if ((_track[l].used) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { _track[l].volFadeDelay = fadeDelay; _track[l].volFadeDest = 0; _track[l].volFadeStep = (_track[l].volFadeDest - _track[l].vol) * 60 * 40 / (1000 * fadeDelay); @@ -474,31 +483,31 @@ void IMuseDigital::parseScriptCmds(int a, int b, int c, int d, int e, int f, int if ((_vm->_gameId == GID_DIG) && (_vm->_features & GF_DEMO)) { if (b == 1) { fadeOutMusic(200); - startMusic(1, false, 127, false); + startMusic(1, 127); } else { if (getSoundStatus(2) == 0) { fadeOutMusic(200); - startMusic(2, false, 127, false); + startMusic(2, 127); } } } else if ((_vm->_gameId == GID_CMI) && (_vm->_features & GF_DEMO)) { if (b == 2) { fadeOutMusic(120); - startMusic("in1.imx", 2002, false, 0, 127, false); + startMusic("in1.imx", 2002, 0, 127); } else if (b == 4) { fadeOutMusic(120); - startMusic("in2.imx", 2004, false, 0, 127, false); + startMusic("in2.imx", 2004, 0, 127); } else if (b == 8) { fadeOutMusic(120); - startMusic("out1.imx", 2008, false, 0, 127, false); + startMusic("out1.imx", 2008, 0, 127); } else if (b == 9) { fadeOutMusic(120); - startMusic("out2.imx", 2009, false, 0, 127, false); + startMusic("out2.imx", 2009, 0, 127); } else if (b == 16) { fadeOutMusic(120); - startMusic("gun.imx", 2016, false, 0, 127, false); + startMusic("gun.imx", 2016, 0, 127); } else { - warning("imuse digital: set state unknown for cmi demo: %d, room: %d", b, this->_vm->_currentRoom); + warning("imuse digital: set state unknown for cmi demo: %d, room: %d", b, _vm->_currentRoom); } } else if (_vm->_gameId == GID_DIG) { setDigMusicState(b); @@ -526,6 +535,7 @@ void IMuseDigital::parseScriptCmds(int a, int b, int c, int d, int e, int f, int break; case 0x1003: // ImuseSetAttribute debug(5, "ImuseSetAttribute (%d, %d)", b, c); + assert((_vm->_gameId == GID_DIG) || (_vm->_gameId == GID_FT)); if (_vm->_gameId == GID_DIG) { assert(b >= 0 && b < 11); _attributesTable[b] = c; @@ -607,7 +617,7 @@ int32 IMuseDigital::getCurMusicPosInMs() { int soundId = -1; for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { - if ((_track[l].used) && (!_track[l].waitForEndSeq) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { + if ((_track[l].used) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { soundId = _track[l].soundId; } } @@ -642,7 +652,7 @@ int32 IMuseDigital::getCurMusicLipSyncWidth(int syncId) { int soundId = -1; for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { - if ((_track[l].used) && (!_track[l].waitForEndSeq) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { + if ((_track[l].used) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { soundId = _track[l].soundId; } } @@ -660,7 +670,7 @@ int32 IMuseDigital::getCurMusicLipSyncHeight(int syncId) { int soundId = -1; for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { - if ((_track[l].used) && (!_track[l].waitForEndSeq) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { + if ((_track[l].used) && (_track[l].soundGroup == IMUSE_MUSIC) && (!_track[l].volFadeUsed)) { soundId = _track[l].soundId; } } diff --git a/scumm/imuse_digi/dimuse.h b/scumm/imuse_digi/dimuse.h index 869bf6a79b..651985ae41 100644 --- a/scumm/imuse_digi/dimuse.h +++ b/scumm/imuse_digi/dimuse.h @@ -53,11 +53,9 @@ private: bool used; bool toBeRemoved; bool started; - bool waitForEndSeq; int32 regionOffset; int32 trackOffset; int32 dataOffset; - bool sequence; int curRegion; int curHookId; int soundGroup; @@ -79,7 +77,7 @@ private: ImuseDigiSndMgr *_sound; bool _pause; - int _attributesTable[11]; + int _attributesTable[12]; int _attributesState[97]; int _attributesSeq[91]; int _curSeqAtribPos; @@ -91,7 +89,7 @@ private: static void timer_handler(void *refConf); void callback(); void switchToNextRegion(int track); - void startSound(int soundId, const char *soundName, int soundType, int soundGroup, AudioStream *input, bool sequence, int hookId, int volume, bool wait); + void startSound(int soundId, const char *soundName, int soundType, int soundGroup, AudioStream *input, int hookId, int volume); int32 getPosInMs(int soundId); void getLipSync(int soundId, int syncId, int32 msPos, int32 &width, int32 &height); @@ -102,32 +100,41 @@ private: void setFtMusicState(int stateId); void setFtMusicSequence(int seqId); void setFtMusicCuePoint(int cueId); - void playFtMusic(const char *songName, int opcode, int volume, bool sequence, bool wait); + void playFtMusic(const char *songName, int opcode, int volume); void setComiMusicState(int stateId); void setComiMusicSequence(int seqId); - void playComiMusic(const char *songName, const imuseComiTable *table, int atribPos, bool sequence, bool wait); + void playComiMusic(const char *songName, const imuseComiTable *table, int atribPos, bool sequence); void setDigMusicState(int stateId); void setDigMusicSequence(int seqId); - void playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence, bool wait); + void playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence); public: IMuseDigital(ScummEngine *scumm); virtual ~IMuseDigital(); void startVoice(int soundId, AudioStream *input) - { debug(5, "startVoiceStream(%d)", soundId); startSound(soundId, NULL, 0, IMUSE_VOICE, input, false, 0, 127, false); } + { debug(5, "startVoiceStream(%d)", soundId); startSound(soundId, NULL, 0, IMUSE_VOICE, input, 0, 127); } void startVoice(int soundId, const char *soundName) - { debug(5, "startVoiceBundle(%s)", soundName); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_VOICE, NULL, false, 0, 127, false); } - void startMusic(int soundId, bool sequence, int volume, bool wait) - { debug(5, "startMusicResource(%d)", soundId); startSound(soundId, NULL, IMUSE_RESOURCE, IMUSE_MUSIC, NULL, sequence, 0, volume, wait); } - void startMusic(const char *soundName, int soundId, bool sequence, int hookId, int volume, bool wait) - { debug(5, "startMusicBundle(%s)", soundName); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_MUSIC, NULL, sequence, hookId, volume, wait); } + { debug(5, "startVoiceBundle(%s)", soundName); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_VOICE, NULL, 0, 127); } + void startMusic(int soundId, int volume) + { debug(5, "startMusicResource(%d)", soundId); startSound(soundId, NULL, IMUSE_RESOURCE, IMUSE_MUSIC, NULL, 0, volume); } + void startMusic(const char *soundName, int soundId, int hookId, int volume) + { debug(5, "startMusicBundle(%s)", soundName); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_MUSIC, NULL, hookId, volume); } void startSfx(int soundId) - { debug(5, "startSfx(%d)", soundId); startSound(soundId, NULL, IMUSE_RESOURCE, IMUSE_SFX, NULL, false, 0, 127, false); } + { debug(5, "startSfx(%d)", soundId); startSound(soundId, NULL, IMUSE_RESOURCE, IMUSE_SFX, NULL, 0, 127); } void startSound(int soundId) { error("MusicEngine::startSound() Should be never called"); } + void resetState() { + _curMusicState = 0; + _curMusicSeq = 0; + _curMusicCue = 0; + memset(_attributesSeq, 0, sizeof(_attributesSeq)); + memset(_attributesState, 0, sizeof(_attributesState)); + memset(_attributesTable, 0, sizeof(_attributesTable)); + _curSeqAtribPos = 0; + } void setVolume(int soundId, int volume); void setPan(int soundId, int pan); @@ -138,6 +145,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(); @@ -160,6 +168,7 @@ struct imuseDigTable { int16 soundId; char name[20]; byte param; + byte hookId; char filename[13]; }; diff --git a/scumm/imuse_digi/dimuse_music.cpp b/scumm/imuse_digi/dimuse_music.cpp index 6c7f8b087c..b12a84686a 100644 --- a/scumm/imuse_digi/dimuse_music.cpp +++ b/scumm/imuse_digi/dimuse_music.cpp @@ -44,14 +44,17 @@ void IMuseDigital::setDigMusicState(int stateId) { } num = l; + assert(_digStateMusicMap[num].unk1 >= 0 && _digStateMusicMap[num].unk1 < 11); int val2 = _attributesTable[_digStateMusicMap[num].unk1]; if (val2 == 0) { + assert(_digStateMusicMap[num].unk3 >= 0 && _digStateMusicMap[num].unk3 < 11); if (_attributesTable[_digStateMusicMap[num].unk3] != 0) { num = _digStateMusicMap[num].unk4; } else { num = _digStateMusicMap[num].musicTableIndex; } } else { + assert(_digStateMusicMap[num].unk1 >= 0 && _digStateMusicMap[num].unk2 < 11); int val = _attributesTable[_digStateMusicMap[num].unk2]; if (val == 0) { num = _digStateMusicMap[num].musicTableIndex + val2; @@ -66,17 +69,11 @@ void IMuseDigital::setDigMusicState(int stateId) { if (_curMusicState == num) return; - bool wait = false; - - if (_curMusicSeq != 0) { - wait = true; - } - - if ((_curMusicSeq == 0) || (wait)) { + if (_curMusicSeq == 0) { if (num == 0) - playDigMusic(NULL, &_digStateMusicTable[num], num, false, wait); + playDigMusic(NULL, &_digStateMusicTable[0], 0, false); else - playDigMusic(_digStateMusicTable[num].name, &_digStateMusicTable[num], num, false, wait); + playDigMusic(_digStateMusicTable[num].name, &_digStateMusicTable[num], num, false); } _curMusicState = num; @@ -104,7 +101,7 @@ void IMuseDigital::setDigMusicSequence(int seqId) { if (num != 0) { if (_curMusicSeq == 0) { - playDigMusic(_digSeqMusicTable[num].name, &_digSeqMusicTable[num], 0, true, false); + playDigMusic(_digSeqMusicTable[num].name, &_digSeqMusicTable[num], 0, true); _curSeqAtribPos = 0; _attributesSeq[num] = 1; } else { @@ -112,22 +109,22 @@ void IMuseDigital::setDigMusicSequence(int seqId) { _curSeqAtribPos = num; return; } else if (_digSeqMusicTable[_curMusicSeq].opcode == 6) { - playDigMusic(_digSeqMusicTable[num].name, &_digSeqMusicTable[num], 0, true, false); + playDigMusic(_digSeqMusicTable[num].name, &_digSeqMusicTable[num], 0, true); _curSeqAtribPos = 0; _attributesSeq[num] = 1; } } } else { if (_curSeqAtribPos != 0) { - playDigMusic(_digSeqMusicTable[_curSeqAtribPos].name, &_digSeqMusicTable[num], 0, true, false); + playDigMusic(_digSeqMusicTable[_curSeqAtribPos].name, &_digSeqMusicTable[_curSeqAtribPos], 0, true); _attributesSeq[_curSeqAtribPos] = 1; - _curSeqAtribPos = 0; num = _curSeqAtribPos; + _curSeqAtribPos = 0; } else { - if (_curMusicState != 0) - playDigMusic(_digStateMusicTable[_curMusicState].name, &_digSeqMusicTable[num], _curMusicState, false, false); - else - playDigMusic(NULL, &_digStateMusicTable[num], _curMusicState, false, false); + if (_curMusicState != 0) { + playDigMusic(_digStateMusicTable[_curMusicState].name, &_digStateMusicTable[_curMusicState], _curMusicState, true); + } else + playDigMusic(NULL, &_digStateMusicTable[0], 0, true); num = 0; } } @@ -135,7 +132,7 @@ void IMuseDigital::setDigMusicSequence(int seqId) { _curMusicSeq = num; } -void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence, bool wait) { +void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence) { int hookId = 0; if (songName != NULL) { @@ -157,7 +154,16 @@ void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table if ((atribPos != 0) && (hookId == 0)) { if (table->param != 0) atribPos = table->param; - hookId = _attributesSeq[atribPos]; + hookId = _attributesState[atribPos]; + if (table->hookId != 0) { + if ((hookId != 0) && (table->hookId <= 1)) { + _attributesState[atribPos] = hookId + 1; + if (table->hookId < hookId + 1) + _attributesState[atribPos] = 1; + } else { + _attributesState[atribPos] = 2; + } + } } } @@ -176,13 +182,14 @@ void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table case 3: if ((!sequence) && (table->param != 0)) { if (table->param == _digStateMusicTable[_curMusicState].param) { - startMusic(table->filename, table->soundId, sequence, 0, 127, wait); + startMusic(table->filename, table->soundId, 0, 127); } } else { - startMusic(table->filename, table->soundId, sequence, hookId, 127, wait); + startMusic(table->filename, table->soundId, hookId, 127); } + break; case 4: - startMusic(table->filename, table->soundId, sequence, 0, 127, wait); + startMusic(table->filename, table->soundId, hookId, 127); break; } } @@ -205,17 +212,11 @@ void IMuseDigital::setComiMusicState(int stateId) { if (_curMusicState == num) return; - bool wait = false; - - if (_curMusicSeq != 0) { - wait = true; - } - - if ((_curMusicSeq == 0) || (wait)) { + if (_curMusicSeq == 0) { if (num == 0) - playComiMusic(NULL, &_comiStateMusicTable[num], num, false, wait); + playComiMusic(NULL, &_comiStateMusicTable[0], 0, false); else - playComiMusic(_comiStateMusicTable[num].name, &_comiStateMusicTable[num], num, false, wait); + playComiMusic(_comiStateMusicTable[num].name, &_comiStateMusicTable[num], num, false); } _curMusicState = num; @@ -241,7 +242,7 @@ void IMuseDigital::setComiMusicSequence(int seqId) { if (num != 0) { if (_curMusicSeq == 0) { - playComiMusic(_comiSeqMusicTable[num].name, &_comiSeqMusicTable[num], 0, true, false); + playComiMusic(_comiSeqMusicTable[num].name, &_comiSeqMusicTable[num], 0, true); _curSeqAtribPos = 0; _attributesSeq[num] = 1; } else { @@ -249,22 +250,22 @@ void IMuseDigital::setComiMusicSequence(int seqId) { _curSeqAtribPos = num; return; } else if (_comiSeqMusicTable[_curMusicSeq].opcode == 6) { - playComiMusic(_comiSeqMusicTable[num].name, &_comiSeqMusicTable[num], 0, true, false); + playComiMusic(_comiSeqMusicTable[num].name, &_comiSeqMusicTable[num], 0, true); _curSeqAtribPos = 0; _attributesSeq[num] = 1; } } } else { if (_curSeqAtribPos != 0) { - playComiMusic(_comiSeqMusicTable[_curSeqAtribPos].name, &_comiSeqMusicTable[num], 0, true, false); + playComiMusic(_comiSeqMusicTable[_curSeqAtribPos].name, &_comiSeqMusicTable[_curSeqAtribPos], 0, true); _attributesSeq[_curSeqAtribPos] = 1; - _curSeqAtribPos = 0; num = _curSeqAtribPos; + _curSeqAtribPos = 0; } else { - if (_curMusicState != 0) - playComiMusic(_comiStateMusicTable[_curMusicState].name, &_comiSeqMusicTable[num], _curMusicState, false, false); - else - playComiMusic(NULL, &_comiStateMusicTable[num], _curMusicState, false, false); + if (_curMusicState != 0) { + playComiMusic(_comiStateMusicTable[_curMusicState].name, &_comiStateMusicTable[_curMusicState], _curMusicState, true); + } else + playComiMusic(NULL, &_comiStateMusicTable[0], 0, true); num = 0; } } @@ -272,18 +273,18 @@ void IMuseDigital::setComiMusicSequence(int seqId) { _curMusicSeq = num; } -void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *table, int atribPos, bool sequence, bool wait) { +void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *table, int atribPos, bool sequence) { int hookId = 0; if ((songName != NULL) && (atribPos != 0)) { - hookId = _attributesSeq[atribPos]; + hookId = _attributesState[atribPos]; if (table->hookId != 0) { if ((hookId != 0) && (table->hookId <= 1)) { - _attributesSeq[atribPos] = hookId + 1; + _attributesState[atribPos] = hookId + 1; if (table->hookId < hookId + 1) - _attributesSeq[atribPos] = 1; + _attributesState[atribPos] = 1; } else { - _attributesSeq[atribPos] = 2; + _attributesState[atribPos] = 2; } } } @@ -301,30 +302,31 @@ void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *tab break; case 1: fadeOutMusic(120); - startMusic(table->filename, table->soundId, sequence, 0, 1, wait); + startMusic(table->filename, table->soundId, 0, 1); setFade(table->soundId, 127, 120); break; case 2: fadeOutMusic(table->fadeDelay); - startMusic(table->filename, table->soundId, sequence, table->hookId, 127, wait); + startMusic(table->filename, table->soundId, table->hookId, 127); break; case 3: if ((!sequence) && (table->param != 0)) { if (table->param == _comiStateMusicTable[_curMusicState].param) { fadeOutMusic(table->fadeDelay); - startMusic(table->filename, table->soundId, sequence, 0, 127, wait); - } + startMusic(table->filename, table->soundId, 0, 127); + } } else { fadeOutMusic(table->fadeDelay); - startMusic(table->filename, table->soundId, sequence, table->hookId, 127, wait); + startMusic(table->filename, table->soundId, hookId, 127); } + break; case 4: fadeOutMusic(120); - startMusic(table->filename, table->soundId, sequence, 0, 127, wait); + startMusic(table->filename, table->soundId, table->hookId, 127); break; case 12: fadeOutMusic(table->fadeDelay); - startMusic(table->filename, table->soundId, sequence, table->hookId, 127, wait); + startMusic(table->filename, table->soundId, table->hookId, 127); break; } } @@ -338,17 +340,11 @@ void IMuseDigital::setFtMusicState(int stateId) { if (_curMusicState == stateId) return; - bool wait = false; - - if (_curMusicSeq != 0) { - wait = true; - } - - if ((_curMusicSeq == 0) || (wait)) { + if (_curMusicSeq == 0) { if (stateId == 0) - playFtMusic(NULL, 0, 0, false, wait); + playFtMusic(NULL, 0, 0); else - playFtMusic(_ftStateMusicTable[stateId].audioName, _ftStateMusicTable[stateId].opcode, _ftStateMusicTable[stateId].volume, false, wait); + playFtMusic(_ftStateMusicTable[stateId].audioName, _ftStateMusicTable[stateId].opcode, _ftStateMusicTable[stateId].volume); } _curMusicState = stateId; @@ -358,19 +354,20 @@ void IMuseDigital::setFtMusicSequence(int seqId) { if (seqId > 52) return; - debug(5, "Sequence music: %s, %s", _ftSeqNames[seqId].name); + debug(5, "Sequence music: %s", _ftSeqNames[seqId].name); if (_curMusicSeq == seqId) return; if (seqId == 0) { if (_curMusicState == 0) - playFtMusic(NULL, 0, 0, true, false); - else - playFtMusic(_ftStateMusicTable[seqId].audioName, _ftStateMusicTable[seqId].opcode, _ftStateMusicTable[seqId].volume, true, false); + playFtMusic(NULL, 0, 0); + else { + playFtMusic(_ftStateMusicTable[_curMusicState].audioName, _ftStateMusicTable[_curMusicState].opcode, _ftStateMusicTable[_curMusicState].volume); + } } else { int seq = (seqId - 1) * 4; - playFtMusic(_ftSeqMusicTable[seq].audioName, _ftSeqMusicTable[seq].opcode, _ftSeqMusicTable[seq].volume, false, false); + playFtMusic(_ftSeqMusicTable[seq].audioName, _ftSeqMusicTable[seq].opcode, _ftSeqMusicTable[seq].volume); } _curMusicSeq = seqId; @@ -390,10 +387,10 @@ void IMuseDigital::setFtMusicCuePoint(int cueId) { return; if (cueId == 0) - playFtMusic(NULL, 0, 0, true, false); + playFtMusic(NULL, 0, 0); else { int seq = ((_curMusicSeq - 1) + cueId) * 4; - playFtMusic(_ftSeqMusicTable[seq].audioName, _ftSeqMusicTable[seq].opcode, _ftSeqMusicTable[seq].volume, true, false); + playFtMusic(_ftSeqMusicTable[seq].audioName, _ftSeqMusicTable[seq].opcode, _ftSeqMusicTable[seq].volume); } _curMusicCue = cueId; @@ -411,7 +408,7 @@ int IMuseDigital::getSoundIdByName(const char *soundName) { return -1; } -void IMuseDigital::playFtMusic(const char *songName, int opcode, int volume, bool sequence, bool wait) { +void IMuseDigital::playFtMusic(const char *songName, int opcode, int volume) { fadeOutMusic(200); switch(opcode) { @@ -423,8 +420,9 @@ void IMuseDigital::playFtMusic(const char *songName, int opcode, int volume, boo case 3: { int soundId = getSoundIdByName(songName); - if (soundId != -1) - startMusic(soundId, sequence, volume, wait); + if (soundId != -1) { + startMusic(soundId, volume); + } } break; } diff --git a/scumm/imuse_digi/dimuse_tables.cpp b/scumm/imuse_digi/dimuse_tables.cpp index fb23a532e4..a4b2c60d1a 100644 --- a/scumm/imuse_digi/dimuse_tables.cpp +++ b/scumm/imuse_digi/dimuse_tables.cpp @@ -152,142 +152,142 @@ const imuseRoomMap _digStateMusicMap[] = { }; const imuseDigTable _digStateMusicTable[] = { - {0, 1000, "STATE_NULL", 0, ""}, - {0, 1001, "stateNoChange", 0, ""}, - {3, 1100, "stateAstShip", 2, "ASTERO~1.IMU"}, - {3, 1120, "stateAstClose", 2, "ASTERO~2.IMU"}, - {3, 1140, "stateAstInside", 0, "ASTERO~3.IMU"}, - {3, 1150, "stateAstCore", 0, "ASTERO~4.IMU"}, - {3, 1200, "stateCanyonClose", 0, "CANYON~1.IMU"}, - {3, 1205, "stateCanyonClose_m", 0, "CANYON~2.IMU"}, - {3, 1210, "stateCanyonOver", 0, "CANYON~3.IMU"}, - {3, 1220, "stateCanyonWreck", 0, "CANYON~4.IMU"}, - {3, 1300, "stateNexusCanyon", 10, "NEXUS(~1.IMU"}, - {3, 1310, "stateNexusPlan", 10, "NEXUS(~1.IMU"}, - {3, 1320, "stateNexusRamp", 10, "NEXUS(~2.IMU"}, - {3, 1330, "stateNexusMuseum", 10, "NEXUS(~3.IMU"}, - {3, 1340, "stateNexusMap", 10, "NEXUS(~4.IMU"}, - {3, 1350, "stateNexusTomb", 10, "NE3706~5.IMU"}, - {3, 1360, "stateNexusCath", 10, "NE3305~5.IMU"}, - {3, 1370, "stateNexusAirlock", 0, "NE2D3A~5.IMU"}, - {3, 1380, "stateNexusPowerOff", 0, "NE8522~5.IMU"}, - {3, 1400, "stateMuseumTramNear", 0, "TRAM(M~1.IMU"}, - {3, 1410, "stateMuseumTramFar", 0, "TRAM(M~2.IMU"}, - {3, 1420, "stateMuseumLockup", 0, "MUSEUM~1.IMU"}, - {3, 1433, "stateMuseumPool", 22, "MUSEUM~2.IMU"}, - {3, 1436, "stateMuseumSpire", 22, "MUSEUM~3.IMU"}, - {3, 1440, "stateMuseumMuseum", 22, "MUSEUM~4.IMU"}, - {3, 1450, "stateMuseumLibrary", 0, "MUB575~5.IMU"}, - {3, 1460, "stateMuseumCavern", 0, "MUF9BE~5.IMU"}, - {3, 1500, "stateTombTramNear", 0, "TRAM(T~1.IMU"}, - {3, 1510, "stateTombBase", 28, "TOMB(A~1.IMU"}, - {3, 1520, "stateTombSpire", 28, "TOMB(A~2.IMU"}, - {3, 1530, "stateTombCave", 28, "TOMB(A~3.IMU"}, - {3, 1540, "stateTombCrypt", 31, "TOMB(C~1.IMU"}, - {3, 1550, "stateTombGuards", 31, "TOMB(C~2.IMU"}, - {3, 1560, "stateTombInner", 0, "TOMB(I~1.IMU"}, - {3, 1570, "stateTombCreator1", 0, "TOMB(C~3.IMU"}, - {3, 1580, "stateTombCreator2", 0, "TOMB(C~4.IMU"}, - {3, 1600, "statePlanTramNear", 0, "TRAM(P~1.IMU"}, - {3, 1610, "statePlanTramFar", 0, "TRAM(P~2.IMU"}, - {3, 1620, "statePlanBase", 38, "PLAN(A~1.IMU"}, - {3, 1630, "statePlanSpire", 38, "PLAN(A~2.IMU"}, - {3, 1650, "statePlanDome", 0, "PLAN(D~1.IMU"}, - {3, 1700, "stateMapTramNear", 0, "TRAM(M~3.IMU"}, - {3, 1710, "stateMapTramFar", 0, "TRAM(M~4.IMU"}, - {3, 1720, "stateMapCanyon", 43, "MAP(AM~1.IMU"}, - {3, 1730, "stateMapExposed", 43, "MAP(AM~2.IMU"}, - {3, 1750, "stateMapNestEmpty", 43, "MAP(AM~4.IMU"}, - {3, 1760, "stateMapNestMonster", 0, "MAP(MO~1.IMU"}, - {3, 1770, "stateMapKlein", 0, "MAP(KL~1.IMU"}, - {3, 1800, "stateCathTramNear", 0, "TRAM(C~1.IMU"}, - {3, 1810, "stateCathTramFar", 0, "TRAM(C~2.IMU"}, - {3, 1820, "stateCathLab", 50, "CATH(A~1.IMU"}, - {3, 1830, "stateCathOutside", 50, "CATH(A~2.IMU"}, - {3, 1900, "stateWorldMuseum", 52, "WORLD(~1.IMU"}, - {3, 1901, "stateWorldPlan", 52, "WORLD(~2.IMU"}, - {3, 1902, "stateWorldTomb", 52, "WORLD(~3.IMU"}, - {3, 1903, "stateWorldMap", 52, "WORLD(~4.IMU"}, - {3, 1904, "stateWorldCath", 52, "WO3227~5.IMU"}, - {3, 1910, "stateEye1", 0, "EYE1~1.IMU"}, - {3, 1911, "stateEye2", 0, "EYE2~1.IMU"}, - {3, 1912, "stateEye3", 0, "EYE3~1.IMU"}, - {3, 1913, "stateEye4", 0, "EYE4~1.IMU"}, - {3, 1914, "stateEye5", 0, "EYE5~1.IMU"}, - {3, 1915, "stateEye6", 0, "EYE6~1.IMU"}, - {3, 1916, "stateEye7", 0, "EYE7~1.IMU"}, - {0, -1, "", 0, ""} + {0, 1000, "STATE_NULL", 0, 0, ""}, + {0, 1001, "stateNoChange", 0, 0, ""}, + {3, 1100, "stateAstShip", 2, 0, "ASTERO~1.IMU"}, + {3, 1120, "stateAstClose", 2, 0, "ASTERO~2.IMU"}, + {3, 1140, "stateAstInside", 0, 0, "ASTERO~3.IMU"}, + {3, 1150, "stateAstCore", 0, 2, "ASTERO~4.IMU"}, + {3, 1200, "stateCanyonClose", 0, 1, "CANYON~1.IMU"}, + {3, 1205, "stateCanyonClose_m", 0, 0, "CANYON~2.IMU"}, + {3, 1210, "stateCanyonOver", 0, 1, "CANYON~3.IMU"}, + {3, 1220, "stateCanyonWreck", 0, 1, "CANYON~4.IMU"}, + {3, 1300, "stateNexusCanyon", 10, 0, "NEXUS(~1.IMU"}, + {3, 1310, "stateNexusPlan", 10, 0, "NEXUS(~1.IMU"}, + {3, 1320, "stateNexusRamp", 10, 0, "NEXUS(~2.IMU"}, + {3, 1330, "stateNexusMuseum", 10, 0, "NEXUS(~3.IMU"}, + {3, 1340, "stateNexusMap", 10, 0, "NEXUS(~4.IMU"}, + {3, 1350, "stateNexusTomb", 10, 0, "NE3706~5.IMU"}, + {3, 1360, "stateNexusCath", 10, 0, "NE3305~5.IMU"}, + {3, 1370, "stateNexusAirlock", 0, 0, "NE2D3A~5.IMU"}, + {3, 1380, "stateNexusPowerOff", 0, 1, "NE8522~5.IMU"}, + {3, 1400, "stateMuseumTramNear", 0, 1, "TRAM(M~1.IMU"}, + {3, 1410, "stateMuseumTramFar", 0, 0, "TRAM(M~2.IMU"}, + {3, 1420, "stateMuseumLockup", 0, 0, "MUSEUM~1.IMU"}, + {3, 1433, "stateMuseumPool", 22, 1, "MUSEUM~2.IMU"}, + {3, 1436, "stateMuseumSpire", 22, 2, "MUSEUM~3.IMU"}, + {3, 1440, "stateMuseumMuseum", 22, 2, "MUSEUM~4.IMU"}, + {3, 1450, "stateMuseumLibrary", 0, 0, "MUB575~5.IMU"}, + {3, 1460, "stateMuseumCavern", 0, 0, "MUF9BE~5.IMU"}, + {3, 1500, "stateTombTramNear", 0, 1, "TRAM(T~1.IMU"}, + {3, 1510, "stateTombBase", 28, 2, "TOMB(A~1.IMU"}, + {3, 1520, "stateTombSpire", 28, 2, "TOMB(A~2.IMU"}, + {3, 1530, "stateTombCave", 28, 2, "TOMB(A~3.IMU"}, + {3, 1540, "stateTombCrypt", 31, 1, "TOMB(C~1.IMU"}, + {3, 1550, "stateTombGuards", 31, 1, "TOMB(C~2.IMU"}, + {3, 1560, "stateTombInner", 0, 1, "TOMB(I~1.IMU"}, + {3, 1570, "stateTombCreator1", 0, 0, "TOMB(C~3.IMU"}, + {3, 1580, "stateTombCreator2", 0, 0, "TOMB(C~4.IMU"}, + {3, 1600, "statePlanTramNear", 0, 1, "TRAM(P~1.IMU"}, + {3, 1610, "statePlanTramFar", 0, 0, "TRAM(P~2.IMU"}, + {3, 1620, "statePlanBase", 38, 2, "PLAN(A~1.IMU"}, + {3, 1630, "statePlanSpire", 38, 2, "PLAN(A~2.IMU"}, + {3, 1650, "statePlanDome", 0, 0, "PLAN(D~1.IMU"}, + {3, 1700, "stateMapTramNear", 0, 1, "TRAM(M~3.IMU"}, + {3, 1710, "stateMapTramFar", 0, 0, "TRAM(M~4.IMU"}, + {3, 1720, "stateMapCanyon", 43, 2, "MAP(AM~1.IMU"}, + {3, 1730, "stateMapExposed", 43, 2, "MAP(AM~2.IMU"}, + {3, 1750, "stateMapNestEmpty", 43, 2, "MAP(AM~4.IMU"}, + {3, 1760, "stateMapNestMonster", 0, 0, "MAP(MO~1.IMU"}, + {3, 1770, "stateMapKlein", 0, 0, "MAP(KL~1.IMU"}, + {3, 1800, "stateCathTramNear", 0, 1, "TRAM(C~1.IMU"}, + {3, 1810, "stateCathTramFar", 0, 0, "TRAM(C~2.IMU"}, + {3, 1820, "stateCathLab", 50, 1, "CATH(A~1.IMU"}, + {3, 1830, "stateCathOutside", 50, 1, "CATH(A~2.IMU"}, + {3, 1900, "stateWorldMuseum", 52, 0, "WORLD(~1.IMU"}, + {3, 1901, "stateWorldPlan", 52, 0, "WORLD(~2.IMU"}, + {3, 1902, "stateWorldTomb", 52, 0, "WORLD(~3.IMU"}, + {3, 1903, "stateWorldMap", 52, 0, "WORLD(~4.IMU"}, + {3, 1904, "stateWorldCath", 52, 0, "WO3227~5.IMU"}, + {3, 1910, "stateEye1", 0, 0, "EYE1~1.IMU"}, + {3, 1911, "stateEye2", 0, 0, "EYE2~1.IMU"}, + {3, 1912, "stateEye3", 0, 0, "EYE3~1.IMU"}, + {3, 1913, "stateEye4", 0, 0, "EYE4~1.IMU"}, + {3, 1914, "stateEye5", 0, 0, "EYE5~1.IMU"}, + {3, 1915, "stateEye6", 0, 0, "EYE6~1.IMU"}, + {3, 1916, "stateEye7", 0, 0, "EYE7~1.IMU"}, + {0, -1, "", 0, 0, ""} }; const imuseDigTable _digSeqMusicTable[] = { - {0, 2000, "SEQ_NULL", 0, ""}, - {0, 2005, "seqLogo", 0, ""}, - {0, 2010, "seqIntro", 0, ""}, - {6, 2020, "seqExplosion1b", 0, ""}, - {3, 2030, "seqAstTunnel1a", 0, "SEQ(AS~1.IMU"}, - {6, 2031, "seqAstTunnel2b", 0, ""}, - {4, 2032, "seqAstTunnel3a", 0, "SEQ(AS~2.IMU"}, - {5, 2040, "seqToPlanet1b", 0, ""}, - {4, 2045, "seqArgBegin", 0, "SEQ(AR~1.IMU"}, - {4, 2046, "seqArgEnd", 0, "SEQ(AR~2.IMU"}, - {4, 2050, "seqWreckGhost", 0, "SEQ(GH~1.IMU"}, - {4, 2060, "seqCanyonGhost", 0, "SEQ(GH~2.IMU"}, - {0, 2070, "seqBrinkFall", 0, ""}, - {4, 2080, "seqPanUpCanyon", 0, "SEQ(PA~1.IMU"}, - {6, 2091, "seqAirlockTunnel1b", 0, ""}, - {6, 2100, "seqTramToMu", 0, ""}, - {6, 2101, "seqTramFromMu", 0, ""}, - {6, 2102, "seqTramToTomb", 0, ""}, - {6, 2103, "seqTramFromTomb", 0, ""}, - {6, 2104, "seqTramToPlan", 0, ""}, - {6, 2105, "seqTramFromPlan", 0, ""}, - {6, 2106, "seqTramToMap", 0, ""}, - {6, 2107, "seqTramFromMap", 0, ""}, - {6, 2108, "seqTramToCath", 0, ""}, - {6, 2109, "seqTramFromCath", 0, ""}, - {0, 2110, "seqMuseumGhost", 0, ""}, - {0, 2120, "seqSerpentAppears", 0, ""}, - {0, 2130, "seqSerpentEats", 0, ""}, - {6, 2140, "seqBrinkRes1b", 0, ""}, - {4, 2141, "seqBrinkRes2a", 0, "SEQ(BR~1.IMU"}, - {3, 2150, "seqLockupEntry", 0, "SEQ(BR~1.IMU"}, - {0, 2160, "seqSerpentExplodes", 0, ""}, - {4, 2170, "seqSwimUnderwater", 0, "SEQ(DE~1.IMU"}, - {4, 2175, "seqWavesPlunge", 0, "SEQ(PL~1.IMU"}, - {0, 2180, "seqCryptOpens", 0, ""}, - {0, 2190, "seqGuardsFight", 0, ""}, - {3, 2200, "seqCreatorRes1.1a", 0, "SEQ(CR~1.IMU"}, - {6, 2201, "seqCreatorRes1.2b", 0, ""}, - {6, 2210, "seqMaggieCapture1b", 0, ""}, - {3, 2220, "seqStealCrystals", 0, "SEQ(BR~1.IMU"}, - {0, 2230, "seqGetByMonster", 0, ""}, - {6, 2240, "seqKillMonster1b", 0, ""}, - {3, 2250, "seqCreatorRes2.1a", 0, "SEQ(CR~2.IMU"}, - {6, 2251, "seqCreatorRes2.2b", 0, ""}, - {4, 2252, "seqCreatorRes2.3a", 0, "SEQ(CR~3.IMU"}, - {0, 2260, "seqMaggieInsists", 0, ""}, - {0, 2270, "seqBrinkHelpCall", 0, ""}, - {3, 2280, "seqBrinkCrevice1a", 0, "SEQ(BR~2.IMU"}, - {3, 2281, "seqBrinkCrevice2a", 0, "SEQ(BR~3.IMU"}, - {6, 2290, "seqCathAccess1b", 0, ""}, - {4, 2291, "seqCathAccess2a", 0, "SEQ(CA~1.IMU"}, - {3, 2300, "seqBrinkAtGenerator", 0, "SEQ(BR~1.IMU"}, - {6, 2320, "seqFightBrink1b", 0, ""}, - {6, 2340, "seqMaggieDies1b", 0, ""}, - {6, 2346, "seqMaggieRes1b", 0, ""}, - {4, 2347, "seqMaggieRes2a", 0, "SEQ(MA~1.IMU"}, - {0, 2350, "seqCreatureFalls", 0, ""}, - {5, 2360, "seqFinale1b", 0, ""}, - {3, 2370, "seqFinale2a", 0, "SEQ(FI~1.IMU"}, - {6, 2380, "seqFinale3b1", 0, ""}, - {6, 2390, "seqFinale3b2", 0, ""}, - {3, 2400, "seqFinale4a", 0, "SEQ(FI~2.IMU"}, - {3, 2410, "seqFinale5a", 0, "SEQ(FI~3.IMU"}, - {3, 2420, "seqFinale6a", 0, "SEQ(FI~4.IMU"}, - {3, 2430, "seqFinale7a", 0, "SE3D2B~5.IMU"}, - {6, 2440, "seqFinale8b", 0, ""}, - {4, 2450, "seqFinale9a", 0, "SE313B~5.IMU"}, - {0, -1, "", 0, ""} + {0, 2000, "SEQ_NULL", 0, 0, ""}, + {0, 2005, "seqLogo", 0, 0, ""}, + {0, 2010, "seqIntro", 0, 0, ""}, + {6, 2020, "seqExplosion1b", 0, 0, ""}, + {3, 2030, "seqAstTunnel1a", 0, 0, "SEQ(AS~1.IMU"}, + {6, 2031, "seqAstTunnel2b", 0, 0, ""}, + {4, 2032, "seqAstTunnel3a", 0, 0, "SEQ(AS~2.IMU"}, + {5, 2040, "seqToPlanet1b", 0, 0, ""}, + {4, 2045, "seqArgBegin", 0, 0, "SEQ(AR~1.IMU"}, + {4, 2046, "seqArgEnd", 0, 0, "SEQ(AR~2.IMU"}, + {4, 2050, "seqWreckGhost", 0, 0, "SEQ(GH~1.IMU"}, + {4, 2060, "seqCanyonGhost", 0, 0, "SEQ(GH~2.IMU"}, + {0, 2070, "seqBrinkFall", 0, 0, ""}, + {4, 2080, "seqPanUpCanyon", 0, 0, "SEQ(PA~1.IMU"}, + {6, 2091, "seqAirlockTunnel1b", 0, 0, ""}, + {6, 2100, "seqTramToMu", 0, 0, ""}, + {6, 2101, "seqTramFromMu", 0, 0, ""}, + {6, 2102, "seqTramToTomb", 0, 0, ""}, + {6, 2103, "seqTramFromTomb", 0, 0, ""}, + {6, 2104, "seqTramToPlan", 0, 0, ""}, + {6, 2105, "seqTramFromPlan", 0, 0, ""}, + {6, 2106, "seqTramToMap", 0, 0, ""}, + {6, 2107, "seqTramFromMap", 0, 0, ""}, + {6, 2108, "seqTramToCath", 0, 0, ""}, + {6, 2109, "seqTramFromCath", 0, 0, ""}, + {0, 2110, "seqMuseumGhost", 0, 0, ""}, + {0, 2120, "seqSerpentAppears", 0, 0, ""}, + {0, 2130, "seqSerpentEats", 0, 0, ""}, + {6, 2140, "seqBrinkRes1b", 0, 0, ""}, + {4, 2141, "seqBrinkRes2a", 0, 0, "SEQ(BR~1.IMU"}, + {3, 2150, "seqLockupEntry", 0, 0, "SEQ(BR~1.IMU"}, + {0, 2160, "seqSerpentExplodes", 0, 0, ""}, + {4, 2170, "seqSwimUnderwater", 0, 0, "SEQ(DE~1.IMU"}, + {4, 2175, "seqWavesPlunge", 0, 0, "SEQ(PL~1.IMU"}, + {0, 2180, "seqCryptOpens", 0, 0, ""}, + {0, 2190, "seqGuardsFight", 0, 0, ""}, + {3, 2200, "seqCreatorRes1.1a", 0, 0, "SEQ(CR~1.IMU"}, + {6, 2201, "seqCreatorRes1.2b", 0, 0, ""}, + {6, 2210, "seqMaggieCapture1b", 0, 0, ""}, + {3, 2220, "seqStealCrystals", 0, 0, "SEQ(BR~1.IMU"}, + {0, 2230, "seqGetByMonster", 0, 0, ""}, + {6, 2240, "seqKillMonster1b", 0, 0, ""}, + {3, 2250, "seqCreatorRes2.1a", 0, 0, "SEQ(CR~2.IMU"}, + {6, 2251, "seqCreatorRes2.2b", 0, 0, ""}, + {4, 2252, "seqCreatorRes2.3a", 0, 0, "SEQ(CR~3.IMU"}, + {0, 2260, "seqMaggieInsists", 0, 0, ""}, + {0, 2270, "seqBrinkHelpCall", 0, 0, ""}, + {3, 2280, "seqBrinkCrevice1a", 0, 0, "SEQ(BR~2.IMU"}, + {3, 2281, "seqBrinkCrevice2a", 0, 0, "SEQ(BR~3.IMU"}, + {6, 2290, "seqCathAccess1b", 0, 0, ""}, + {4, 2291, "seqCathAccess2a", 0, 0, "SEQ(CA~1.IMU"}, + {3, 2300, "seqBrinkAtGenerator", 0, 0, "SEQ(BR~1.IMU"}, + {6, 2320, "seqFightBrink1b", 0, 0, ""}, + {6, 2340, "seqMaggieDies1b", 0, 0, ""}, + {6, 2346, "seqMaggieRes1b", 0, 0, ""}, + {4, 2347, "seqMaggieRes2a", 0, 0, "SEQ(MA~1.IMU"}, + {0, 2350, "seqCreatureFalls", 0, 0, ""}, + {5, 2360, "seqFinale1b", 0, 0, ""}, + {3, 2370, "seqFinale2a", 0, 0, "SEQ(FI~1.IMU"}, + {6, 2380, "seqFinale3b1", 0, 0, ""}, + {6, 2390, "seqFinale3b2", 0, 0, ""}, + {3, 2400, "seqFinale4a", 0, 0, "SEQ(FI~2.IMU"}, + {3, 2410, "seqFinale5a", 0, 0, "SEQ(FI~3.IMU"}, + {3, 2420, "seqFinale6a", 0, 0, "SEQ(FI~4.IMU"}, + {3, 2430, "seqFinale7a", 0, 0, "SE3D2B~5.IMU"}, + {6, 2440, "seqFinale8b", 0, 0, ""}, + {4, 2450, "seqFinale9a", 0, 0, "SE313B~5.IMU"}, + {0, -1, "", 0, 0, ""} }; const imuseComiTable _comiStateMusicTable[] = { diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index b0f08e1d16..b2e40ff1b1 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -139,6 +139,12 @@ bool ScummEngine::loadState(int slot, bool compat, SaveFileManager *mgr) { if (!_imuse || _saveSound || !_saveTemporaryState) _sound->stopAllSounds(); + if (_imuseDigital) { + _imuseDigital->stopAllSounds(); + // temporary hack for initial state for imuse music + _imuseDigital->resetState(); + } + _sound->stopCD(); _sound->pauseSounds(true); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 7a856d6215..1abc3c2c53 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1560,6 +1560,9 @@ load_game: } _sound->processSoundQues(); + if ((_imuseDigital) && (_gameId != GID_FT)) + _imuseDigital->refreshScripts(); + camera._last = camera._cur; if (!(++_expire_counter)) { -- cgit v1.2.3