[Scummvm-cvs-logs] SF.net SVN: scummvm:[44294] scummvm/trunk/engines/sci/engine/kmath.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Sep 24 11:41:11 CEST 2009
Revision: 44294
http://scummvm.svn.sourceforge.net/scummvm/?rev=44294&view=rev
Author: thebluegr
Date: 2009-09-24 09:41:11 +0000 (Thu, 24 Sep 2009)
Log Message:
-----------
The maximum value that a signed 16-bit integer can hold is 32767, not 32768 (0x8000)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kmath.cpp
Modified: scummvm/trunk/engines/sci/engine/kmath.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmath.cpp 2009-09-24 09:40:12 UTC (rev 44293)
+++ scummvm/trunk/engines/sci/engine/kmath.cpp 2009-09-24 09:41:11 UTC (rev 44294)
@@ -130,7 +130,7 @@
if ((cosval < 0.0001) && (cosval > 0.0001)) {
warning("Attepted division by zero");
- return make_reg(0, (int16)0x8000);
+ return make_reg(0, 0);
} else
return make_reg(0, (int16)(value / cosval));
}
@@ -142,7 +142,7 @@
if ((sinval < 0.0001) && (sinval > 0.0001)) {
warning("Attepted division by zero");
- return make_reg(0, (int16)0x8000);
+ return make_reg(0, 0);
} else
return make_reg(0, (int16)(value / sinval));
}
@@ -154,7 +154,7 @@
param -= 90;
if ((param % 90) == 0) {
warning("Attempted tan(pi/2)");
- return make_reg(0, (int16)0x8000);
+ return make_reg(0, 0);
} else
return make_reg(0, (int16) - (tan(param * PI / 180.0) * scale));
}
@@ -165,7 +165,7 @@
if ((param % 90) == 0) {
warning("Attempted tan(pi/2)");
- return make_reg(0, (int16)0x8000);
+ return make_reg(0, 0);
} else
return make_reg(0, (int16)(tan(param * PI / 180.0) * scale));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list