From 7edb9af72cd468d71d2cb33e8cf71aa38286e29c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 17 Apr 2014 22:50:28 +0300 Subject: FULLPIPE: Implement ModalMainMenu::checkHover() --- engines/fullpipe/modal.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'engines/fullpipe/modal.cpp') diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index b2f5bde393..50ef3ecb48 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1032,9 +1032,29 @@ void ModalMainMenu::updateSliderPos() { } int ModalMainMenu::checkHover(Common::Point &point) { - warning("STUB: ModalMainMenu::checkHover()"); + for (uint i = 0; i < _areas.size(); i++) { + if (_areas[i]->picObjL->isPixelHitAtPos(point.x, point.y)) { + _areas[i]->picObjL->_flags |= 4; - return 0; + return i; + } else { + _areas[i]->picObjL->_flags &= 0xFFFB; + } + } + + if (isOverArea(_areas[_menuSliderIdx]->picObjL, &point)) { + _areas[_menuSliderIdx]->picObjL->_flags |= 4; + + return _menuSliderIdx; + } + + if (isOverArea(_areas[_musicSliderIdx]->picObjL, &point)) { + _areas[_musicSliderIdx]->picObjL->_flags |= 4; + + return _musicSliderIdx; + } + + return -1; } bool ModalMainMenu::isOverArea(PictureObject *obj, Common::Point *point) { -- cgit v1.2.3