[Scummvm-cvs-logs] scummvm master -> b65436937733c519346a653493d26d3dd00fe106

dreammaster dreammaster at scummvm.org
Sun Aug 30 18:04:10 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:
b654369377 SHERLOCK: SS: Fix speed of intro sequence


Commit: b65436937733c519346a653493d26d3dd00fe106
    https://github.com/scummvm/scummvm/commit/b65436937733c519346a653493d26d3dd00fe106
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-30T12:03:40-04:00

Commit Message:
SHERLOCK: SS: Fix speed of intro sequence

Changed paths:
    engines/sherlock/events.cpp
    engines/sherlock/events.h
    engines/sherlock/scalpel/scalpel.cpp
    engines/sherlock/scalpel/tsage/logo.cpp
    engines/sherlock/scalpel/tsage/logo.h



diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 77833f8..079ea0e 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -44,6 +44,7 @@ Events::Events(SherlockEngine *vm): _vm(vm) {
 	_oldButtons = _oldRightButton = false;
 	_firstPress = false;
 	_waitCounter = 0;
+	_frameRate = 0;
 
 	if (_vm->_interactiveFl)
 		loadCursors("rmouse.vgs");
@@ -232,10 +233,14 @@ Common::Point Events::mousePos() const {
 	return _vm->_screen->_currentScroll + _mousePos;
 }
 
+void Events::setFrameRate(int newRate) {
+	_frameRate = newRate;
+}
+
 bool Events::checkForNextFrameCounter() {
 	// Check for next game frame
 	uint32 milli = g_system->getMillis();
-	if ((milli - _priorFrameTime) >= GAME_FRAME_TIME) {
+	if ((milli - _priorFrameTime) >= (1000 / _frameRate)) {
 		++_frameCounter;
 		_priorFrameTime = milli;
 
@@ -303,7 +308,7 @@ void Events::clearKeyboard() {
 }
 
 void Events::wait(int numFrames) {
-	uint32 totalMilli = numFrames * 1000 / GAME_FRAME_RATE;
+	uint32 totalMilli = numFrames * 1000 / _frameRate;
 	delay(totalMilli);
 }
 
diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h
index a44f083..8741ffa 100644
--- a/engines/sherlock/events.h
+++ b/engines/sherlock/events.h
@@ -46,6 +46,7 @@ private:
 	int _mouseButtons;
 	Common::Point _mousePos;
 	int _waitCounter;
+	int _frameRate;
 
 	/**
 	 * Check whether it's time to display the next screen frame
@@ -143,6 +144,11 @@ public:
 	Common::Point mousePos() const;
 
 	/**
+	 * Override the default frame rate
+	 */
+	void setFrameRate(int newRate);
+
+	/**
 	 * Return the current game frame number
 	 */
 	uint32 getFrameCounter() const { return _frameCounter; }
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index fc8b1e6..c3915a1 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -242,6 +242,8 @@ void ScalpelEngine::showOpening() {
 	if (isDemo() && _interactiveFl)
 		return;
 
+	_events->setFrameRate(60);
+
 	if (getPlatform() == Common::kPlatform3DO) {
 		show3DOSplash();
 
@@ -255,20 +257,22 @@ void ScalpelEngine::showOpening() {
 
 		_events->clearEvents();
 		_music->stopMusic();
-		return;
-	}
+	} else {
+		TsAGE::Logo::show(this);
 
-	TsAGE::Logo::show(this);
-	finished = showCityCutscene();
-	if (finished)
-		finished = showAlleyCutscene();
-	if (finished)
-		finished = showStreetCutscene();
-	if (finished)
-		showOfficeCutscene();
+		finished = showCityCutscene();
+		if (finished)
+			finished = showAlleyCutscene();
+		if (finished)
+			finished = showStreetCutscene();
+		if (finished)
+			showOfficeCutscene();
+
+		_events->clearEvents();
+		_music->stopMusic();
+	}
 
-	_events->clearEvents();
-	_music->stopMusic();
+	_events->setFrameRate(GAME_FRAME_RATE);
 }
 
 bool ScalpelEngine::showCityCutscene() {
diff --git a/engines/sherlock/scalpel/tsage/logo.cpp b/engines/sherlock/scalpel/tsage/logo.cpp
index 4eab019..64539b9 100644
--- a/engines/sherlock/scalpel/tsage/logo.cpp
+++ b/engines/sherlock/scalpel/tsage/logo.cpp
@@ -399,8 +399,9 @@ bool Logo::show(ScalpelEngine *vm) {
 		for (int idx = 0; idx < 4; ++idx)
 			logo->_objects[idx].update();
 
-		events.wait(2);
+		events.delay(10);
 		events.setButtonState();
+		++logo->_frameCounter;
 
 		interrupted = vm->shouldQuit() || events.kbHit() || events._pressed;
 		if (interrupted) {
@@ -476,7 +477,7 @@ void Logo::nextFrame() {
 	Screen &screen = *_vm->_screen;
 
 	if (_waitFrames) {
-		uint32 currFrame = _vm->_events->getFrameCounter();
+		uint32 currFrame = _frameCounter;
 		if (currFrame - _waitStartFrame < _waitFrames) {
 			return;
 		}
@@ -485,7 +486,7 @@ void Logo::nextFrame() {
 	}
 
 	if (_animateFrames) {
-		uint32 currFrame = _vm->_events->getFrameCounter();
+		uint32 currFrame = _frameCounter;
 		if (currFrame > _animateStartFrame + _animateFrameDelay) {
 			AnimationFrame animationFrame = _animateFrames[_animateFrame];
 			if (animationFrame.frame) {
@@ -611,14 +612,14 @@ void Logo::nextFrame() {
 
 void Logo::waitFrames(uint frames) {
 	_waitFrames = frames;
-	_waitStartFrame = _vm->_events->getFrameCounter();
+	_waitStartFrame = _frameCounter;
 }
 
 void Logo::startAnimation(uint object, uint frameDelay, const AnimationFrame *frames) {
 	_animateObject = object;
 	_animateFrameDelay = frameDelay;
 	_animateFrames = frames;
-	_animateStartFrame = _vm->_events->getFrameCounter();
+	_animateStartFrame = _frameCounter;
 	_animateFrame = 1;
 
 	_objects[object]._frame = frames[0].frame;
diff --git a/engines/sherlock/scalpel/tsage/logo.h b/engines/sherlock/scalpel/tsage/logo.h
index c9fac00..8e47ea4 100644
--- a/engines/sherlock/scalpel/tsage/logo.h
+++ b/engines/sherlock/scalpel/tsage/logo.h
@@ -195,7 +195,7 @@ class Logo {
 private:
 	ScalpelEngine *_vm;
 	TLib _lib;
-	int _counter;
+	int _counter, _frameCounter;
 	bool _finished;
 	byte _originalPalette[PALETTE_SIZE];
 	byte _palette1[PALETTE_SIZE];






More information about the Scummvm-git-logs mailing list