aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorkyranet2019-04-09 19:53:39 +0200
committerFilippos Karapetis2019-07-14 13:57:18 +0300
commit212cd5aa7864db1d805b4ef9b1736578a3e25b37 (patch)
tree0691ec229b52d7d21a56e18f4491ad464281ed25 /engines/wintermute
parent290962ba92d2b457a9e6977ee4370eba27d644ab (diff)
downloadscummvm-rg350-212cd5aa7864db1d805b4ef9b1736578a3e25b37.tar.gz
scummvm-rg350-212cd5aa7864db1d805b4ef9b1736578a3e25b37.tar.bz2
scummvm-rg350-212cd5aa7864db1d805b4ef9b1736578a3e25b37.zip
WINTERMUTE: Fixed normalizeAngle's output range from 0-360 to 0-359
WINTERMUTE: Enhanced BaseUtils::normalizeAngle to run the while if angle is greater than 359. When normalizing an angle, we expect the number to be between 0 and 359 (since 360 is 0), this changes the util so 360 is transformed to 0. The case for 359.8 (which this would make it -0.2) is covered by the following while loop, which will increase it back to 359.8.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/utils/utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp
index dc6476d4ea..5afb940cfc 100644
--- a/engines/wintermute/utils/utils.cpp
+++ b/engines/wintermute/utils/utils.cpp
@@ -44,7 +44,7 @@ void BaseUtils::swap(int *a, int *b) {
//////////////////////////////////////////////////////////////////////////
float BaseUtils::normalizeAngle(float angle) {
- while (angle > 360) {
+ while (angle > 359) {
angle -= 360;
}
while (angle < 0) {