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

dreammaster dreammaster at scummvm.org
Wed Aug 5 01:36:55 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:
ed4ae8c863 SHERLOCK: RT: Properly wait for press when dart game ends


Commit: ed4ae8c863e2de2143453c770f492ddf9ba1689c
    https://github.com/scummvm/scummvm/commit/ed4ae8c863e2de2143453c770f492ddf9ba1689c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-04T19:35:51-04:00

Commit Message:
SHERLOCK: RT: Properly wait for press when dart game ends

Changed paths:
    engines/sherlock/events.cpp
    engines/sherlock/tattoo/tattoo_darts.cpp



diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 204db8b..758ba12 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -325,7 +325,7 @@ bool Events::delay(uint32 time, bool interruptable) {
 		while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
 			pollEventsAndWait();
 
-			if (interruptable && (kbHit() || _pressed)) {
+			if (interruptable && (kbHit() || _mouseButtons)) {
 				clearEvents();
 				return false;
 			}
diff --git a/engines/sherlock/tattoo/tattoo_darts.cpp b/engines/sherlock/tattoo/tattoo_darts.cpp
index 844697a..cb4b52b 100644
--- a/engines/sherlock/tattoo/tattoo_darts.cpp
+++ b/engines/sherlock/tattoo/tattoo_darts.cpp
@@ -126,6 +126,7 @@ void Darts::playDarts(GameType gameType) {
 			// it entirely if you don't want to play all the way through it
 			if (_escapePressed) {
 				gameOver = true;
+				done = true;
 				playerNum = 0;
 			}
 				
@@ -219,7 +220,7 @@ void Darts::playDarts(GameType gameType) {
 			if ((playerNum == 0 && _compPlay == 1) || _compPlay == 0 || done) {
 				if (_escapePressed) {
 					done = true;
-					idx = 10;
+					break;
 				}
 			} else {
 				events.wait(20);
@@ -241,6 +242,13 @@ void Darts::playDarts(GameType gameType) {
 		}
 	}
 
+	// Wait for a keypress
+	do {
+		events.pollEventsAndWait();
+		events.setButtonState();
+	} while (!_vm->shouldQuit() && !events.kbHit() && !events._pressed);
+	events.clearEvents();
+
 	closeDarts();
 	screen.fadeToBlack();
 	screen.setFont(oldFontType);






More information about the Scummvm-git-logs mailing list