[Scummvm-cvs-logs] scummvm master -> 3aef3c396d66638c780f7306a7c0855625a7d90c
m-kiewitz
m_kiewitz at users.sourceforge.net
Tue Jun 16 22:57:57 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3aef3c396d SHERLOCK: intro: msec sync instead of ticks
Commit: 3aef3c396d66638c780f7306a7c0855625a7d90c
https://github.com/scummvm/scummvm/commit/3aef3c396d66638c780f7306a7c0855625a7d90c
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-06-16T22:56:58+02:00
Commit Message:
SHERLOCK: intro: msec sync instead of ticks
Changed paths:
engines/sherlock/music.cpp
engines/sherlock/music.h
engines/sherlock/scalpel/scalpel.cpp
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index d889597..7e7b624 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 25270c4..d13e797 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 02ae21c..3a67a75 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)
More information about the Scummvm-git-logs
mailing list