From b95695719f69658c7abe3e01d9c9a9c066b73864 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 22 Jan 2013 00:56:46 +0200 Subject: SCI: Fix angle rounding in the SCI1 implementation of kGetAngle (bug #3601479) Fixes bug #3601479 - "SCI KQ6: Castle walls - stuck in same room". Many thanks to wjp for his help on the kGetAngle implementation --- engines/sci/engine/kmath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index 4b8fadbb84..14a20b8da1 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -87,7 +87,7 @@ uint16 kGetAngleWorker(int16 x1, int16 y1, int16 x2, int16 y2) { // SCI1 games (QFG2 and newer) use a simple atan implementation. SCI0 games // use a somewhat less accurate calculation (below). if (getSciVersion() >= SCI_VERSION_1_EGA_ONLY) - return (int16)(360 - atan2((double)(x1 - x2), (double)(y1 - y2)) * 57.2958) % 360; + return (int16)(360 - atan2((double)(x1 - x2), (double)(y1 - y2)) * 180 / M_PI + 0.5) % 360; int16 xRel = x2 - x1; int16 yRel = y1 - y2; // y-axis is mirrored. -- cgit v1.2.3