[Scummvm-git-logs] scummvm master -> 55c2973c1df5e8790b4248ae36a6b1b37842ce12

sev- noreply at scummvm.org
Sat May 3 11:17:21 UTC 2025


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

Summary:
f97a87cb61 Revert "VIDEO: QTVR: Use proper fov variables for navigation"
98fadaee5d Revert "VIDEO: QTVR: Rename _hfov to _vfov"
96b9c24784 VIDEO: QTVR: Added run-time debug output on pano navigation
55c2973c1d VIDEO: QTVR: Correctly compute hfov


Commit: f97a87cb61d3e724ed96210da28da9d425d8d939
    https://github.com/scummvm/scummvm/commit/f97a87cb61d3e724ed96210da28da9d425d8d939
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T13:01:09+02:00

Commit Message:
Revert "VIDEO: QTVR: Use proper fov variables for navigation"

This reverts commit 8d630e46281d8776101c0fa28899495f3568c801.

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index a9c2d87b6f7..194243f85ae 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -307,14 +307,11 @@ void QuickTimeDecoder::setPanAngle(float angle) {
 	PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
 
 	if (desc->_hPanStart != desc->_hPanEnd && (desc->_hPanStart != 0.0 || desc->_hPanEnd != 360.0)) {
-		if (angle < desc->_hPanStart + _fov / 2) {
-			angle = desc->_hPanStart + _fov / 2;
-		} else if (angle > desc->_hPanEnd - _fov / 2) {
-			angle = desc->_hPanEnd - _fov / 2;
+		if (angle < desc->_hPanStart + _vfov) {
+			angle = desc->_hPanStart + _vfov;
+		} else if (angle > desc->_hPanEnd - _vfov) {
+			angle = desc->_hPanEnd - _vfov;
 		}
-
-		if (angle > 360.0)
-			angle = 360.0;
 	}
 
 	if (_panAngle != angle) {
@@ -329,10 +326,10 @@ void QuickTimeDecoder::setPanAngle(float angle) {
 void QuickTimeDecoder::setTiltAngle(float angle) {
 	PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
 
-	if (angle < desc->_vPanBottom + _vfov / 2) {
-		angle = desc->_vPanBottom + _vfov / 2;
-	} else if (angle > desc->_vPanTop - _vfov / 2) {
-		angle = desc->_vPanTop - _vfov / 2;
+	if (angle < desc->_vPanBottom + _fov / 2) {
+		angle = desc->_vPanBottom + _fov / 2;
+	} else if (angle > desc->_vPanTop - _fov / 2) {
+		angle = desc->_vPanTop - _fov / 2;
 	}
 
 	if (_tiltAngle != angle) {
@@ -561,7 +558,7 @@ void QuickTimeDecoder::PanoTrackHandler::swingTransitionHandler() {
 
 	// Calculate the step
 	float stepFOV = (_decoder->_fov - _currentFOV) / NUM_STEPS;
-	float stepVFOV = (_decoder->_vfov - _currentVFOV) / NUM_STEPS;
+	float stepHFOV = (_decoder->_vfov - _currentVFOV) / NUM_STEPS;
 
 	float stepTiltAngle = (_decoder->_tiltAngle - _currentTiltAngle) / NUM_STEPS;
 
@@ -592,7 +589,7 @@ void QuickTimeDecoder::PanoTrackHandler::swingTransitionHandler() {
 	for (int i = 0; i < NUM_STEPS; i++) {
 		projectPanorama(1,
 						_currentFOV + i * stepFOV,
-						_currentVFOV + i * stepVFOV,
+						_currentVFOV + i * stepHFOV,
 						_currentTiltAngle + i * stepTiltAngle,
 						_currentPanAngle + i * stepPanAngle);
 
@@ -1913,7 +1910,6 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 			int res = 0;
 			PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
 			bool pano360 = !(desc->_hPanStart != desc->_hPanEnd && (desc->_hPanStart != 0.0 || desc->_hPanEnd != 360.0));
-			debugC(4, kDebugLevelGVideo, "pano360: %d _panAngle: %f [%f - %f] +%f  -%f fov: %f vfov: %f", pano360, _panAngle, desc->_hPanStart, desc->_hPanEnd, desc->_hPanStart + _fov, desc->_hPanEnd - _fov, _fov, _vfov);
 
 			// left
 			if (x < _mouseDrag.x - sensitivity) {
@@ -1921,7 +1917,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// left stop
-				if (!pano360 && _panAngle >= desc->_hPanEnd - _fov / 2)
+				if (!pano360 && _panAngle >= desc->_hPanEnd - _vfov)
 					res |= 1;
 				res <<= 1;
 			} else {
@@ -1934,7 +1930,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// right stop
-				if (!pano360 && _panAngle <= desc->_hPanStart + _fov / 2)
+				if (!pano360 && _panAngle <= desc->_hPanStart + _vfov)
 					res |= 1;
 				res <<= 1;
 			} else {
@@ -1947,7 +1943,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// down stop
-				if (_tiltAngle <= desc->_vPanBottom + _vfov / 2)
+				if (_tiltAngle <= desc->_vPanBottom + _fov / 2)
 					res |= 1;
 				res <<= 1;
 			} else {
@@ -1960,7 +1956,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// up stop
-				if (_tiltAngle >= desc->_vPanTop - _vfov / 2)
+				if (_tiltAngle >= desc->_vPanTop - _fov / 2)
 					res |= 1;
 			} else {
 				res <<= 1;


Commit: 98fadaee5d04dc8b9d5c91c9049ce581953da468
    https://github.com/scummvm/scummvm/commit/98fadaee5d04dc8b9d5c91c9049ce581953da468
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T13:01:26+02:00

Commit Message:
Revert "VIDEO: QTVR: Rename _hfov to _vfov"

This reverts commit ed333304523eba6e99eb3e9727281c17cba3fd4f.

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


diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 7400221b37e..8ff79a683c6 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -97,7 +97,7 @@ public:
 	float getTiltAngle() const { return _tiltAngle; }
 	void setTiltAngle(float tiltAngle);
 	float getFOV() const { return _fov; }
-	float getVFOV() const { return _vfov; }
+	float getHFOV() const { return _hfov; }
 	bool setFOV(float fov);
 	int getCurrentNodeID() { return _currentSample == -1 ? 0 : _panoTrack->panoSamples[_currentSample].hdr.nodeID; }
 	Common::String getCurrentNodeName();
@@ -235,7 +235,7 @@ private:
 	float _panAngle = 0.0f;
 	float _tiltAngle = 0.0f;
 	float _fov = 56.0f;
-	float _vfov = 56.0f;
+	float _hfov = 56.0f;
 	int _zoomState = kZoomNone;
 	bool _repeatTimerActive = false;
 
@@ -426,7 +426,7 @@ private:
 
 		// Current upscale level (0 or 1 or 2) of _upscaledConstructedPanorama compared to _constructedPano
 		// level 0 means that constructedPano was just contructed and hasn't been upscaled yet
-		// level 1 means only upscaled height (2x pixels)
+		// level 1 means only upscaled height (2x pixels) 
 		// level 2 means upscaled height and width (4x pixels)
 		uint8 _upscaleLevel = 0;
 
@@ -434,7 +434,7 @@ private:
 		// which requires storing the previous point during every change in FOV, Pan Angle and Tilt Angle
 		// If swing transition is called, this will be the start point of the transition
 		float _currentFOV = 0;
-		float _currentVFOV = 0;
+		float _currentHFOV = 0;
 		float _currentPanAngle = 0;
 		float _currentTiltAngle = 0;
 
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 194243f85ae..e66c91900b7 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -298,19 +298,19 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 		_width = w;
 		_height = h;
 	}
-	// Set up the _vfov properly for the very first frame of the pano
-	// After our setFOV will handle the _vfov
-	_vfov = _fov * (float)_width / (float)_height;
+	// Set up the _hfov properly for the very first frame of the pano
+	// After our setFOV will handle the _hfov
+	_hfov = _fov * (float)_width / (float)_height;
 }
 
 void QuickTimeDecoder::setPanAngle(float angle) {
 	PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
 
 	if (desc->_hPanStart != desc->_hPanEnd && (desc->_hPanStart != 0.0 || desc->_hPanEnd != 360.0)) {
-		if (angle < desc->_hPanStart + _vfov) {
-			angle = desc->_hPanStart + _vfov;
-		} else if (angle > desc->_hPanEnd - _vfov) {
-			angle = desc->_hPanEnd - _vfov;
+		if (angle < desc->_hPanStart + _hfov) {
+			angle = desc->_hPanStart + _hfov;
+		} else if (angle > desc->_hPanEnd - _hfov) {
+			angle = desc->_hPanEnd - _hfov;
 		}
 	}
 
@@ -359,8 +359,8 @@ bool QuickTimeDecoder::setFOV(float fov) {
 		track->_currentFOV = _fov;
 		_fov = fov;
 
-		track->_currentVFOV = _vfov;
-		_vfov = _fov * (float)_width / (float)_height;
+		track->_currentHFOV = _hfov;
+		_hfov = _fov * (float)_width / (float)_height;
 
 		// We need to recalculate the pan angle and tilt angle to see if it has went
 		// out of bound for the current value of FOV
@@ -558,7 +558,7 @@ void QuickTimeDecoder::PanoTrackHandler::swingTransitionHandler() {
 
 	// Calculate the step
 	float stepFOV = (_decoder->_fov - _currentFOV) / NUM_STEPS;
-	float stepHFOV = (_decoder->_vfov - _currentVFOV) / NUM_STEPS;
+	float stepHFOV = (_decoder->_hfov - _currentHFOV) / NUM_STEPS;
 
 	float stepTiltAngle = (_decoder->_tiltAngle - _currentTiltAngle) / NUM_STEPS;
 
@@ -589,7 +589,7 @@ void QuickTimeDecoder::PanoTrackHandler::swingTransitionHandler() {
 	for (int i = 0; i < NUM_STEPS; i++) {
 		projectPanorama(1,
 						_currentFOV + i * stepFOV,
-						_currentVFOV + i * stepHFOV,
+						_currentHFOV + i * stepHFOV,
 						_currentTiltAngle + i * stepTiltAngle,
 						_currentPanAngle + i * stepPanAngle);
 
@@ -636,13 +636,13 @@ void QuickTimeDecoder::PanoTrackHandler::swingTransitionHandler() {
 	// The second time there will be no transition
 	_currentFOV = _decoder->_fov;
 	_currentPanAngle = _decoder->_panAngle;
-	_currentVFOV = _decoder->_vfov;
+	_currentHFOV = _decoder->_hfov;
 	_currentTiltAngle = _decoder->_tiltAngle;
 
 	// Due to floating point errors, we may end a few degrees here and there
 	// Make sure we reach the destination at the end of this loop
 	// Also we have to go back to our original quality
-	projectPanorama(3, _decoder->_fov, _decoder->_vfov, _decoder->_tiltAngle, _decoder->_panAngle);
+	projectPanorama(3, _decoder->_fov, _decoder->_hfov, _decoder->_tiltAngle, _decoder->_panAngle);
 }
 
 const Graphics::Surface *QuickTimeDecoder::PanoTrackHandler::decodeNextFrame() {
@@ -652,7 +652,7 @@ const Graphics::Surface *QuickTimeDecoder::PanoTrackHandler::decodeNextFrame() {
 	if (_dirty && _decoder->_transitionMode == kTransitionModeNormal) {
 		float quality = _decoder->getQuality();
 		float fov = _decoder->_fov;
-		float hfov = _decoder->_vfov;
+		float hfov = _decoder->_hfov;
 		float tiltAngle = _decoder->_tiltAngle;
 		float panAngle = _decoder->_panAngle;
 
@@ -1005,7 +1005,7 @@ Common::Point QuickTimeDecoder::PanoTrackHandler::projectPoint(int16 mx, int16 m
 	mousePixelVector[2] = topRightVector[2] + yRatio * (bottomRightVector[2] - topRightVector[2]);
 
 	float t, xCoord = 0, yawRatio = 0;
-	float horizontalFovRadians = _decoder->_vfov * M_PI / 180.0f;
+	float horizontalFovRadians = _decoder->_hfov * M_PI / 180.0f;
 	float verticalFovRadians = _decoder->_fov * M_PI / 180.0f;
 	float tiltAngleRadians = -_decoder->_tiltAngle * M_PI / 180.0f;
 
@@ -1917,7 +1917,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// left stop
-				if (!pano360 && _panAngle >= desc->_hPanEnd - _vfov)
+				if (!pano360 && _panAngle >= desc->_hPanEnd - _hfov)
 					res |= 1;
 				res <<= 1;
 			} else {
@@ -1930,7 +1930,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// right stop
-				if (!pano360 && _panAngle <= desc->_hPanStart + _vfov)
+				if (!pano360 && _panAngle <= desc->_hPanStart + _hfov)
 					res |= 1;
 				res <<= 1;
 			} else {


Commit: 96b9c247845506548bbe88f6f103c239d7c4c2b8
    https://github.com/scummvm/scummvm/commit/96b9c247845506548bbe88f6f103c239d7c4c2b8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T13:11:21+02:00

Commit Message:
VIDEO: QTVR: Added run-time debug output on pano navigation

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index e66c91900b7..16ed3c86f0e 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -1910,6 +1910,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 			int res = 0;
 			PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
 			bool pano360 = !(desc->_hPanStart != desc->_hPanEnd && (desc->_hPanStart != 0.0 || desc->_hPanEnd != 360.0));
+			debugC(4, kDebugLevelGVideo, "pano360: %d _panAngle: %f [%f - %f] +%f  -%f fov: %f hfov: %f", pano360, _panAngle, desc->_hPanStart, desc->_hPanEnd, desc->_hPanStart + _fov, desc->_hPanEnd - _fov, _fov, _hfov);
 
 			// left
 			if (x < _mouseDrag.x - sensitivity) {


Commit: 55c2973c1df5e8790b4248ae36a6b1b37842ce12
    https://github.com/scummvm/scummvm/commit/55c2973c1df5e8790b4248ae36a6b1b37842ce12
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T13:16:46+02:00

Commit Message:
VIDEO: QTVR: Correctly compute hfov

This was the real culprit and not the swapped hfov/vfov variables

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 16ed3c86f0e..c7f67e09310 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -300,7 +300,7 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 	}
 	// Set up the _hfov properly for the very first frame of the pano
 	// After our setFOV will handle the _hfov
-	_hfov = _fov * (float)_width / (float)_height;
+	_hfov = _fov * (float)_height / (float)_width;
 }
 
 void QuickTimeDecoder::setPanAngle(float angle) {
@@ -360,7 +360,7 @@ bool QuickTimeDecoder::setFOV(float fov) {
 		_fov = fov;
 
 		track->_currentHFOV = _hfov;
-		_hfov = _fov * (float)_width / (float)_height;
+		_hfov = _fov * (float)_height / (float)_width;
 
 		// We need to recalculate the pan angle and tilt angle to see if it has went
 		// out of bound for the current value of FOV




More information about the Scummvm-git-logs mailing list