diff options
author | Paweł Kołodziejski | 2008-01-20 19:30:48 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2008-01-20 19:30:48 +0000 |
commit | ec66f6765c40bdc0a62be5a5755886bd38738ba8 (patch) | |
tree | aebae23fee4b747c571f3cb03586a7e86b510c27 | |
parent | e8374f6775cae3cc9a4b2f0613312bee4bf57d8d (diff) | |
download | scummvm-rg350-ec66f6765c40bdc0a62be5a5755886bd38738ba8.tar.gz scummvm-rg350-ec66f6765c40bdc0a62be5a5755886bd38738ba8.tar.bz2 scummvm-rg350-ec66f6765c40bdc0a62be5a5755886bd38738ba8.zip |
added experimental hack to code to prevent the same start music again if old one didn't have chance finish. it's fix bug #1861704, it may fix other similiar things when seq is to null. added few changes to debug logs.
svn-id: r30590
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.h | 1 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_music.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_script.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_sndmgr.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_track.cpp | 15 |
5 files changed, 8 insertions, 18 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index 4783188c3b..9c0fa51e75 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -142,7 +142,6 @@ public: void setPan(int soundId, int pan); void setFade(int soundId, int destVolume, int delay60HzTicks); int getCurMusicSoundId(); - char *getCurMusicSoundName(); void setHookId(int soundId, int hookId); void setMusicVolume(int vol) {} void stopSound(int sound); diff --git a/engines/scumm/imuse_digi/dimuse_music.cpp b/engines/scumm/imuse_digi/dimuse_music.cpp index 84f8599e5e..f0e34ab115 100644 --- a/engines/scumm/imuse_digi/dimuse_music.cpp +++ b/engines/scumm/imuse_digi/dimuse_music.cpp @@ -316,6 +316,8 @@ void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *tab fadeOutMusic(60); return; } + if (getCurMusicSoundId() == table->soundId) + return; if (table->transitionType == 4) _stopingSequence = true; if (table->transitionType == 2) { diff --git a/engines/scumm/imuse_digi/dimuse_script.cpp b/engines/scumm/imuse_digi/dimuse_script.cpp index 83ccebb1be..8a05f31110 100644 --- a/engines/scumm/imuse_digi/dimuse_script.cpp +++ b/engines/scumm/imuse_digi/dimuse_script.cpp @@ -174,6 +174,7 @@ void IMuseDigital::flushTrack(Track *track) { if (track->souStreamUsed) { _mixer->stopHandle(track->mixChanHandle); } else if (track->stream) { + debug(5, "flushTrack() - soundId:%d", track->soundId); // Finalize the appendable stream, then remove our reference to it. // Note that there might still be some data left in the buffers of the // appendable stream. We play it nice and wait till all of it @@ -193,10 +194,11 @@ void IMuseDigital::flushTrack(Track *track) { void IMuseDigital::flushTracks() { Common::StackLock lock(_mutex, "IMuseDigital::flushTracks()"); - debug(5, "flushTracks()"); + debug(6, "flushTracks()"); for (int l = 0; l < MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS; l++) { Track *track = _track[l]; if (track->used && track->toBeRemoved && !_mixer->isSoundHandleActive(track->mixChanHandle)) { + debug(5, "flushTracks() - soundId:%d", track->soundId); memset(track, 0, sizeof(Track)); } } @@ -204,7 +206,7 @@ void IMuseDigital::flushTracks() { void IMuseDigital::refreshScripts() { Common::StackLock lock(_mutex, "IMuseDigital::refreshScripts()"); - debug(5, "refreshScripts()"); + debug(6, "refreshScripts()"); if (_stopingSequence) { parseScriptCmds(0x1001, 0, 0, 0, 0, 0, 0, 0); diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp index 5600ac21a1..1511b9aefc 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -633,7 +633,7 @@ int ImuseDigiSndMgr::getJumpFade(SoundDesc *soundDesc, int number) { } int32 ImuseDigiSndMgr::getDataFromRegion(SoundDesc *soundDesc, int region, byte **buf, int32 offset, int32 size) { - debug(5, "getDataFromRegion() region:%d, offset:%d, size:%d, numRegions:%d", region, offset, size, soundDesc->numRegions); + debug(6, "getDataFromRegion() region:%d, offset:%d, size:%d, numRegions:%d", region, offset, size, soundDesc->numRegions); assert(checkForProperHandle(soundDesc)); assert(buf && offset >= 0 && size >= 0); assert(region >= 0 && region < soundDesc->numRegions); diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 111f3acbde..05fa2eaddf 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -218,26 +218,13 @@ int IMuseDigital::getCurMusicSoundId() { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { soundId = track->soundId; + break; } } return soundId; } -char *IMuseDigital::getCurMusicSoundName() { - Common::StackLock lock(_mutex, "IMuseDigital::getCurMusicSoundName()"); - char *soundName = NULL; - - for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { - Track *track = _track[l]; - if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { - soundName = track->soundName; - } - } - - return soundName; -} - void IMuseDigital::setPan(int soundId, int pan) { Common::StackLock lock(_mutex, "IMuseDigital::setPan()"); debug(5, "IMuseDigital::setPan(%d, %d)", soundId, pan); |