aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/image.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-06-25 20:45:53 +0200
committerBorja Lorente2016-08-14 18:39:27 +0200
commit4837b7750a5494f7002f8f7c5d47ba44621dd425 (patch)
tree6bede815159a671a94d9a71dea9e30c78152e3dd /engines/macventure/image.cpp
parent25f086e63b2b007ba03a47dcdab2426369edf01f (diff)
downloadscummvm-rg350-4837b7750a5494f7002f8f7c5d47ba44621dd425.tar.gz
scummvm-rg350-4837b7750a5494f7002f8f7c5d47ba44621dd425.tar.bz2
scummvm-rg350-4837b7750a5494f7002f8f7c5d47ba44621dd425.zip
MACVENTURE: Add rect collission for main game window
Diffstat (limited to 'engines/macventure/image.cpp')
-rw-r--r--engines/macventure/image.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/macventure/image.cpp b/engines/macventure/image.cpp
index 323b8a1089..1a50a4ffbc 100644
--- a/engines/macventure/image.cpp
+++ b/engines/macventure/image.cpp
@@ -350,6 +350,18 @@ bool ImageAsset::isPointInside(Common::Point point) {
return pix != 0;
}
+bool ImageAsset::isRectInside(Common::Rect rect) {
+ for (uint y = rect.top; y < rect.top + rect.height(); y++) {
+ uint bmpofs = y * _rowBytes;
+ byte pix;
+ for (uint x = rect.left; x < rect.left + rect.width(); x++) {
+ pix = _maskData[bmpofs + (x >> 3)] & (1 << (7 - (x & 7)));
+ if (pix) return true;
+ }
+ }
+ return false;
+}
+
uint ImageAsset::getWidth() {
return _bitWidth;
}