aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-28 18:19:47 -0400
committerPaul Gilbert2016-07-10 16:22:31 -0400
commite778ac8bcd6c2e0a026c813614c884e5044110c3 (patch)
tree63922a8db8294825c95e72467abe6cfd97a9dcb6
parent6f001d831623a46f643379554d20e94463d8c2f1 (diff)
downloadscummvm-rg350-e778ac8bcd6c2e0a026c813614c884e5044110c3.tar.gz
scummvm-rg350-e778ac8bcd6c2e0a026c813614c884e5044110c3.tar.bz2
scummvm-rg350-e778ac8bcd6c2e0a026c813614c884e5044110c3.zip
TITANIC: FIx confusion between mouse down & up messages in CPETElement hierarchy
-rw-r--r--engines/titanic/pet_control/pet_element.cpp4
-rw-r--r--engines/titanic/pet_control/pet_element.h8
-rw-r--r--engines/titanic/pet_control/pet_frame.cpp2
-rw-r--r--engines/titanic/pet_control/pet_load_save.cpp4
-rw-r--r--engines/titanic/pet_control/pet_quit.cpp4
5 files changed, 11 insertions, 11 deletions
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 3e9c991d1d..616877e15e 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -33,14 +33,14 @@ void CPetElement::getBounds(Rect *rect) {
*rect = Rect();
}
-bool CPetElement::highlightBounds(const Point &pt) {
+bool CPetElement::MouseButtonDownMsg(const Point &pt) {
bool result = _bounds.contains(pt);
if (result)
setMode(MODE_SELECTED);
return result;
}
-bool CPetElement::MouseButtonDownMsg(const Point &pt) {
+bool CPetElement::MouseButtonUpMsg(const Point &pt) {
bool result = _bounds.contains(pt);
if (result)
setMode(MODE_UNSELECTED);
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index effc575974..4e35ee9a24 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -70,14 +70,14 @@ public:
virtual void getBounds(Rect *rect);
/**
- * Highlights the element if the cursor is on it
+ * Handles processing mouse button down messages
*/
- virtual bool highlightBounds(const Point &pt);
+ virtual bool MouseButtonDownMsg(const Point &pt);
/**
- * Handles processing mouse button messages
+ * Handles processing mouse button up messages
*/
- virtual bool MouseButtonDownMsg(const Point &pt);
+ virtual bool MouseButtonUpMsg(const Point &pt);
/**
* Returns whether the passed point falls inside the item
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 827874fffc..ac4b3344c7 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -65,7 +65,7 @@ bool CPetFrame::reset() {
bool CPetFrame::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
for (int idx = 0; idx < 5; ++idx) {
- if (_modeButtons[idx].MouseButtonDownMsg(msg->_mousePos)) {
+ if (_modeButtons[idx].MouseButtonUpMsg(msg->_mousePos)) {
_petControl->setArea(PET_AREAS[idx]);
resetArea();
_modeButtons[idx].setMode(MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 811fd12089..b8cb3dae46 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -72,7 +72,7 @@ void CPetLoadSave::draw2(CScreenManager *screenManager) {
}
bool CPetLoadSave::checkHighlight(const Point &pt) {
- if (_btnLoadSave.highlightBounds(pt))
+ if (_btnLoadSave.MouseButtonDownMsg(pt))
return true;
checkSlotsHighlight(pt);
@@ -80,7 +80,7 @@ bool CPetLoadSave::checkHighlight(const Point &pt) {
}
bool CPetLoadSave::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (_btnLoadSave.MouseButtonDownMsg(msg->_mousePos)) {
+ if (_btnLoadSave.MouseButtonUpMsg(msg->_mousePos)) {
execute();
resetSlots();
return true;
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index b92a362dd3..dff3ea3ca8 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -68,12 +68,12 @@ void CPetQuit::draw2(CScreenManager *screenManager) {
}
bool CPetQuit::checkHighlight(const Point &pt) {
- return !_btnYes.highlightBounds(pt);
+ return !_btnYes.MouseButtonDownMsg(pt);
}
bool CPetQuit::MouseButtonUpMsg(const Point &pt) {
CPetControl *pet = getPetControl();
- if (_btnYes.MouseButtonDownMsg(pt) && pet) {
+ if (_btnYes.MouseButtonUpMsg(pt) && pet) {
CGameManager *gameManager = pet->getGameManager();
if (gameManager)
gameManager->_gameState._quitGame = true;