aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-09-11 08:43:32 +0000
committerMax Horn2009-09-11 08:43:32 +0000
commit7cf23a2c4d20fe23133974e5a0595edd44fd49b4 (patch)
treed2ffe2341e2920b54994fbc5253fe295e24016bb
parentc6d2441db30e4f55714ffd2eaae48668766e4cbd (diff)
downloadscummvm-rg350-7cf23a2c4d20fe23133974e5a0595edd44fd49b4.tar.gz
scummvm-rg350-7cf23a2c4d20fe23133974e5a0595edd44fd49b4.tar.bz2
scummvm-rg350-7cf23a2c4d20fe23133974e5a0595edd44fd49b4.zip
M4: Seems that s1_cos and s1_sin are either misnamed, or buggy ?
svn-id: r44026
-rw-r--r--engines/m4/ws_sequence.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/m4/ws_sequence.cpp b/engines/m4/ws_sequence.cpp
index e980d91675..4c806c9806 100644
--- a/engines/m4/ws_sequence.cpp
+++ b/engines/m4/ws_sequence.cpp
@@ -27,7 +27,7 @@
namespace M4 {
-long sinCosTable[320] = {
+static const long sinCosTable[320] = {
0, 1608, 3215, 4821, 6423, 8022, 9616, 11204,
12785, 14359, 15923, 17479, 19024, 20557, 22078, 23586,
25079, 26557, 28020, 29465, 30893, 32302, 33692, 35061,
@@ -408,6 +408,9 @@ bool Sequence::s1_sin(Instruction &instruction) {
else
tempAngle &= 0xff;
+ // FIXME: Why use the cosTable in s1_sin() ?
+ // Note that sin(0) 0 and sinTable[0] = 0 but cos(0)=1, and indeed
+ // cosTable[0] = 65536, which is 1 considered as a fixed point.
*instruction.argp[0] = -cosTable[tempAngle];
return true;
@@ -422,6 +425,9 @@ bool Sequence::s1_cos(Instruction &instruction) {
else
tempAngle &= 0xff;
+ // FIXME: Why use the sinTable in s1_cos() ?
+ // Note that sin(0) 0 and sinTable[0] = 0 but cos(0)=1, and indeed
+ // cosTable[0] = 65536, which is 1 considered as a fixed point.
*instruction.argp[0] = sinTable[tempAngle];
return true;