diff options
author | Filippos Karapetis | 2009-09-24 09:41:11 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-09-24 09:41:11 +0000 |
commit | fbe1586abc2435bedd867baede387ba119f4c632 (patch) | |
tree | e16b23d9d5b629f2cabcc323e2b7a11111156d62 /engines/sci/engine | |
parent | db63b401a6978d7faf1c0f3f10f7c66026a78b05 (diff) | |
download | scummvm-rg350-fbe1586abc2435bedd867baede387ba119f4c632.tar.gz scummvm-rg350-fbe1586abc2435bedd867baede387ba119f4c632.tar.bz2 scummvm-rg350-fbe1586abc2435bedd867baede387ba119f4c632.zip |
The maximum value that a signed 16-bit integer can hold is 32767, not 32768 (0x8000)
svn-id: r44294
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kmath.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index 0382a540ee..cca9e3a6b4 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -130,7 +130,7 @@ reg_t kCosDiv(EngineState *s, int, int argc, reg_t *argv) { 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 @@ reg_t kSinDiv(EngineState *s, int, int argc, reg_t *argv) { 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 @@ reg_t kTimesTan(EngineState *s, int, int argc, reg_t *argv) { 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 @@ reg_t kTimesCot(EngineState *s, int, int argc, reg_t *argv) { 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)); } |