[Scummvm-git-logs] scummvm master -> eb88aad4d7381de4ca61cec3dccee85dc085a462

sev- noreply at scummvm.org
Fri Feb 7 12:35:05 UTC 2025


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

Summary:
eb88aad4d7 VIDEO: QTVR: Implement panorama zoom in/zoom out


Commit: eb88aad4d7381de4ca61cec3dccee85dc085a462
    https://github.com/scummvm/scummvm/commit/eb88aad4d7381de4ca61cec3dccee85dc085a462
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-07T13:34:30+01:00

Commit Message:
VIDEO: QTVR: Implement panorama zoom in/zoom out

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


diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 8f17aa8c24b..6c1fbe2d9f2 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -348,6 +348,8 @@ private:
 		float getTiltAngle() { return _curTiltAngle; }
 		void setTiltAngle(float angle);
 
+		void setDirty() { _dirty = true; }
+
 	private:
 		QuickTimeDecoder *_decoder;
 		Common::QuickTimeParser::Track *_parent;
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index d6b9c5d80f5..4c37a0a0816 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -115,6 +115,12 @@ Common::QuickTimeParser::SampleDesc *QuickTimeDecoder::readPanoSampleDesc(Common
 	entry->_hotSpotNumFramesY = _fd->readSint16BE(); // dices frame high
 	entry->_hotSpotColorDepth = _fd->readSint16BE(); // must be 8
 
+	if (entry->_minimumZoom == 0.0)
+		entry->_minimumZoom = 5.0;
+
+	if (entry->_maximumZoom == 0.0)
+		entry->_maximumZoom = 65.0;
+
 	return entry;
 }
 
@@ -142,9 +148,22 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
 }
 
 void QuickTimeDecoder::setFOV(float fov) {
-	_fov = fov;
+	PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
+
+	if (fov < desc->_minimumZoom)
+		fov = desc->_minimumZoom;
+
+	if (fov > desc->_maximumZoom)
+		fov = desc->_maximumZoom;
+
+	if (_fov != fov) {
+		_fov = fov;
 
-	_hfov = _fov * (float)_width / (float)_height;
+		_hfov = _fov * (float)_width / (float)_height;
+
+		PanoTrackHandler *track = (PanoTrackHandler *)_nextVideoTrack;
+		track->setDirty();
+	}
 }
 
 void QuickTimeDecoder::updateAngles() {
@@ -666,7 +685,7 @@ void QuickTimeDecoder::handlePanoMouseMove(int16 x, int16 y) {
 	_prevMouseY = y;
 }
 
-#define REPEAT_DELAY 100000
+#define REPEAT_DELAY 30000
 
 static void repeatCallback(void *data) {
 	QuickTimeDecoder *decoder = (QuickTimeDecoder *)data;
@@ -781,8 +800,12 @@ void QuickTimeDecoder::handlePanoKey(Common::KeyState &state, bool down, bool re
 		_zoomState = kZoomQuestion;
 	} else if (state.flags & Common::KBD_SHIFT) {
 		_zoomState = kZoomIn;
+
+		setFOV(getFOV() - 2.0);
 	} else if (state.flags & Common::KBD_CTRL) {
 		_zoomState = kZoomOut;
+
+		setFOV(getFOV() + 2.0);
 	} else {
 		_zoomState = kZoomNone;
 	}




More information about the Scummvm-git-logs mailing list