[Scummvm-git-logs] scummvm master -> 1edd9dd0698a4d8ebc81525087f184c0947ba777

sev- noreply at scummvm.org
Sun Feb 9 23:39:24 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:
1edd9dd069 VIDEO: QTVR: Fix vector interpolation calculation in hotspot calculations


Commit: 1edd9dd0698a4d8ebc81525087f184c0947ba777
    https://github.com/scummvm/scummvm/commit/1edd9dd0698a4d8ebc81525087f184c0947ba777
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-10T00:38:36+01:00

Commit Message:
VIDEO: QTVR: Fix vector interpolation calculation in hotspot calculations

Changed paths:
    video/qtvr_decoder.cpp


diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 8a0031be6c3..7de54693f58 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -475,9 +475,10 @@ int QuickTimeDecoder::PanoTrackHandler::lookupHotspot(int16 mx, int16 my) {
 
 	// Compute the side edge vector by interpolating between topRightVector and
 	// bottomRightVector based on the mouse Y position
-	mousePixelVector[0] = topRightVector[0];
-	mousePixelVector[1] = topRightVector[1] + ((float)(my - h / 2) / (float)h * (topRightVector[1] - bottomRightVector[1]));
-	mousePixelVector[2] = topRightVector[2];
+	float yRatio = (float)(my - h / 2) / (float)h;
+	mousePixelVector[0] = topRightVector[0] + yRatio * (bottomRightVector[0] - topRightVector[0]);
+	mousePixelVector[1] = topRightVector[1] + yRatio * (bottomRightVector[1] - topRightVector[1]);
+	mousePixelVector[2] = topRightVector[2] + yRatio * (bottomRightVector[2] - topRightVector[2]);
 
 	// Multiply the X value ([0]) of the result of that on a value ranging from -1 to 1
 	// based on the mouse X position to get the mouse pixel vector




More information about the Scummvm-git-logs mailing list