[Scummvm-git-logs] scummvm master -> 73e930587b267ff21f7d25d6389c215522289215

sev- noreply at scummvm.org
Thu Feb 20 00:34:44 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:
81eeb05d75 VIDEO: QTVR: Use HotSpotType as uint32
ca1500833b COMMON: FORMATS: Get rid of HotSpotType in QTVR
c7a9f7afe5 VIDEO: QTVR: Remove redundant casts
73e930587b VIDEO: QTVR: Fix cursor stoppers for tilt


Commit: 81eeb05d75e1652052736cd4161f1538e2f14b9b
    https://github.com/scummvm/scummvm/commit/81eeb05d75e1652052736cd4161f1538e2f14b9b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-20T01:34:25+01:00

Commit Message:
VIDEO: QTVR: Use HotSpotType as uint32

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 9338e2b7189..479913650b7 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -986,7 +986,7 @@ const QuickTimeDecoder::PanoHotSpot *QuickTimeDecoder::getHotSpotByID(int id) {
 const QuickTimeDecoder::PanoNavigation *QuickTimeDecoder::getHotSpotNavByID(int id) {
 	const QuickTimeDecoder::PanoHotSpot *hotspot = getHotSpotByID(id);
 
-	if (hotspot->type != HotSpotType::navg)
+	if ((uint32)hotspot->type != MKTAG('n','a','v','g'))
 		return nullptr;
 
 	return _panoTrack->panoSamples[_currentSample].navTable.get(hotspot->typeData);
@@ -1129,7 +1129,7 @@ void QuickTimeDecoder::handlePanoMouseButton(bool isDown, int16 x, int16 y, bool
 			_clickedHotspot = _rolloverHotspot;
 	}
 
-	if (!repeat && !isDown && _rolloverHotspot && _rolloverHotspot->type == HotSpotType::link && _prevMouse == _mouseDrag) {
+	if (!repeat && !isDown && _rolloverHotspot && (uint32)_rolloverHotspot->type == MKTAG('l','i','n','k') && _prevMouse == _mouseDrag) {
 		PanoLink *link = _panoTrack->panoSamples[_currentSample].linkTable.get(_rolloverHotspot->typeData);
 
 		if (link) {
@@ -1343,22 +1343,22 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 		}
 
 		// Get hotspot cursors
-		HotSpotType hsType = HotSpotType::undefined;
+		uint32 hsType = MKTAG('u','n','d','f');
 
 		if (_rolloverHotspot)
-			hsType = _rolloverHotspot->type;
+			hsType = (uint32)_rolloverHotspot->type;
 
 		int hsOver, hsDown, hsUp;
 
 		switch (hsType) {
-		case HotSpotType::link:
+		case MKTAG('l','i','n','k'):
 			hsOver = kCursorPanoLinkOver;
 			hsDown = kCursorPanoLinkDown;
 			hsUp = kCursorPanoLinkUp;
 			break;
 
 		default:
-			if (hsType != HotSpotType::undefined)
+			if (hsType !=  MKTAG('u','n','d','f'))
 				debug(3, "Hotspot type: %s", tag2str((uint32)hsType));
 			hsOver = kCursorPanoObjOver;
 			hsDown = kCursorPanoObjDown;


Commit: ca1500833bf749a8e254e0a885ee951c57382bdf
    https://github.com/scummvm/scummvm/commit/ca1500833bf749a8e254e0a885ee951c57382bdf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-20T01:34:32+01:00

Commit Message:
COMMON: FORMATS: Get rid of HotSpotType in QTVR

This is supposed to be user-extendable, thus, there always
will be "unknown" hotspots. So, we pass it as uint32

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


diff --git a/common/formats/quicktime.cpp b/common/formats/quicktime.cpp
index 8bb75ec5d5b..489dc3120d4 100644
--- a/common/formats/quicktime.cpp
+++ b/common/formats/quicktime.cpp
@@ -1081,43 +1081,7 @@ int QuickTimeParser::readPHOT(Atom atom) {
 
 		_fd->readUint16BE(); // reserved
 
-		uint32 type = _fd->readUint32BE();
-
-		switch (type) {
-		case MKTAG('a', 'n', 'i', 'm'):
-			pHotSpotTable.hotSpots[i].type = HotSpotType::anim;
-			break;
-
-		case MKTAG('c', 'n', 'o', 'd'):
-			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;
-
-		case MKTAG('n', 'a', 'v', 'g'):
-			pHotSpotTable.hotSpots[i].type = HotSpotType::navg;
-			break;
-
-		case MKTAG('s', 'o', 'u', 'n'):
-			pHotSpotTable.hotSpots[i].type = HotSpotType::soun;
-			break;
-
-		case MKTAG('u', 'n', 'd', 'f'):
-			pHotSpotTable.hotSpots[i].type = HotSpotType::undefined;
-			break;
-
-		default:
-			pHotSpotTable.hotSpots[i].type = HotSpotType::undefined;
-			warning("QuickTimeParser::readPHOT(): Unknown HotSpot Type ('%s')", tag2str(type));
-			break;
-		}
-
+		pHotSpotTable.hotSpots[i].type = _fd->readUint32BE();
 		pHotSpotTable.hotSpots[i].typeData = _fd->readUint32BE();
 
 		pHotSpotTable.hotSpots[i].viewHPan = readAppleFloatField(_fd);
diff --git a/common/formats/quicktime.h b/common/formats/quicktime.h
index c86430a25f6..9d517c316be 100644
--- a/common/formats/quicktime.h
+++ b/common/formats/quicktime.h
@@ -197,19 +197,9 @@ public:
 		int32 commentStrOffset;
 	};
 
-	enum class HotSpotType {
-		undefined = MKTAG('u','n','d','f'),
-		anim = MKTAG('a','n','i','m'),
-		cnod = MKTAG('c','n','o','d'),
-		link = MKTAG('l','i','n','k'),
-		navg = MKTAG('n','a','v','g'),
-		soun = MKTAG('s','o','u','n'),
-		cmov = MKTAG('c','m','o','v'),
-	};
-
 	struct PanoHotSpot {
 		uint16 id;
-		HotSpotType type;
+		uint32 type;
 		uint32 typeData; // for link and navg, the ID in the link and navg table
 
 		// Canonical view for this hotspot


Commit: c7a9f7afe587a809a5d9535c4c9e3f79175d9ba6
    https://github.com/scummvm/scummvm/commit/c7a9f7afe587a809a5d9535c4c9e3f79175d9ba6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-20T01:34:32+01:00

Commit Message:
VIDEO: QTVR: Remove redundant casts

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 479913650b7..b9a5783feae 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -986,7 +986,7 @@ const QuickTimeDecoder::PanoHotSpot *QuickTimeDecoder::getHotSpotByID(int id) {
 const QuickTimeDecoder::PanoNavigation *QuickTimeDecoder::getHotSpotNavByID(int id) {
 	const QuickTimeDecoder::PanoHotSpot *hotspot = getHotSpotByID(id);
 
-	if ((uint32)hotspot->type != MKTAG('n','a','v','g'))
+	if (hotspot->type != MKTAG('n','a','v','g'))
 		return nullptr;
 
 	return _panoTrack->panoSamples[_currentSample].navTable.get(hotspot->typeData);
@@ -1129,7 +1129,7 @@ void QuickTimeDecoder::handlePanoMouseButton(bool isDown, int16 x, int16 y, bool
 			_clickedHotspot = _rolloverHotspot;
 	}
 
-	if (!repeat && !isDown && _rolloverHotspot && (uint32)_rolloverHotspot->type == MKTAG('l','i','n','k') && _prevMouse == _mouseDrag) {
+	if (!repeat && !isDown && _rolloverHotspot && _rolloverHotspot->type == MKTAG('l','i','n','k') && _prevMouse == _mouseDrag) {
 		PanoLink *link = _panoTrack->panoSamples[_currentSample].linkTable.get(_rolloverHotspot->typeData);
 
 		if (link) {
@@ -1346,7 +1346,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 		uint32 hsType = MKTAG('u','n','d','f');
 
 		if (_rolloverHotspot)
-			hsType = (uint32)_rolloverHotspot->type;
+			hsType = _rolloverHotspot->type;
 
 		int hsOver, hsDown, hsUp;
 


Commit: 73e930587b267ff21f7d25d6389c215522289215
    https://github.com/scummvm/scummvm/commit/73e930587b267ff21f7d25d6389c215522289215
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-20T01:34:32+01:00

Commit Message:
VIDEO: QTVR: Fix cursor stoppers for tilt

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index b9a5783feae..de0abc5dfe8 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -1418,7 +1418,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// down stop
-				if (_tiltAngle >= desc->_vPanTop - _fov / 2)
+				if (_tiltAngle <= desc->_vPanBottom + _fov / 2)
 					res |= 1;
 				res <<= 1;
 			} else {
@@ -1431,7 +1431,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// up stop
-				if (_tiltAngle <= desc->_vPanBottom + _fov / 2)
+				if (_tiltAngle >= desc->_vPanTop - _fov / 2)
 					res |= 1;
 			} else {
 				res <<= 1;




More information about the Scummvm-git-logs mailing list