[Scummvm-git-logs] scummvm master -> ffa0e306958c60972991e55ec72b0287dc040d2b
sev-
noreply at scummvm.org
Fri Feb 7 12:43:30 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:
ffa0e30695 VIDEO: QTVR: Reflect zoom limits on cursors for panoramas
Commit: ffa0e306958c60972991e55ec72b0287dc040d2b
https://github.com/scummvm/scummvm/commit/ffa0e306958c60972991e55ec72b0287dc040d2b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-07T13:43:05+01:00
Commit Message:
VIDEO: QTVR: Reflect zoom limits on cursors for panoramas
Changed paths:
video/qt_decoder.h
video/qtvr_decoder.cpp
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 6c1fbe2d9f2..82708fe3e07 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -87,7 +87,7 @@ public:
float getTiltAngle() const { return _tiltAngle; }
void setTiltAngle(float tiltAngle) { _tiltAngle = tiltAngle; }
float getFOV() const { return _fov; }
- void setFOV(float fov);
+ bool setFOV(float fov);
int getCurrentRow() { return _nextVideoTrack->getCurFrame() / _nav.columns; }
void setCurrentRow(int row);
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 4c37a0a0816..2f209d497b2 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -147,14 +147,19 @@ void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
}
}
-void QuickTimeDecoder::setFOV(float fov) {
+bool QuickTimeDecoder::setFOV(float fov) {
PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
+ bool success = true;
- if (fov < desc->_minimumZoom)
+ if (fov <= desc->_minimumZoom) {
fov = desc->_minimumZoom;
+ success = false;
+ }
- if (fov > desc->_maximumZoom)
+ if (fov >= desc->_maximumZoom) {
fov = desc->_maximumZoom;
+ success = false;
+ }
if (_fov != fov) {
_fov = fov;
@@ -164,6 +169,8 @@ void QuickTimeDecoder::setFOV(float fov) {
PanoTrackHandler *track = (PanoTrackHandler *)_nextVideoTrack;
track->setDirty();
}
+
+ return success;
}
void QuickTimeDecoder::updateAngles() {
@@ -801,11 +808,13 @@ void QuickTimeDecoder::handlePanoKey(Common::KeyState &state, bool down, bool re
} else if (state.flags & Common::KBD_SHIFT) {
_zoomState = kZoomIn;
- setFOV(getFOV() - 2.0);
+ if (!setFOV(getFOV() - 2.0))
+ _zoomState = kZoomLimit;
} else if (state.flags & Common::KBD_CTRL) {
_zoomState = kZoomOut;
- setFOV(getFOV() + 2.0);
+ if (!setFOV(getFOV() + 2.0))
+ _zoomState = kZoomLimit;
} else {
_zoomState = kZoomNone;
}
More information about the Scummvm-git-logs
mailing list