aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorColin Snover2016-03-08 10:27:15 -0600
committerColin Snover2016-03-08 10:29:05 -0600
commita2e9cc4965340add73db19c3d602ef5a910fe336 (patch)
treedbbefd6633a3994828819ad6998f9cc79635e8e3 /engines/sci/engine
parentea3f2ba60eae1eaeebec86662e6ccaee51a60657 (diff)
downloadscummvm-rg350-a2e9cc4965340add73db19c3d602ef5a910fe336.tar.gz
scummvm-rg350-a2e9cc4965340add73db19c3d602ef5a910fe336.tar.bz2
scummvm-rg350-a2e9cc4965340add73db19c3d602ef5a910fe336.zip
SCI32: Clean up kIsOnMe and fix rounding bug
The implementation was not correctly rounding the scaled position with mulru, leading to occasionally incorrect hit detection at the boundaries of boxes.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics32.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 2a9005dab4..3a59ea5037 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -152,12 +152,12 @@ reg_t kObjectIntersect(EngineState *s, int argc, reg_t *argv) {
// Tests if the coordinate is on the passed object
reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) {
- uint16 x = argv[0].toUint16();
- uint16 y = argv[1].toUint16();
- reg_t targetObject = argv[2];
- uint16 checkPixels = argv[3].getOffset();
+ int16 x = argv[0].toSint16();
+ int16 y = argv[1].toSint16();
+ reg_t object = argv[2];
+ bool checkPixel = argv[3].toSint16();
- return make_reg(0, g_sci->_gfxFrameout->kernelIsOnMe(x, y, checkPixels, targetObject));
+ return g_sci->_gfxFrameout->kernelIsOnMe(object, Common::Point(x, y), checkPixel);
}
reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {