[Scummvm-cvs-logs] scummvm master -> 27d29090d8ea626226af92e5a626b3d261ce5d59
sev-
sev at scummvm.org
Sun Jul 24 23:00:17 CEST 2016
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:
27d29090d8 FULLPIPE: Clarified MovGraph::calcDistance() implementation
Commit: 27d29090d8ea626226af92e5a626b3d261ce5d59
https://github.com/scummvm/scummvm/commit/27d29090d8ea626226af92e5a626b3d261ce5d59
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-07-24T23:59:59+03:00
Commit Message:
FULLPIPE: Clarified MovGraph::calcDistance() implementation
Changed paths:
engines/fullpipe/motion.cpp
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index baea2e2..47cf524 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1289,11 +1289,11 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int fuzz
int n2x = link->_graphDst->_x;
int n2y = link->_graphDst->_y;
double dist1x = (double)(point->x - n1x);
- double dist1y = (double)(n1y - point->y);
+ double dist1y = (double)(point->y - n1y);
double dist2x = (double)(n2x - n1x);
double dist2y = (double)(n2y - n1y);
- double dist1 = sqrt(dist1y * dist1y + dist1x * dist1x);
- double dist2 = ((double)(n1y - n2y) * dist1y + dist2x * dist1x) / link->_length / dist1;
+ double dist1 = sqrt(dist1x * dist1x + dist1y * dist1y);
+ double dist2 = (dist2y * dist1y + dist2x * dist1x) / link->_length / dist1;
double distm = dist2 * dist1;
double res = sqrt(1.0 - dist2 * dist2) * dist1;
More information about the Scummvm-git-logs
mailing list