[Scummvm-git-logs] scummvm master -> 9943fe8d94d24d9809e4ba42799d23bfef5aef10

sev- noreply at scummvm.org
Fri Feb 14 00:17:48 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:
82b77cd1e2 VIDEO: QTVR: Properly set link hotspot cursor
9943fe8d94 VIDEO: QTVR: Added constants for the rest of the cursors


Commit: 82b77cd1e22c4232c49b435a2a9d33a01889fed0
    https://github.com/scummvm/scummvm/commit/82b77cd1e22c4232c49b435a2a9d33a01889fed0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-14T01:17:32+01:00

Commit Message:
VIDEO: QTVR: Properly set link hotspot cursor

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


diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 01f03fe1e1f..1ea8f918b8c 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -148,7 +148,7 @@ private:
 	uint16 _width, _height;
 
 public:
-	int _currentSample;
+	int _currentSample = -1;
 	uint16 _prevMouseX, _prevMouseY;
 	bool _isMouseButtonDown;
 	Common::Point _mouseDrag;
@@ -175,6 +175,8 @@ private:
 	int _zoomState = kZoomNone;
 	bool _repeatTimerActive = false;
 
+	int _hotSpotIdx = -1;
+
 	Graphics::Surface *_scaledSurface;
 	void scaleSurface(const Graphics::Surface *src, Graphics::Surface *dst,
 			const Common::Rational &scaleFactorX, const Common::Rational &scaleFactorY);
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index f0426cb36e7..c175818a35c 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -978,8 +978,12 @@ enum {
 	kCurObjDownLimit = 152,
 
 	kCursorPano = 480,
-	kCursorPanoObjPoint = 484,
-	kCursorPanoObjGrab = 485,
+	kCursorPanoLinkOver = 481,
+	kCursorPanoLinkDown = 482,
+	kCursorPanoLinkUp = 482,
+	kCursorPanoObjOver = 484,
+	kCursorPanoObjDown = 485,
+	kCursorPanoObjUp = 486,
 
 	kCursorZoomIn = 500,
 	kCursorZoomOut = 501,
@@ -1068,10 +1072,43 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 
 		int hotspot = track->lookupHotspot(x, y);
 
+		if (hotspot && _currentSample != -1) {
+			if (_hotSpotIdx == -1 || _panoTrack->panoSamples[_currentSample].hotSpotTable.hotSpots[_hotSpotIdx].id != hotspot) {
+				for (int i = 0; i < _panoTrack->panoSamples[_currentSample].hotSpotTable.hotSpots.size(); i++) {
+					if (_panoTrack->panoSamples[_currentSample].hotSpotTable.hotSpots[i].id == hotspot) {
+						_hotSpotIdx = i;
+						break;
+					}
+				}
+			}
+		} else {
+			_hotSpotIdx = -1;
+		}
+
+		HotSpotType hsType = HotSpotType::undefined;
+		if (_hotSpotIdx != -1)
+			hsType = _panoTrack->panoSamples[_currentSample].hotSpotTable.hotSpots[_hotSpotIdx].type;
+
+		int hsOver, hsDown, hsUp;
+
+		switch (hsType) {
+		case HotSpotType::link:
+			hsOver = kCursorPanoLinkOver;
+			hsDown = kCursorPanoLinkDown;
+			hsUp = kCursorPanoLinkUp;
+			break;
+
+		default:
+			hsOver = kCursorPanoObjOver;
+			hsDown = kCursorPanoObjDown;
+			hsUp = kCursorPanoObjUp;
+			break;
+		}
+
 		int sensitivity = 5;
 
 		if (!_isMouseButtonDown) {
-			setCursor(hotspot == 0 ? kCursorPano : kCursorPanoObjPoint);
+			setCursor(hotspot == 0 ? kCursorPano : hsOver);
 		} else {
 			int res = 0;
 			PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
@@ -1128,7 +1165,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 			}
 
-			setCursor(_cursorDirMap[res] ? _cursorDirMap[res] : hotspot == 0 ? kCursorPanoNav : kCursorPanoObjGrab);
+			setCursor(_cursorDirMap[res] ? _cursorDirMap[res] : hotspot == 0 ? kCursorPanoNav : hsDown);
 		}
 	}
 }


Commit: 9943fe8d94d24d9809e4ba42799d23bfef5aef10
    https://github.com/scummvm/scummvm/commit/9943fe8d94d24d9809e4ba42799d23bfef5aef10
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-14T01:17:36+01:00

Commit Message:
VIDEO: QTVR: Added constants for the rest of the cursors

Still their purpose was not figured out.

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index c175818a35c..730735c8d64 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -977,6 +977,19 @@ enum {
 	kCurObjUpLimit = 151,
 	kCurObjDownLimit = 152,
 
+	kCurDirAll = 211,
+	kCurDirL = 212,
+	kCurDirR = 213,
+	kCurDirD = 214,
+	kCurDirDL = 215,
+	kCurDirDR = 216,
+	kCurDirU = 217,
+	kCurDirUL = 218,
+	kCurDirUR = 219,
+
+	kCurDirAllDown = 220,
+	kCurDirURDown = 228,
+
 	kCursorPano = 480,
 	kCursorPanoLinkOver = 481,
 	kCursorPanoLinkDown = 482,




More information about the Scummvm-git-logs mailing list