[Scummvm-git-logs] scummvm master -> 94e725d2ae275388e036d4fc0257b90030e51469

sev- sev at scummvm.org
Fri Mar 27 14:27:21 UTC 2020


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:
94e725d2ae DIRECTOR: Implement wait for click for the tempo channel


Commit: 94e725d2ae275388e036d4fc0257b90030e51469
    https://github.com/scummvm/scummvm/commit/94e725d2ae275388e036d4fc0257b90030e51469
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-27T15:27:04+01:00

Commit Message:
DIRECTOR: Implement wait for click for the tempo channel

Changed paths:
    engines/director/director.h
    engines/director/events.cpp
    engines/director/score.cpp


diff --git a/engines/director/director.h b/engines/director/director.h
index 272f04d9a0..cfb399fc4d 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -123,9 +123,12 @@ public:
 	Archive *createArchive();
 	void cleanupMainArchive();
 
-	void processEvents(); // events.cpp
-	void setDraggedSprite(uint16 id); // events.cpp
+	// events.cpp
+	void processEvents();
+	void setDraggedSprite(uint16 id);
+	void waitForClick();
 
+public:
 	Common::HashMap<Common::String, Score *> *_movies;
 
 	Common::RandomSource _rnd;
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 89e5269206..5bd6815173 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -151,4 +151,28 @@ void DirectorEngine::setDraggedSprite(uint16 id) {
 	warning("STUB: DirectorEngine::setDraggedSprite(%d)", id);
 }
 
+void DirectorEngine::waitForClick() {
+	setCursor(kCursorMouseUp);
+
+	bool cursor = false;
+	uint32 nextTime = g_system->getMillis() + 1000;
+
+	while (!processQuitEvent(true)) {
+		g_system->updateScreen();
+		g_system->delayMillis(10);
+
+		if (g_system->getMillis() >= nextTime) {
+			nextTime = g_system->getMillis() + 1000;
+
+			setCursor(kCursorDefault);
+
+			setCursor(cursor ? kCursorMouseDown : kCursorMouseUp);
+
+			cursor = !cursor;
+		}
+	}
+
+	setCursor(kCursorDefault);
+}
+
 } // End of namespace Director
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b0a11f8ae1..6eea6a2c2f 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1562,8 +1562,7 @@ void Score::update() {
 			// TODO Wait for channel tempo - 135
 			warning("STUB: tempo >= 136");
 		} else if (tempo == 128) {
-			// TODO Wait for Click/Key
-			warning("STUB: tempo == 128");
+			_vm->waitForClick();
 		} else if (tempo == 135) {
 			// Wait for sound channel 1
 			while (_soundManager->isChannelActive(1)) {




More information about the Scummvm-git-logs mailing list