diff options
author | Filippos Karapetis | 2010-06-17 07:26:06 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-17 07:26:06 +0000 |
commit | 894ba682cdfb60a268dd4f4cb09d74d5cbb590b0 (patch) | |
tree | 1b4d9a3548b2bcb5a4e1d3228e6c1fc916f977a4 /engines/sci/engine/kmath.cpp | |
parent | f10b1a23f807d7889a2776ce80ea8b7a77160eb5 (diff) | |
download | scummvm-rg350-894ba682cdfb60a268dd4f4cb09d74d5cbb590b0.tar.gz scummvm-rg350-894ba682cdfb60a268dd4f4cb09d74d5cbb590b0.tar.bz2 scummvm-rg350-894ba682cdfb60a268dd4f4cb09d74d5cbb590b0.zip |
Moved kMulDiv together with the rest of the math functions, and kPlayVMD together with the rest of the video playing functions
svn-id: r49920
Diffstat (limited to 'engines/sci/engine/kmath.cpp')
-rw-r--r-- | engines/sci/engine/kmath.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index dbf317860f..6d4b9a2a04 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -153,4 +153,22 @@ reg_t kTimesCot(EngineState *s, int argc, reg_t *argv) { return make_reg(0, (int16)(tan(param * PI / 180.0) * scale)); } +#ifdef ENABLE_SCI32 + +reg_t kMulDiv(EngineState *s, int argc, reg_t *argv) { + int16 multiplicant = argv[0].toSint16(); + int16 multiplier = argv[1].toSint16(); + int16 denominator = argv[2].toSint16(); + + // Sanity check... + if (!denominator) { + warning("kMulDiv: attempt to divide by zero (%d * %d / %d", multiplicant, multiplier, denominator); + return NULL_REG; + } + + return make_reg(0, multiplicant * multiplier / denominator); +} + +#endif + } // End of namespace Sci |