diff options
-rw-r--r-- | engines/sherlock/music.cpp | 35 | ||||
-rw-r--r-- | engines/sherlock/music.h | 2 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel.cpp | 12 |
3 files changed, 6 insertions, 43 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp index d8895979e6..7e7b624f2f 100644 --- a/engines/sherlock/music.cpp +++ b/engines/sherlock/music.cpp @@ -507,41 +507,6 @@ uint32 Music::getCurrentPosition() { // This is used to wait for the music in certain situations like especially the intro // Note: the original game didn't do this, instead it just waited for certain amounts of time // We do this, so that the intro graphics + music work together even on faster/slower hardware. -bool Music::waitUntilTick(uint32 tick, uint32 maxTick, uint32 additionalDelay, uint32 noMusicDelay) { - uint32 currentTick = 0; - - if (!_midiParser->isPlaying()) { - return _vm->_events->delay(noMusicDelay, true); - } - while (1) { - if (!_midiParser->isPlaying()) { // Music has stopped playing -> we are done - if (additionalDelay > 0) { - if (!_vm->_events->delay(additionalDelay, true)) - return false; - } - return true; - } - - currentTick = _midiParser->getTick(); - //warning("waitUntilTick: %lx", currentTick); - - if (currentTick <= maxTick) { - if (currentTick >= tick) { - if (additionalDelay > 0) { - if (!_vm->_events->delay(additionalDelay, true)) - return false; - } - return true; - } - } - if (!_vm->_events->delay(10, true)) - return false; - } -} - -// This is used to wait for the music in certain situations like especially the intro -// Note: the original game didn't do this, instead it just waited for certain amounts of time -// We do this, so that the intro graphics + music work together even on faster/slower hardware. bool Music::waitUntilMSec(uint32 msecTarget, uint32 msecMax, uint32 additionalDelay, uint32 noMusicDelay) { uint32 msecCurrent = 0; diff --git a/engines/sherlock/music.h b/engines/sherlock/music.h index 25270c4abc..d13e797808 100644 --- a/engines/sherlock/music.h +++ b/engines/sherlock/music.h @@ -113,8 +113,6 @@ public: bool isPlaying(); uint32 getCurrentPosition(); - bool waitUntilTick(uint32 tick, uint32 maxTick, uint32 additionalDelay, uint32 noMusicDelay); - bool waitUntilMSec(uint32 msecTarget, uint32 maxMSec, uint32 additionalDelay, uint32 noMusicDelay); /** diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index 02ae21c5e1..3a67a75c4e 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -340,7 +340,7 @@ bool ScalpelEngine::showCityCutscene() { _screen->fadeIn(palette, 3); // Wait until the track got looped and the first few notes were played - finished = _music->waitUntilTick(0x104, 0x500, 0, 2500); + finished = _music->waitUntilMSec(4300, 21300, 0, 2500); // ticks 0x104 / ticks 0x500 } } @@ -365,7 +365,7 @@ bool ScalpelEngine::showAlleyCutscene() { _screen->fadeToBlack(2); // wait until second lower main note - finished = _music->waitUntilTick(0x64a, 0xFFFF, 0, 1000); // 652 + finished = _music->waitUntilMSec(26800, 0xFFFFFFFF, 0, 1000); // ticks 0x64A } if (finished) { @@ -377,7 +377,7 @@ bool ScalpelEngine::showAlleyCutscene() { showLBV("scream.lbv"); // wait until first "scream" in music happened - finished = _music->waitUntilTick(0xabe, 0xFFFF, 0, 6000); + finished = _music->waitUntilMSec(45800, 0xFFFFFFFF, 0, 6000); // ticks 0xABE } if (finished) { @@ -385,7 +385,7 @@ bool ScalpelEngine::showAlleyCutscene() { _screen->fadeToBlack(1); // wait until after third "scream" in music happened - finished = _music->waitUntilTick(0xb80, 0xFFFF, 0, 2000); + finished = _music->waitUntilMSec(49000, 0xFFFFFFFF, 0, 2000); // ticks 0xB80 } if (finished) @@ -405,7 +405,7 @@ bool ScalpelEngine::showAlleyCutscene() { _screen->fadeIn(palette, 1); // wait for music to end and wait an additional 2.5 seconds - finished = _music->waitUntilTick(0xFFFF, 0xFFFF, 2500, 3000); + finished = _music->waitUntilMSec(0xFFFFFFFF, 0xFFFFFFFF, 2500, 3000); } _animation->_gfxLibraryFilename = ""; @@ -427,7 +427,7 @@ bool ScalpelEngine::showStreetCutscene() { _screen->fadeToBlack(2); // wait for music a bit - finished = _music->waitUntilTick(0xE4, 0xFFFF, 0, 1000); + finished = _music->waitUntilMSec(3800, 0xFFFFFFFF, 0, 1000); // ticks 0xE4 } if (finished) |