[Scummvm-git-logs] scummvm master -> 135366d17477381601ad17ee8cc9d1533aff3829

sev- noreply at scummvm.org
Wed Feb 12 23:57:48 UTC 2025


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

Summary:
e87b541e5d VIDEO: QTVR: Implement gotoNodeID() method, remove hardcoded nodeid
54dd5e08d9 DIRECTOR: XTRAS: Fix QTVRSetNodeID() implementation
6e0c4040ce VIDEO: QTVR: Mark hovering over a node with cursor
135366d174 COMMON: FORMATS: added 'cmov' as a valid QTVR hotspot type


Commit: e87b541e5dd71dafba2ea0287b481035ba0b075c
    https://github.com/scummvm/scummvm/commit/e87b541e5dd71dafba2ea0287b481035ba0b075c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-13T00:57:29+01:00

Commit Message:
VIDEO: QTVR: Implement gotoNodeID() method, remove hardcoded nodeid

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 362750aebc6..a327f103686 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -60,6 +60,8 @@ QuickTimeDecoder::QuickTimeDecoder() {
 	_prevMouseX = _prevMouseY = 0;
 	_isMouseButtonDown = false;
 	_isVR = false;
+
+	_currentSample = 1;
 }
 
 QuickTimeDecoder::~QuickTimeDecoder() {
@@ -258,7 +260,7 @@ void QuickTimeDecoder::init() {
 	if (_qtvrType == QTVRType::PANORAMA) {
 		for (uint32 i = 0; i < Common::QuickTimeParser::_tracks.size(); i++) {
 			if (Common::QuickTimeParser::_tracks[i]->codecType == CODEC_TYPE_PANO) {
-				((PanoTrackHandler *)getTrack(Common::QuickTimeParser::_tracks[i]->targetTrack))->constructPanorama();
+				((PanoTrackHandler *)getTrack(Common::QuickTimeParser::_tracks[i]->targetTrack))->initPanorama();
 			}
 		}
 	}
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 37478cfbcfb..01f03fe1e1f 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -119,6 +119,7 @@ public:
 	};
 
 	NodeData getNodeData(uint32 nodeID);
+	void goToNode(uint32 nodeID);
 
 protected:
 	Common::QuickTimeParser::SampleDesc *readSampleDesc(Common::QuickTimeParser::Track *track, uint32 format, uint32 descSize);
@@ -147,6 +148,7 @@ private:
 	uint16 _width, _height;
 
 public:
+	int _currentSample;
 	uint16 _prevMouseX, _prevMouseY;
 	bool _isMouseButtonDown;
 	Common::Point _mouseDrag;
@@ -340,6 +342,7 @@ private:
 		Common::Rational getScaledWidth() const;
 		Common::Rational getScaledHeight() const;
 
+		void initPanorama();
 		void constructPanorama();
 		Graphics::Surface *constructMosaic(VideoTrackHandler *track, uint w, uint h, Common::String fname);
 
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 8dacd29a952..5b38bce6e53 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -262,6 +262,29 @@ QuickTimeDecoder::NodeData QuickTimeDecoder::getNodeData(uint32 nodeID) {
 	return {};
 }
 
+void QuickTimeDecoder::goToNode(uint32 nodeID) {
+	int idx = -1;
+	for (int i = 0; i < _panoTrack->panoSamples.size(); i++) {
+		if (_panoTrack->panoSamples[i].hdr.nodeID == nodeID) {
+			idx = i;
+			break;
+		}
+	}
+
+	if (idx == -1) {
+		warning("QuickTimeDecoder::goToNode(): Incorrect nodeID: %d", nodeID);
+		return;
+	}
+
+	_currentSample = idx;
+
+	setPanAngle(_panoTrack->panoSamples[_currentSample].hdr.defHPan);
+	setTiltAngle(_panoTrack->panoSamples[_currentSample].hdr.defVPan);
+	setFOV(_panoTrack->panoSamples[_currentSample].hdr.defZoom);
+
+	((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->constructPanorama();
+}
+
 /////////////////////////
 // PANO Track
 ////////////////////////
@@ -416,22 +439,47 @@ Graphics::Surface *QuickTimeDecoder::PanoTrackHandler::constructMosaic(VideoTrac
 	return target;
 }
 
+void QuickTimeDecoder::PanoTrackHandler::initPanorama() {
+	_decoder->goToNode(_decoder->_panoTrack->panoInfo.defNodeID);
+}
 
 void QuickTimeDecoder::PanoTrackHandler::constructPanorama() {
 	PanoSampleDesc *desc = (PanoSampleDesc *)_parent->sampleDescs[0];
+	PanoTrackSample *sample = &_parent->panoSamples[_decoder->_currentSample];
 
 	warning("scene: %d (%d x %d) hotspots: %d (%d x %d)", desc->_sceneTrackID, desc->_sceneSizeX, desc->_sceneSizeY,
 			desc->_hotSpotTrackID, desc->_hotSpotSizeX, desc->_hotSpotSizeY);
 
 	warning("sceneNumFrames: %d x %d sceneColorDepth: %d", desc->_sceneNumFramesX, desc->_sceneNumFramesY, desc->_sceneColorDepth);
-	warning("targetTrackID: %d", _parent->targetTrack);
+
+	warning("Node idx: %d", sample->hdr.nodeID);
+
+	int nodeidx = -1;
+	for (int i = 0; i < (int)_parent->panoInfo.nodes.size(); i++)
+		if (_parent->panoInfo.nodes[i].nodeID == sample->hdr.nodeID) {
+			nodeidx = i;
+			break;
+		}
+
+	if (nodeidx == -1) {
+		warning("constructPanorama(): Missing node %d in anoInfo", sample->hdr.nodeID);
+		nodeidx = 0;
+	}
+
+	uint32 timestamp = _parent->panoInfo.nodes[nodeidx].timestamp;
+
+	warning("Timestamp: %d", timestamp);
 
 	VideoTrackHandler *track = (VideoTrackHandler *)(_decoder->getTrack(_decoder->Common::QuickTimeParser::_tracks[desc->_sceneTrackID - 1]->targetTrack));
 
+	track->seek(Audio::Timestamp(0, timestamp, _decoder->_timeScale));
+
 	_constructedPano = constructMosaic(track, desc->_sceneNumFramesX, desc->_sceneNumFramesY, "dumps/pano-full.png");
 
 	track = (VideoTrackHandler *)(_decoder->getTrack(_decoder->Common::QuickTimeParser::_tracks[desc->_hotSpotTrackID - 1]->targetTrack));
 
+	track->seek(Audio::Timestamp(0, timestamp, _decoder->_timeScale));
+
 	_constructedHotspots = constructMosaic(track, desc->_hotSpotNumFramesX, desc->_hotSpotNumFramesY, "dumps/pano-hotspot.png");
 
 	_isPanoConstructed = true;


Commit: 54dd5e08d91830496ba9fd4e386412c432fa6386
    https://github.com/scummvm/scummvm/commit/54dd5e08d91830496ba9fd4e386412c432fa6386
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-13T00:57:37+01:00

Commit Message:
DIRECTOR: XTRAS: Fix QTVRSetNodeID() implementation

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 0342a77358e..def5113fa5f 100644
--- a/engines/director/lingo/xtras/qtvrxtra.cpp
+++ b/engines/director/lingo/xtras/qtvrxtra.cpp
@@ -528,9 +528,7 @@ void QtvrxtraXtra::m_QTVRSetNodeID(int nargs) {
 	if (newNode.nodeID)
 		me->_currentNode = newNode;
 
-	me->_video->setPanAngle(me->_currentNode.defHPan);
-	me->_video->setTiltAngle(me->_currentNode.defVPan);
-	me->_video->setFOV(me->_currentNode.defZoom);
+	me->_video->goToNode(newNode.nodeID);
 }
 
 void QtvrxtraXtra::m_QTVRGetNodeName(int nargs) {


Commit: 6e0c4040ce56df6ba67a6a09bf64fec1901160aa
    https://github.com/scummvm/scummvm/commit/6e0c4040ce56df6ba67a6a09bf64fec1901160aa
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-13T00:57:37+01:00

Commit Message:
VIDEO: QTVR: Mark hovering over a node with cursor

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 5b38bce6e53..f0426cb36e7 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -835,12 +835,6 @@ void QuickTimeDecoder::handleObjectMouseMove(int16 x, int16 y) {
 void QuickTimeDecoder::handlePanoMouseMove(int16 x, int16 y) {
 	_prevMouseX = x;
 	_prevMouseY = y;
-
-	PanoTrackHandler *track = (PanoTrackHandler *)getTrack(_panoTrack->targetTrack);
-
-	int hotspot = track->lookupHotspot(x, y);
-
-	debug(0, "hotspot: %d", hotspot);
 }
 
 #define REPEAT_DELAY 30000
@@ -1070,10 +1064,14 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 			return;
 		}
 
+		PanoTrackHandler *track = (PanoTrackHandler *)getTrack(_panoTrack->targetTrack);
+
+		int hotspot = track->lookupHotspot(x, y);
+
 		int sensitivity = 5;
 
 		if (!_isMouseButtonDown) {
-			setCursor(kCursorPano);
+			setCursor(hotspot == 0 ? kCursorPano : kCursorPanoObjPoint);
 		} else {
 			int res = 0;
 			PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
@@ -1130,7 +1128,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 			}
 
-			setCursor(_cursorDirMap[res] ? _cursorDirMap[res] : kCursorPanoNav);
+			setCursor(_cursorDirMap[res] ? _cursorDirMap[res] : hotspot == 0 ? kCursorPanoNav : kCursorPanoObjGrab);
 		}
 	}
 }


Commit: 135366d17477381601ad17ee8cc9d1533aff3829
    https://github.com/scummvm/scummvm/commit/135366d17477381601ad17ee8cc9d1533aff3829
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-13T00:57:37+01:00

Commit Message:
COMMON: FORMATS: added 'cmov' as a valid QTVR hotspot type

Changed paths:
    common/formats/quicktime.cpp
    common/formats/quicktime.h


diff --git a/common/formats/quicktime.cpp b/common/formats/quicktime.cpp
index d56ca045c57..7e2f34e1e43 100644
--- a/common/formats/quicktime.cpp
+++ b/common/formats/quicktime.cpp
@@ -1087,6 +1087,10 @@ int QuickTimeParser::readPHOT(Atom atom) {
 			pHotSpotTable.hotSpots[i].type = HotSpotType::cnod;
 			break;
 
+		case MKTAG('c', 'm', 'o', 'v'):
+			pHotSpotTable.hotSpots[i].type = HotSpotType::cmov;
+			break;
+
 		case MKTAG('l', 'i', 'n', 'k'):
 			pHotSpotTable.hotSpots[i].type = HotSpotType::link;
 			break;
diff --git a/common/formats/quicktime.h b/common/formats/quicktime.h
index 24c5316b17e..b81714144b9 100644
--- a/common/formats/quicktime.h
+++ b/common/formats/quicktime.h
@@ -201,6 +201,7 @@ protected:
 		link,
 		navg,
 		soun,
+		cmov,
 	};
 
 	struct PanoHotSpot {




More information about the Scummvm-git-logs mailing list