aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/frameout.h
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/graphics/frameout.h
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/graphics/frameout.h')
-rw-r--r--engines/sci/graphics/frameout.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 2931fc090b..f864abc5bc 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -502,8 +502,17 @@ public:
return 1;
};
- uint16 kernelIsOnMe(int16 x, int16 y, uint16 checkPixels, reg_t screenObject);
- uint16 isOnMe(Plane *screenItemPlane, ScreenItem *screenItem, int16 x, int16 y, uint16 checkPixels);
+#pragma mark -
+#pragma mark Mouse cursor
+private:
+ /**
+ * Determines whether or not the point given by
+ * `position` is inside of the given screen item.
+ */
+ bool isOnMe(const ScreenItem &screenItem, const Plane &plane, const Common::Point &position, const bool checkPixel) const;
+
+public:
+ reg_t kernelIsOnMe(const reg_t object, const Common::Point &position, const bool checkPixel) const;
#pragma mark -
#pragma mark Debugging