[Scummvm-git-logs] scummvm master -> c3784002913cf4fab16aab2dee2acdbbc92bb304

sev- noreply at scummvm.org
Thu Feb 6 22:55:00 UTC 2025


This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d8070ff919 VIDEO: QTVR: Implement plain and zoom cursors for Panoramas
13f06c425e TESTBED: Pass keyboard events to QuickTIme video player
3cc1297970 VIDEO: QTVR: Implement keyboard/mouse repeater
57347923a0 VIDEO: QTVR: Restore object movies playback
a24e7d1d93 VIDEO: QTVR: Fix mouse button repeating
c378400291 VIDEO: QTVR: Ignore port size setting in object movies


Commit: d8070ff919ff1e49d6043f072066792d74198dad
    https://github.com/scummvm/scummvm/commit/d8070ff919ff1e49d6043f072066792d74198dad
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-06T23:54:33+01:00

Commit Message:
VIDEO: QTVR: Implement plain and zoom cursors for Panoramas

Changed paths:
    video/qt_decoder.h
    video/qtvr_decoder.cpp


diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 393ffc22914..25b5edd90e1 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -37,6 +37,7 @@
 
 namespace Common {
 class Archive;
+struct KeyState;
 class Rational;
 }
 
@@ -79,6 +80,7 @@ public:
 
 	void handleMouseMove(int16 x, int16 y);
 	void handleMouseButton(bool isDown, int16 x = -1, int16 y = -1);
+	void handleKey(Common::KeyState &state, bool down);
 
 	float getPanAngle() const { return _panAngle; }
 	void setPanAngle(float panAngle) { _panAngle = panAngle; }
@@ -132,6 +134,9 @@ private:
 	void handlePanoMouseMove(int16 x, int16 y);
 	void handlePanoMouseButton(bool isDown, int16 x, int16 y);
 
+	void handleObjectKey(Common::KeyState &state, bool down);
+	void handlePanoKey(Common::KeyState &state, bool down);
+
 	void closeQTVR();
 	void updateAngles();
 	void updateQTVRCursor(int16 x, int16 y);
@@ -157,6 +162,7 @@ private:
 	float _tiltAngle = 0.0f;
 	float _fov = 56.0f;
 	float _hfov = 56.0f;
+	int _zoomState = kZoomNone;
 
 	Graphics::Surface *_scaledSurface;
 	void scaleSurface(const Graphics::Surface *src, Graphics::Surface *dst,
@@ -164,6 +170,14 @@ private:
 
 	bool _enableEditListBoundsCheckQuirk;
 
+	enum {
+		kZoomNone,
+		kZoomQuestion,
+		kZoomIn,
+		kZoomOut,
+		kZoomLimit,
+	};
+
 	class VideoSampleDesc : public Common::QuickTimeParser::SampleDesc {
 	public:
 		VideoSampleDesc(Common::QuickTimeParser::Track *parentTrack, uint32 codecTag);
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 14a7a86f929..a903c515dc5 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -35,6 +35,7 @@
 #include "common/archive.h"
 #include "common/debug.h"
 #include "common/file.h"
+#include "common/keyboard.h"
 #include "common/memstream.h"
 #include "common/system.h"
 #include "common/textconsole.h"
@@ -148,11 +149,11 @@ void QuickTimeDecoder::handleMouseMove(int16 x, int16 y) {
 		handleObjectMouseMove(x, y);
 	else if (_qtvrType == QTVRType::PANORAMA)
 		handlePanoMouseMove(x, y);
-}
 
-void QuickTimeDecoder::handleObjectMouseMove(int16 x, int16 y) {
 	updateQTVRCursor(x, y);
+}
 
+void QuickTimeDecoder::handleObjectMouseMove(int16 x, int16 y) {
 	if (!_isMouseButtonDown)
 		return;
 
@@ -239,6 +240,8 @@ void QuickTimeDecoder::handleMouseButton(bool isDown, int16 x, int16 y) {
 		handleObjectMouseButton(isDown, x, y);
 	else if (_qtvrType == QTVRType::PANORAMA)
 		handlePanoMouseButton(isDown, x, y);
+
+	updateQTVRCursor(x, y);
 }
 
 void QuickTimeDecoder::handleObjectMouseButton(bool isDown, int16 x, int16 y) {
@@ -259,8 +262,6 @@ void QuickTimeDecoder::handleObjectMouseButton(bool isDown, int16 x, int16 y) {
 	} else {
 		_isMouseButtonDown = isDown;
 	}
-
-	updateQTVRCursor(x, y);
 }
 
 void QuickTimeDecoder::handlePanoMouseButton(bool isDown, int16 x, int16 y) {
@@ -272,6 +273,30 @@ void QuickTimeDecoder::handlePanoMouseButton(bool isDown, int16 x, int16 y) {
 	}
 }
 
+void QuickTimeDecoder::handleKey(Common::KeyState &state, bool down) {
+	if (_qtvrType == QTVRType::OBJECT)
+		handleObjectKey(state, down);
+	else if (_qtvrType == QTVRType::PANORAMA)
+		handlePanoKey(state, down);
+
+	updateQTVRCursor(_prevMouseX, _prevMouseY);
+}
+
+void QuickTimeDecoder::handleObjectKey(Common::KeyState &state, bool down) {
+}
+
+void QuickTimeDecoder::handlePanoKey(Common::KeyState &state, bool down) {
+	if (state.flags & (Common::KBD_SHIFT | Common::KBD_CTRL)) {
+		_zoomState = kZoomQuestion;
+	} else if (state.flags & Common::KBD_SHIFT) {
+		_zoomState = kZoomIn;
+	} else if (state.flags & Common::KBD_CTRL) {
+		_zoomState = kZoomOut;
+	} else {
+		_zoomState = kZoomNone;
+	}
+}
+
 void QuickTimeDecoder::setCurrentRow(int row) {
 	VideoTrackHandler *track = (VideoTrackHandler *)_nextVideoTrack;
 
@@ -578,6 +603,14 @@ enum {
 	kCurObjRightM90 = 150,
 	kCurObjUpLimit = 151,
 	kCurObjDownLimit = 152,
+	kCursorPano = 480,
+
+	kCursorZoomIn = 500,
+	kCursorZoomOut = 501,
+	kCursorZoomQuestion = 502,
+	kCursorZoomLimit = 503,
+
+	kCursorPanoNav = 510,
 	kCurLastCursor
 };
 
@@ -595,6 +628,27 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 			setCursor(kCurObjRight90 + tiltIdx);
 		else
 			setCursor(_isMouseButtonDown ? kCurGrab : kCurHand);
+	} else if (_qtvrType == QTVRType::PANORAMA) {
+		if (_zoomState != kZoomNone) {
+			switch (_zoomState) {
+			case kZoomIn:
+				setCursor(kCursorZoomIn);
+				break;
+			case kZoomOut:
+				setCursor(kCursorZoomOut);
+				break;
+			case kZoomQuestion:
+				setCursor(kCursorZoomQuestion);
+				break;
+			case kZoomLimit:
+				setCursor(kCursorZoomLimit);
+				break;
+			}
+
+			return;
+		}
+
+		setCursor(_isMouseButtonDown ? kCursorPanoNav : kCursorPano);
 	}
 }
 


Commit: 13f06c425e97efbacf17712d8561a12ec13d2b16
    https://github.com/scummvm/scummvm/commit/13f06c425e97efbacf17712d8561a12ec13d2b16
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-06T23:54:33+01:00

Commit Message:
TESTBED: Pass keyboard events to QuickTIme video player

Changed paths:
    engines/testbed/video.cpp


diff --git a/engines/testbed/video.cpp b/engines/testbed/video.cpp
index 019a28c85e9..a0ce9a7b226 100644
--- a/engines/testbed/video.cpp
+++ b/engines/testbed/video.cpp
@@ -104,6 +104,8 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
 
 	video->start();
 
+	Common::Point mouse;
+
 	while (!video->endOfVideo()) {
 		if (video->needsUpdate()) {
 			uint32 pos = video->getTime();
@@ -143,8 +145,11 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
 			Common::Event event;
 
 			while (g_system->getEventManager()->pollEvent(event)) {
-				if (event.mouse.x >= x && event.mouse.x < x + mw &&
-						event.mouse.y >= y && event.mouse.y < y + mh) {
+				if (Common::isMouseEvent(event))
+					mouse = event.mouse;
+
+				if (mouse.x >= x && mouse.x < x + mw &&
+						mouse.y >= y && mouse.y < y + mh) {
 					switch (event.type) {
 					case Common::EVENT_LBUTTONDOWN:
 						((Video::QuickTimeDecoder *)video)->handleMouseButton(true, event.mouse.x - x, event.mouse.y - y);
@@ -155,6 +160,10 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
 					case Common::EVENT_MOUSEMOVE:
 						((Video::QuickTimeDecoder *)video)->handleMouseMove(event.mouse.x - x, event.mouse.y - y);
 						break;
+					case Common::EVENT_KEYUP:
+					case Common::EVENT_KEYDOWN:
+						((Video::QuickTimeDecoder *)video)->handleKey(event.kbd, event.type == Common::EVENT_KEYDOWN);
+						break;
 					default:
 						break;
 					}


Commit: 3cc1297970eddc817510bb5df3d16a2cce2a42d4
    https://github.com/scummvm/scummvm/commit/3cc1297970eddc817510bb5df3d16a2cce2a42d4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-06T23:54:33+01:00

Commit Message:
VIDEO: QTVR: Implement keyboard/mouse repeater

Changed paths:
    video/qt_decoder.h
    video/qtvr_decoder.cpp


diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 25b5edd90e1..e4ca2a60354 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -31,13 +31,13 @@
 #define VIDEO_QT_DECODER_H
 
 #include "audio/decoders/quicktime_intern.h"
+#include "common/keyboard.h"
 #include "common/scummsys.h"
 
 #include "video/video_decoder.h"
 
 namespace Common {
 class Archive;
-struct KeyState;
 class Rational;
 }
 
@@ -146,8 +146,14 @@ private:
 
 	uint16 _width, _height;
 
+public:
 	uint16 _prevMouseX, _prevMouseY;
 	bool _isMouseButtonDown;
+
+	bool _isKeyDown = false;
+	Common::KeyState _lastKey;
+
+private:
 	Common::Rect _curBbox;
 
 	int _currentQTVRCursor = -1;
@@ -163,6 +169,7 @@ private:
 	float _fov = 56.0f;
 	float _hfov = 56.0f;
 	int _zoomState = kZoomNone;
+	bool _repeatTimerActive = false;
 
 	Graphics::Surface *_scaledSurface;
 	void scaleSurface(const Graphics::Surface *src, Graphics::Surface *dst,
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index a903c515dc5..89f694e7d9f 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -39,6 +39,7 @@
 #include "common/memstream.h"
 #include "common/system.h"
 #include "common/textconsole.h"
+#include "common/timer.h"
 #include "common/util.h"
 
 #include "common/compression/unzip.h"
@@ -54,6 +55,8 @@ namespace Video {
 
 static const char * const MACGUI_DATA_BUNDLE = "macgui.dat";
 
+static void repeatCallback(void *data);
+
 ////////////////////////////////////////////
 // QuickTimeDecoder methods related to QTVR
 ////////////////////////////////////////////
@@ -119,6 +122,11 @@ void QuickTimeDecoder::closeQTVR() {
 	delete _dataBundle;
 	_dataBundle = nullptr;
 	cleanupCursors();
+
+	if (_repeatTimerActive) {
+		_repeatTimerActive = false;
+		g_system->getTimerManager()->removeTimerProc(&repeatCallback);
+	}
 }
 
 void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
@@ -234,6 +242,17 @@ void QuickTimeDecoder::handlePanoMouseMove(int16 x, int16 y) {
 	}
 }
 
+#define REPEAT_DELAY 100000
+
+static void repeatCallback(void *data) {
+	QuickTimeDecoder *decoder = (QuickTimeDecoder *)data;
+
+	if (decoder->_isKeyDown)
+		decoder->handleKey(decoder->_lastKey, true);
+
+	if (decoder->_isMouseButtonDown)
+		decoder->handleMouseButton(true, decoder->_prevMouseX, decoder->_prevMouseY);
+}
 
 void QuickTimeDecoder::handleMouseButton(bool isDown, int16 x, int16 y) {
 	if (_qtvrType == QTVRType::OBJECT)
@@ -241,6 +260,17 @@ void QuickTimeDecoder::handleMouseButton(bool isDown, int16 x, int16 y) {
 	else if (_qtvrType == QTVRType::PANORAMA)
 		handlePanoMouseButton(isDown, x, y);
 
+	if (isDown) {
+		if (!_repeatTimerActive)
+			g_system->getTimerManager()->installTimerProc(&repeatCallback, REPEAT_DELAY, this, "Mouse Repeat Handler");
+		_repeatTimerActive = true;
+	} else {
+		if (_repeatTimerActive) {
+			_repeatTimerActive = false;
+			g_system->getTimerManager()->removeTimerProc(&repeatCallback);
+		}
+	}
+
 	updateQTVRCursor(x, y);
 }
 
@@ -279,6 +309,20 @@ void QuickTimeDecoder::handleKey(Common::KeyState &state, bool down) {
 	else if (_qtvrType == QTVRType::PANORAMA)
 		handlePanoKey(state, down);
 
+	if (down) {
+		_lastKey = state;
+		_isKeyDown = true;
+		if (!_repeatTimerActive)
+			g_system->getTimerManager()->installTimerProc(&repeatCallback, REPEAT_DELAY, this, "Keyboard Repeat Handler");
+		_repeatTimerActive = true;
+	} else {
+		_isKeyDown = false;
+		if (_repeatTimerActive) {
+			_repeatTimerActive = false;
+			g_system->getTimerManager()->removeTimerProc(&repeatCallback);
+		}
+	}
+
 	updateQTVRCursor(_prevMouseX, _prevMouseY);
 }
 
@@ -286,7 +330,7 @@ void QuickTimeDecoder::handleObjectKey(Common::KeyState &state, bool down) {
 }
 
 void QuickTimeDecoder::handlePanoKey(Common::KeyState &state, bool down) {
-	if (state.flags & (Common::KBD_SHIFT | Common::KBD_CTRL)) {
+	if ((state.flags & Common::KBD_SHIFT) && (state.flags & Common::KBD_CTRL)) {
 		_zoomState = kZoomQuestion;
 	} else if (state.flags & Common::KBD_SHIFT) {
 		_zoomState = kZoomIn;


Commit: 57347923a0c4d76c84304de07292a9f10fc1fe5b
    https://github.com/scummvm/scummvm/commit/57347923a0c4d76c84304de07292a9f10fc1fe5b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-06T23:54:33+01:00

Commit Message:
VIDEO: QTVR: Restore object movies playback

Changed paths:
    video/qt_decoder.cpp


diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 79d2052f5c3..362750aebc6 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -404,7 +404,7 @@ QuickTimeDecoder::VideoTrackHandler::~VideoTrackHandler() {
 
 bool QuickTimeDecoder::VideoTrackHandler::endOfTrack() const {
 	// A track is over when we've finished going through all edits
-	if (!_decoder->_isVR)
+	if (_decoder->_qtvrType != QTVRType::PANORAMA)
 		return _reversed ? (_curEdit == 0 && _curFrame < 0) : atLastEdit();
 	else
 		return true;


Commit: a24e7d1d933e7d757996e9f2437656843b740889
    https://github.com/scummvm/scummvm/commit/a24e7d1d933e7d757996e9f2437656843b740889
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-06T23:54:33+01:00

Commit Message:
VIDEO: QTVR: Fix mouse button repeating

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 89f694e7d9f..046d460cb4f 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -287,11 +287,10 @@ void QuickTimeDecoder::handleObjectMouseButton(bool isDown, int16 x, int16 y) {
 		} else {
 			_prevMouseX = x;
 			_prevMouseY = y;
-			_isMouseButtonDown = isDown;
 		}
-	} else {
-		_isMouseButtonDown = isDown;
 	}
+
+	_isMouseButtonDown = isDown;
 }
 
 void QuickTimeDecoder::handlePanoMouseButton(bool isDown, int16 x, int16 y) {


Commit: c3784002913cf4fab16aab2dee2acdbbc92bb304
    https://github.com/scummvm/scummvm/commit/c3784002913cf4fab16aab2dee2acdbbc92bb304
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-06T23:54:34+01:00

Commit Message:
VIDEO: QTVR: Ignore port size setting in object movies

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 046d460cb4f..5a0cb304551 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -133,10 +133,12 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 	if (!isVR())
 		error("QuickTimeDecoder::setTargetSize() called on non-VR movie");
 
-	_width = w;
-	_height = h;
+	if (_qtvrType == QTVRType::PANORAMA) {
+		_width = w;
+		_height = h;
 
-	setFOV(_fov);
+		setFOV(_fov);
+	}
 }
 
 void QuickTimeDecoder::setFOV(float fov) {




More information about the Scummvm-git-logs mailing list