[Scummvm-git-logs] scummvm master -> 8b4e75ded7a4d02adc5efcbc5aa5fd54e12f24fe

neuromancer noreply at scummvm.org
Mon Apr 18 19:40:36 UTC 2022


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:
8b4e75ded7 HYPNO: allow to skip fullscreen videos using three clicks in a row (useful for mobile or web plaforms)


Commit: 8b4e75ded7a4d02adc5efcbc5aa5fd54e12f24fe
    https://github.com/scummvm/scummvm/commit/8b4e75ded7a4d02adc5efcbc5aa5fd54e12f24fe
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-18T21:40:23+02:00

Commit Message:
HYPNO: allow to skip fullscreen videos using three clicks in a row (useful for mobile or web plaforms)

Changed paths:
    engines/hypno/hypno.cpp


diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index f0888871671..d4956b09fc3 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -199,7 +199,9 @@ void HypnoEngine::runIntros(Videos &videos) {
 	debugC(1, kHypnoDebugScene, "Starting run intros with %d videos!", videos.size());
 	Common::Event event;
 	stopSound();
-	// defaultCursor();
+	bool skip = false;
+	int clicked[3] = {-1, -1, -1};
+	int clicks = 0;
 
 	for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
 		playVideo(*it);
@@ -210,12 +212,17 @@ void HypnoEngine::runIntros(Videos &videos) {
 			// Events
 			switch (event.type) {
 			case Common::EVENT_KEYDOWN:
-				if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
-					for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
-						if (it->decoder)
-							skipVideo(*it);
-					}
-					videos.clear();
+				if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
+					skip = true;
+				break;
+			case Common::EVENT_LBUTTONDOWN:
+				if (videos.size() == 1) {
+					int first = (clicks - 2) % 3;
+					int last = clicks % 3;
+					clicked[last] = videos[0].decoder->getCurFrame();
+					if (clicks >= 2 && clicked[last] - clicked[first] <= 10)
+						skip = true;
+					clicks++;
 				}
 				break;
 
@@ -223,6 +230,14 @@ void HypnoEngine::runIntros(Videos &videos) {
 				break;
 			}
 		}
+		if (skip) {
+			for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
+				if (it->decoder)
+					skipVideo(*it);
+			}
+			videos.clear();
+		}
+
 		bool playing = false;
 		for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
 			assert(!it->loop);




More information about the Scummvm-git-logs mailing list