[Scummvm-git-logs] scummvm master -> 8d630e46281d8776101c0fa28899495f3568c801

sev- noreply at scummvm.org
Sat May 3 10:40:42 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:
16482ce76b COMMON: QT: Improved debug output for QTVR string tables
96525a0804 VIDEO: QTVR: Fixed navigation in non-360 panoramas
ed33330452 VIDEO: QTVR: Rename _hfov to _vfov
8d630e4628 VIDEO: QTVR: Use proper fov variables for navigation


Commit: 16482ce76b2a8968c65e5e1b54caa9f3c8b16ab7
    https://github.com/scummvm/scummvm/commit/16482ce76b2a8968c65e5e1b54caa9f3c8b16ab7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T12:40:31+02:00

Commit Message:
COMMON: QT: Improved debug output for QTVR string tables

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


diff --git a/common/formats/quicktime.cpp b/common/formats/quicktime.cpp
index aeff39b71e0..d9493b5e09d 100644
--- a/common/formats/quicktime.cpp
+++ b/common/formats/quicktime.cpp
@@ -1146,7 +1146,7 @@ int QuickTimeParser::readSTRT(Atom atom) {
 
 	pStrTable.strings = _fd->readString(0, atom.size);
 
-	debugC(2, kDebugLevelGVideo, "  %s", pStrTable.strings.c_str());
+	pStrTable.debugPrint(2, kDebugLevelGVideo, "  ");
 
 	return 0;
 }
@@ -1344,6 +1344,14 @@ String QuickTimeParser::PanoStringTable::getString(int32 offset) const {
 	return strings.substr(str_start, str_length);
 }
 
+void QuickTimeParser::PanoStringTable::debugPrint(int level, uint32 debugChannel, String prefix) const {
+	int i = 0;
+	for (uint off = 8; off < strings.size() + 8; i++) {
+		debugC(level, debugChannel, "%s[%d]: \"%s\"", prefix.c_str(), i, getString(off).c_str());
+		off += strings[off - 8] + 1;
+	}
+}
+
 QuickTimeParser::Track::~Track() {
 	delete[] chunkOffsets;
 	delete[] timeToSample;
diff --git a/common/formats/quicktime.h b/common/formats/quicktime.h
index 4d2c090f858..f5daa2ae27a 100644
--- a/common/formats/quicktime.h
+++ b/common/formats/quicktime.h
@@ -234,6 +234,7 @@ public:
 		String strings;
 
 		String getString(int32 offset) const;
+		void debugPrint(int level, uint32 debugChannel, String prefix) const;
 	};
 
 	struct PanoLink {


Commit: 96525a08048f37bddfcfafdd34ec7b9085a9163f
    https://github.com/scummvm/scummvm/commit/96525a08048f37bddfcfafdd34ec7b9085a9163f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T12:40:31+02:00

Commit Message:
VIDEO: QTVR: Fixed navigation in non-360 panoramas

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 79090f4d97d..e66c91900b7 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -306,11 +306,11 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 void QuickTimeDecoder::setPanAngle(float angle) {
 	PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
 
-	if (desc->_hPanStart != desc->_hPanStart && (desc->_hPanStart != 0.0 || desc->_hPanStart != 360.0)) {
-		if (angle < desc->_hPanStart) {
-			angle = desc->_hPanStart + _hfov / 2;
-		} else if (angle > desc->_hPanEnd - _hfov / 2) {
-			angle = desc->_hPanStart - _hfov / 2;
+	if (desc->_hPanStart != desc->_hPanEnd && (desc->_hPanStart != 0.0 || desc->_hPanEnd != 360.0)) {
+		if (angle < desc->_hPanStart + _hfov) {
+			angle = desc->_hPanStart + _hfov;
+		} else if (angle > desc->_hPanEnd - _hfov) {
+			angle = desc->_hPanEnd - _hfov;
 		}
 	}
 
@@ -1909,7 +1909,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 		} else {
 			int res = 0;
 			PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
-			bool pano360 = !(desc->_hPanStart != desc->_hPanStart && (desc->_hPanStart != 0.0 || desc->_hPanStart != 360.0));
+			bool pano360 = !(desc->_hPanStart != desc->_hPanEnd && (desc->_hPanStart != 0.0 || desc->_hPanEnd != 360.0));
 
 			// left
 			if (x < _mouseDrag.x - sensitivity) {
@@ -1917,7 +1917,7 @@ void QuickTimeDecoder::updateQTVRCursor(int16 x, int16 y) {
 				res <<= 1;
 
 				// left stop
-				if (!pano360 && _panAngle <= desc->_hPanStart + _hfov / 2)
+				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->_hPanEnd - _hfov / 2)
+				if (!pano360 && _panAngle <= desc->_hPanStart + _hfov)
 					res |= 1;
 				res <<= 1;
 			} else {


Commit: ed333304523eba6e99eb3e9727281c17cba3fd4f
    https://github.com/scummvm/scummvm/commit/ed333304523eba6e99eb3e9727281c17cba3fd4f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T12:40:31+02:00

Commit Message:
VIDEO: QTVR: Rename _hfov to _vfov

The primary is the hoizontal fov, at some point, the concepts
somehow got mixed

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


diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 8ff79a683c6..7400221b37e 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 getHFOV() const { return _hfov; }
+	float getVFOV() const { return _vfov; }
 	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 _hfov = 56.0f;
+	float _vfov = 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 _currentHFOV = 0;
+		float _currentVFOV = 0;
 		float _currentPanAngle = 0;
 		float _currentTiltAngle = 0;
 
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index e66c91900b7..194243f85ae 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 _hfov properly for the very first frame of the pano
-	// After our setFOV will handle the _hfov
-	_hfov = _fov * (float)_width / (float)_height;
+	// 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;
 }
 
 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 + _hfov) {
-			angle = desc->_hPanStart + _hfov;
-		} else if (angle > desc->_hPanEnd - _hfov) {
-			angle = desc->_hPanEnd - _hfov;
+		if (angle < desc->_hPanStart + _vfov) {
+			angle = desc->_hPanStart + _vfov;
+		} else if (angle > desc->_hPanEnd - _vfov) {
+			angle = desc->_hPanEnd - _vfov;
 		}
 	}
 
@@ -359,8 +359,8 @@ bool QuickTimeDecoder::setFOV(float fov) {
 		track->_currentFOV = _fov;
 		_fov = fov;
 
-		track->_currentHFOV = _hfov;
-		_hfov = _fov * (float)_width / (float)_height;
+		track->_currentVFOV = _vfov;
+		_vfov = _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->_hfov - _currentHFOV) / NUM_STEPS;
+	float stepHFOV = (_decoder->_vfov - _currentVFOV) / 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,
-						_currentHFOV + i * stepHFOV,
+						_currentVFOV + 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;
-	_currentHFOV = _decoder->_hfov;
+	_currentVFOV = _decoder->_vfov;
 	_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->_hfov, _decoder->_tiltAngle, _decoder->_panAngle);
+	projectPanorama(3, _decoder->_fov, _decoder->_vfov, _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->_hfov;
+		float hfov = _decoder->_vfov;
 		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->_hfov * M_PI / 180.0f;
+	float horizontalFovRadians = _decoder->_vfov * 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 - _hfov)
+				if (!pano360 && _panAngle >= desc->_hPanEnd - _vfov)
 					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 + _hfov)
+				if (!pano360 && _panAngle <= desc->_hPanStart + _vfov)
 					res |= 1;
 				res <<= 1;
 			} else {


Commit: 8d630e46281d8776101c0fa28899495f3568c801
    https://github.com/scummvm/scummvm/commit/8d630e46281d8776101c0fa28899495f3568c801
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-05-03T12:40:31+02:00

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

Changed paths:
    video/qtvr_decoder.cpp


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




More information about the Scummvm-git-logs mailing list