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

Die4Ever noreply at scummvm.org
Sun Mar 27 04:28:42 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:
8bf50253a8 GROOVIE: improve skipping/fast forwarding


Commit: 8bf50253a8754217ac0ba96de5415c3faf8da214
    https://github.com/scummvm/scummvm/commit/8bf50253a8754217ac0ba96de5415c3faf8da214
Author: Die4Ever (die4ever2005 at gmail.com)
Date: 2022-03-26T23:28:35-05:00

Commit Message:
GROOVIE: improve skipping/fast forwarding

Changed paths:
    engines/groovie/script.cpp


diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 99f15ca624c..15e60008d89 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -958,24 +958,25 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
 	}
 
 	// Check if the user wants to skip the video
-	if ((_eventMouseClicked == 2) && (_videoSkipAddress != 0)) {
-		// Jump to the given address
-		_currentInstruction = _videoSkipAddress;
+	if (_eventMouseClicked == 2 || _eventKbdChar == Common::KEYCODE_ESCAPE || _eventKbdChar == Common::KEYCODE_SPACE) {
+		// we don't want to clear a left click here, that would eat the input
+		if (_eventMouseClicked == 2)
+			_eventMouseClicked = 0;
+		_eventKbdChar = 0;
+		if (_videoSkipAddress != 0) {
+			// Jump to the given address
+			_currentInstruction = _videoSkipAddress;
 
-		// Reset the skip address
-		_videoSkipAddress = 0;
+			// Reset the skip address
+			_videoSkipAddress = 0;
 
-		_bitflags = 0;
+			_bitflags = 0;
 
-		// End the playback
-		return true;
-	} else if (_eventMouseClicked == 2 || _eventKbdChar == Common::KEYCODE_ESCAPE || _eventKbdChar == Common::KEYCODE_SPACE) {
+			// End the playback
+			return true;
+		}
 		_vm->_videoPlayer->fastForward();
 		_fastForwarding = true;
-		// we don't want to clear a left click here, that would eat the input
-		if (_eventMouseClicked == 2)
-			_eventMouseClicked = 0;
-		_eventKbdChar = 0;
 	} else if (_fastForwarding) {
 		_vm->_videoPlayer->fastForward();
 	}
@@ -1278,6 +1279,12 @@ void Script::o_sleep() {
 	Common::Event ev;
 	while (_vm->_system->getMillis() < endTime && !_fastForwarding) {
 		_vm->_system->getEventManager()->pollEvent(ev);
+		if (ev.type == Common::EVENT_RBUTTONDOWN
+			|| (ev.type == Common::EVENT_KEYDOWN && (ev.kbd.ascii == Common::KEYCODE_SPACE || ev.kbd.ascii == Common::KEYCODE_ESCAPE))
+		) {
+			_fastForwarding = true;
+			break;
+		}
 		_vm->_system->updateScreen();
 		_vm->_system->delayMillis(10);
 	}




More information about the Scummvm-git-logs mailing list