diff options
author | Eugene Sandulenko | 2014-04-16 20:17:02 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-16 20:17:02 +0300 |
commit | ac2c5ff084a6d2f74473e144662facc7a9a3006a (patch) | |
tree | 5748d41a14eeaac438eb620798e60a4c73a80d1e /engines/fullpipe | |
parent | 4411c816f6a2cabf271ea9363768490806872f88 (diff) | |
download | scummvm-rg350-ac2c5ff084a6d2f74473e144662facc7a9a3006a.tar.gz scummvm-rg350-ac2c5ff084a6d2f74473e144662facc7a9a3006a.tar.bz2 scummvm-rg350-ac2c5ff084a6d2f74473e144662facc7a9a3006a.zip |
FULLPIPE: Implement ModalMainMenu::isOverArea()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/modal.cpp | 16 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index ba42096e5a..b2f5bde393 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1037,6 +1037,22 @@ int ModalMainMenu::checkHover(Common::Point &point) { return 0; } +bool ModalMainMenu::isOverArea(PictureObject *obj, Common::Point *point) { + Common::Point p; + + obj->getDimensions(&p); + + int left = point->x - 8; + int right = point->x + 12; + int down = point->y - 11; + int up = point->y + 9; + + if (left >= obj->_ox && right < obj->_ox + p.x && down >= obj->_oy && up < obj->_oy + p.y) + return true; + + return false; +} + bool ModalMainMenu::isSaveAllowed() { warning("STUB: ModalMainMenu::isSaveAllowed()"); diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index c891ed46bf..78ddf71f54 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -186,6 +186,7 @@ private: int checkHover(Common::Point &point); void updateVolume(); void updateSliderPos(); + bool isOverArea(PictureObject *obj, Common::Point *point); }; class ModalHelp : public BaseModalObject { |