diff options
author | richiesams | 2013-08-28 09:12:14 -0500 |
---|---|---|
committer | richiesams | 2013-08-28 16:44:27 -0500 |
commit | ab18d20ead93b5e1f65f474fe73212724394c1fc (patch) | |
tree | 16e3cc8460bbf86535924537af87496d12da0db4 | |
parent | 3a9b3841149d22d9a8221a8ae32d2b0feca0b14f (diff) | |
download | scummvm-rg350-ab18d20ead93b5e1f65f474fe73212724394c1fc.tar.gz scummvm-rg350-ab18d20ead93b5e1f65f474fe73212724394c1fc.tar.bz2 scummvm-rg350-ab18d20ead93b5e1f65f474fe73212724394c1fc.zip |
ZVISION: Fix the quadrant numbers in angle calculations
Because y increases as you go down, not up
-rw-r--r-- | engines/zvision/lever_control.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/zvision/lever_control.cpp b/engines/zvision/lever_control.cpp index 71b284c459..3c5b6370bb 100644 --- a/engines/zvision/lever_control.cpp +++ b/engines/zvision/lever_control.cpp @@ -233,7 +233,7 @@ int LeverControl::calculateVectorAngle(const Common::Point &pointOne, const Comm if (pointOne.x == pointTwo.x && pointOne.y == pointTwo.y) return -1; // This should never happen else if (pointOne.x == pointTwo.x) { - if (pointTwo.y > pointOne.y) + if (pointTwo.y < pointOne.y) return 90; else return 270; @@ -279,15 +279,15 @@ int LeverControl::calculateVectorAngle(const Common::Point &pointOne, const Comm // \ | / // \ | / // \ | / - // Quadrant 3 \ | / Quadrant 2 + // Quadrant 1 \ | / Quadrant 0 // \ | / // \ | / - // -angle ( \|/ ) angle + // angle ( \|/ ) -angle // 180 <----------------------------------------> 0 - // angle ( /|\ ) -angle + // -angle ( /|\ ) angle // / | \ // / | \ - // Quadrant 1 / | \ Quadrant 0 + // Quadrant 3 / | \ Quadrant 2 // / | \ // / | \ // / | \ @@ -298,16 +298,16 @@ int LeverControl::calculateVectorAngle(const Common::Point &pointOne, const Comm // Convert the local angles to unit circle angles switch (quadrant) { case 0: - angle = 360 + angle; + angle = 180 + angle; break; case 1: - angle = 180 + angle; + // Do nothing break; case 2: angle = 180 + angle; break; case 3: - // Do nothing + angle = 360 + angle; break; } |