[Scummvm-git-logs] scummvm master -> 684a44e95ae10b1630164592f7a24873d100413c

sev- noreply at scummvm.org
Wed Feb 19 13:26:14 UTC 2025


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

Summary:
90cceae302 VIDEO: QTVR: Added API for configuring QTVR player
684a44e95a DIRECTOR: XLIBS: Unstub rest of the documented methods of QTVR Xtra


Commit: 90cceae302fb5aeb0861b5af8c718035556b7a5b
    https://github.com/scummvm/scummvm/commit/90cceae302fb5aeb0861b5af8c718035556b7a5b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T14:25:56+01:00

Commit Message:
VIDEO: QTVR: Added API for configuring QTVR player

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


diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index f8057d7f915..4631c8d6ebf 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -54,13 +54,9 @@ namespace Video {
 ////////////////////////////////////////////
 
 QuickTimeDecoder::QuickTimeDecoder() {
-	_scaledSurface = 0;
+	_scaledSurface = nullptr;
 	_width = _height = 0;
 	_enableEditListBoundsCheckQuirk = false;
-	_isMouseButtonDown = false;
-	_isVR = false;
-
-	_currentSample = 1;
 }
 
 QuickTimeDecoder::~QuickTimeDecoder() {
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 8269fb999d8..d3bff2fc89d 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -78,6 +78,9 @@ public:
 	void enableEditListBoundsCheckQuirk(bool enable) { _enableEditListBoundsCheckQuirk = enable; }
 	Common::String getAliasPath();
 
+	////////////////
+	// QTVR stuff
+	////////////////
 	void setTargetSize(uint16 w, uint16 h);
 
 	void handleMouseMove(int16 x, int16 y);
@@ -117,8 +120,16 @@ public:
 	bool isVR() const { return _isVR; }
 	QTVRType getQTVRType() const { return _qtvrType; }
 
-	uint8 getWarpMode() const { return _warpMode; }
-	void setWarpMode(uint8 warpMode) { _warpMode = warpMode; }
+	int getWarpMode() const { return _warpMode; }
+	void setWarpMode(int warpMode);
+	float getQuality() const { return _quality; }
+	void setQuality(float quality);
+	Common::String getTransitionMode() const { return _transitionMode == kTransitionModeNormal ? "normal" : "swing"; }
+	void setTransitionMode(Common::String mode);
+	float getTransitionSpeed() const { return _transitionSpeed; }
+	void setTransitionSpeed(float speed);
+	Common::String getUpdateMode() const;
+	void setUpdateMode(Common::String mode);
 
 	void renderHotspots(bool mode);
 
@@ -171,7 +182,7 @@ private:
 public:
 	int _currentSample = -1;
 	Common::Point _prevMouse;
-	bool _isMouseButtonDown;
+	bool _isMouseButtonDown = false;
 	Common::Point _mouseDrag;
 
 	bool _isKeyDown = false;
@@ -183,6 +194,15 @@ public:
 		kZoomIn,
 		kZoomOut,
 		kZoomLimit,
+
+		kTransitionModeNormal,
+		kTransitionModeSwing,
+
+		kUpdateModeNormal,
+		kUpdateModeUpdateBoth,
+		kUpdateModeOffscreenOnly,
+		kUpdateModeFromOffscreen,
+		kUpdateModeDirectToScreen,
 	};
 
 private:
@@ -193,9 +213,13 @@ private:
 	Graphics::Cursor **_cursorCache = nullptr;
 	int _cursorDirMap[256];
 
-	bool _isVR;
+	bool _isVR = false;
 
-	uint8 _warpMode; // (2 | 1 | 0) for 2-d, 1-d or no warping
+	uint8 _warpMode = 2; // (2 | 1 | 0) for 2-d, 1-d or no warping
+	float _quality = 0.0f;
+	int _transitionMode = kTransitionModeNormal;
+	float _transitionSpeed = 1.0f;
+	int _updateMode = kUpdateModeNormal;
 
 	float _panAngle = 0.0f;
 	float _tiltAngle = 0.0f;
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index bcd54c1e16a..24953ea494c 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -142,6 +142,136 @@ void QuickTimeDecoder::renderHotspots(bool mode) {
 	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
 }
 
+void QuickTimeDecoder::setQuality(float quality) {
+	_quality = quality;
+
+	warning("STUB: Quality mode set to %f", quality);
+
+	// 4.0 Highest quality rendering. The rendered image is fully anti-aliased.
+	//
+	// 2.0 The rendered image is partially anti-aliased.
+	//
+	// 1.0 The rendered image is not anti-aliased.
+	//
+	// 0.0 Images are rendered at quality 1.0 when the user is interactively
+	//     panning or zooming, and are automatically updated at quality
+	//     4.0 during idle time when the user stops panning or zooming.
+	//     All other updates are rendered at quality 4.0.
+
+	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
+}
+
+void QuickTimeDecoder::setWarpMode(int warpMode) {
+	_warpMode = warpMode;
+
+	warning("STUB: Warp mode set to %d", warpMode);
+
+	// 2 Two-dimensional warping. This produces perspectively correct
+	//   images from a panoramic source picture.
+	//
+	// 1 One-dimensional warping.
+	//
+	// 0 No warping. This reproduces the source panorama directly,
+	//   without warping it at all.
+
+	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
+}
+
+void QuickTimeDecoder::setTransitionMode(Common::String mode) {
+	if (mode.equalsIgnoreCase("swing"))
+		_transitionMode = kTransitionModeSwing;
+	else
+		_transitionMode = kTransitionModeNormal;
+
+	warning("STUB: Transition mode set to '%s'", getTransitionMode().c_str());
+
+	// normal The new view is imaged and displayed. No transition effect is
+	//        used. The user sees a "cut" from the current view to the new
+	//        view.
+	//
+	// swing  If the new view is in the current node, the view point moves
+	//        smoothly from the current view to the new view, taking the
+	//        shortest path if the panorama wraps around. The speed of the
+	//        swing is controlled by the transitionSpeed property. If the new
+	//        view is in a different node, the new view is imaged and
+	//        displayed with a "normal" transition.
+	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
+}
+
+void QuickTimeDecoder::setTransitionSpeed(float speed) {
+	_transitionSpeed = speed;
+
+	warning("STUB: Transition Speed set to %f", speed);
+
+	// The TransitionSpeed is a floating point quantity that provides the slowest swing transition
+	// at 1.0 and faster transitions at higher values. On mid-range computers, a rate of 4.0
+	// performs well off CD-ROM.
+	//
+	// If the TransitionSpeed property value is set to a negative number, swing updates will act
+	// the same as normal updates
+
+	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
+}
+
+Common::String QuickTimeDecoder::getUpdateMode() const {
+	switch (_updateMode) {
+	case kUpdateModeUpdateBoth:
+		return "updateBoth";
+	case kUpdateModeOffscreenOnly:
+		return "offscreenOnly";
+	case kUpdateModeFromOffscreen:
+		return "fromOffscreen";
+	case kUpdateModeDirectToScreen:
+		return "directToScreen";
+	case kUpdateModeNormal:
+	default:
+		return "normal";
+	}
+}
+
+void QuickTimeDecoder::setUpdateMode(Common::String mode) {
+	if (mode.equalsIgnoreCase("updateBoth"))
+		_updateMode = kUpdateModeUpdateBoth;
+	else if (mode.equalsIgnoreCase("offscreenOnly"))
+		_updateMode = kUpdateModeOffscreenOnly;
+	else if (mode.equalsIgnoreCase("fromOffscreen"))
+		_updateMode = kUpdateModeFromOffscreen;
+	else if (mode.equalsIgnoreCase("directToScreen"))
+		_updateMode = kUpdateModeDirectToScreen;
+	else
+		_updateMode = kUpdateModeNormal;
+
+	warning("STUB: Update mode set to '%s'", getUpdateMode().c_str());
+
+	// normal         Images are computed and displayed directly onto the screen
+	//                while interactively panning and zooming. Provides the fastest
+	//                overall frame rate, but individual frame draw times may be
+	//                relatively slow for high-quality images on lower performance
+	//                systems. Programmatic updates are displayed into the offscreen
+	//                buffer, and then onto the screen.
+	//
+	// update         Both Images are computed and displayed into the offscreen buffer,and
+	//                then onto the screen. The use of the back buffer reduces the
+	//                overall frame rate but provides the fastest imaging time for each
+	//                frame.
+	//
+	// offscreenOnly  Images are computed and displayed into the offscreen buffer
+	//                only, and are not copied to the screen. Useful for preparing for a
+	//                screen refresh that will have to happen quickly.
+	//
+	// fromOffscreen  The offscreen buffer is copied directly to the screen. The offscreen
+	//                buffer is refreshed only if it is out of date. The offscreen buffer is
+	//                automatically updated if necessary to keep it in sync with the
+	//                screen image.
+	//
+	// directToScreen Images are computed and displayed directly to the screen,
+	//                without changing the offscreen buffer. Provides the fastest
+	//                overall frame rate, but individual frame draw times may be
+	//                relatively slow for high-quality images on lower performance
+	//                systems.
+	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
+}
+
 void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 	if (!isVR())
 		error("QuickTimeDecoder::setTargetSize() called on non-VR movie");


Commit: 684a44e95ae10b1630164592f7a24873d100413c
    https://github.com/scummvm/scummvm/commit/684a44e95ae10b1630164592f7a24873d100413c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T14:25:56+01:00

Commit Message:
DIRECTOR: XLIBS: Unstub rest of the documented methods of QTVR Xtra

Changed paths:
    engines/director/lingo/xtras/qtvrxtra.cpp


diff --git a/engines/director/lingo/xtras/qtvrxtra.cpp b/engines/director/lingo/xtras/qtvrxtra.cpp
index 298a557c20a..7110acc6060 100644
--- a/engines/director/lingo/xtras/qtvrxtra.cpp
+++ b/engines/director/lingo/xtras/qtvrxtra.cpp
@@ -839,14 +839,69 @@ void QtvrxtraXtra::m_QTVRGetNodeName(int nargs) {
 	g_lingo->push(me->_video->getCurrentNodeName());
 }
 
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetQuality, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRSetQuality, 1)
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetTransitionMode, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRSetTransitionMode, 1)
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetTransitionSpeed, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRSetTransitionSpeed, 1)
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetUpdateMode, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRSetUpdateMode, 1)
+void QtvrxtraXtra::m_QTVRGetQuality(int nargs) {
+	ARGNUMCHECK(0);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	g_lingo->push(me->_video->getQuality());
+}
+
+void QtvrxtraXtra::m_QTVRSetQuality(int nargs) {
+	ARGNUMCHECK(1);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	me->_video->setQuality(g_lingo->pop().asInt());
+}
+
+void QtvrxtraXtra::m_QTVRGetTransitionMode(int nargs) {
+	ARGNUMCHECK(0);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	g_lingo->push(me->_video->getTransitionMode());
+}
+
+void QtvrxtraXtra::m_QTVRSetTransitionMode(int nargs) {
+	ARGNUMCHECK(1);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	me->_video->setTransitionMode(g_lingo->pop().asString());
+}
+
+void QtvrxtraXtra::m_QTVRGetTransitionSpeed(int nargs) {
+	ARGNUMCHECK(0);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	g_lingo->push(me->_video->getTransitionSpeed());
+}
+
+void QtvrxtraXtra::m_QTVRSetTransitionSpeed(int nargs) {
+	ARGNUMCHECK(1);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	me->_video->setTransitionSpeed(g_lingo->pop().asFloat());
+}
+
+void QtvrxtraXtra::m_QTVRGetUpdateMode(int nargs) {
+	ARGNUMCHECK(0);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	g_lingo->push(me->_video->getUpdateMode());
+}
+
+void QtvrxtraXtra::m_QTVRSetUpdateMode(int nargs) {
+	ARGNUMCHECK(1);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	me->_video->setUpdateMode(g_lingo->pop().asString());
+}
 
 void QtvrxtraXtra::m_QTVRGetVisible(int nargs) {
 	ARGNUMCHECK(0);
@@ -864,8 +919,22 @@ void QtvrxtraXtra::m_QTVRSetVisible(int nargs) {
 	me->_visible = (bool)g_lingo->pop().asInt();
 }
 
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetWarpMode, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRSetWarpMode, 1)
+void QtvrxtraXtra::m_QTVRGetWarpMode(int nargs) {
+	ARGNUMCHECK(0);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	g_lingo->push(me->_video->getWarpMode());
+}
+
+void QtvrxtraXtra::m_QTVRSetWarpMode(int nargs) {
+	ARGNUMCHECK(1);
+
+	QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+	me->_video->setWarpMode(g_lingo->pop().asInt());
+}
+
 XOBJSTUB(QtvrxtraXtra::m_QTVRCollapseToHotSpotRgn, 0)
 XOBJSTUB(QtvrxtraXtra::m_QTVRZoomOutEffect, 0)
 




More information about the Scummvm-git-logs mailing list