aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-23 16:46:17 -0400
committerPaul Gilbert2016-07-10 16:11:49 -0400
commitd11a95068c2566564e0372bad0ad5c656af79298 (patch)
treeae81a7125701a851b2b7efc7a0aee10e1e3c611d
parent631d979fb3c213a2de8bf32a72236ab76e3ad1d8 (diff)
downloadscummvm-rg350-d11a95068c2566564e0372bad0ad5c656af79298.tar.gz
scummvm-rg350-d11a95068c2566564e0372bad0ad5c656af79298.tar.bz2
scummvm-rg350-d11a95068c2566564e0372bad0ad5c656af79298.zip
TITANIC: Standardizing PET mouse button methods, quit is now working
-rw-r--r--engines/titanic/pet_control/pet_element.cpp4
-rw-r--r--engines/titanic/pet_control/pet_element.h2
-rw-r--r--engines/titanic/pet_control/pet_frame.cpp2
-rw-r--r--engines/titanic/pet_control/pet_glyphs.cpp16
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h18
-rw-r--r--engines/titanic/pet_control/pet_load_save.cpp2
-rw-r--r--engines/titanic/pet_control/pet_quit.cpp4
-rw-r--r--engines/titanic/pet_control/pet_quit.h7
-rw-r--r--engines/titanic/pet_control/pet_real_life.cpp14
9 files changed, 36 insertions, 33 deletions
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index db6b122c94..3e9c991d1d 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -40,8 +40,8 @@ bool CPetElement::highlightBounds(const Point &pt) {
return result;
}
-bool CPetElement::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- bool result = _bounds.contains(msg->_mousePos);
+bool CPetElement::MouseButtonDownMsg(const Point &pt) {
+ bool result = _bounds.contains(pt);
if (result)
setMode(MODE_UNSELECTED);
return result;
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 17e5881a2b..effc575974 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -77,7 +77,7 @@ public:
/**
* Handles processing mouse button messages
*/
- virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ virtual bool MouseButtonDownMsg(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 a9f45fa746..827874fffc 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)) {
+ if (_modeButtons[idx].MouseButtonDownMsg(msg->_mousePos)) {
_petControl->setArea(PET_AREAS[idx]);
resetArea();
_modeButtons[idx].setMode(MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 632c8a38a1..20f864d456 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -291,7 +291,7 @@ void CPetGlyphs::makePetDirty() {
_owner->_petControl->makeDirty();
}
-bool CPetGlyphs::mouseButtonDown(const Point &pt) {
+bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
if (_scrollLeft.contains2(pt)) {
scrollLeft();
return true;
@@ -338,11 +338,11 @@ bool CPetGlyphs::mouseButtonDown(const Point &pt) {
return false;
}
-bool CPetGlyphs::mouseButtonUp(const Point &pt) {
+bool CPetGlyphs::MouseButtonUpMsg(const Point &pt) {
if (_highlightIndex >= 0) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
if (glyph) {
- if (glyph->MouseButtonMsg(pt))
+ if (glyph->MouseButtonUpMsg(pt))
return true;
}
}
@@ -350,7 +350,7 @@ bool CPetGlyphs::mouseButtonUp(const Point &pt) {
return false;
}
-bool CPetGlyphs::mouseDragStart(CMouseDragStartMsg *msg) {
+bool CPetGlyphs::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!(_field20 & 1) && _highlightIndex >= 0) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
int index = getHighlightedIndex(_highlightIndex);
@@ -365,7 +365,7 @@ bool CPetGlyphs::mouseDragStart(CMouseDragStartMsg *msg) {
return false;
}
-bool CPetGlyphs::mouseDragMove(CMouseDragMoveMsg *msg) {
+bool CPetGlyphs::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
if (_field94) {
error("TODO");
} else {
@@ -373,7 +373,7 @@ bool CPetGlyphs::mouseDragMove(CMouseDragMoveMsg *msg) {
}
}
-bool CPetGlyphs::mouseDragEnd(CMouseDragEndMsg *msg) {
+bool CPetGlyphs::MouseDragEndMsg(CMouseDragEndMsg *msg) {
if (_field94) {
error("TODO");
} else {
@@ -381,7 +381,7 @@ bool CPetGlyphs::mouseDragEnd(CMouseDragEndMsg *msg) {
}
}
-bool CPetGlyphs::keyCharMsg(int key) {
+bool CPetGlyphs::KeyCharMsg(int key) {
if (_highlightIndex >= 0) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
@@ -392,7 +392,7 @@ bool CPetGlyphs::keyCharMsg(int key) {
return false;
}
-bool CPetGlyphs::virtualKeyCharMsg(int key) {
+bool CPetGlyphs::VirtualKeyCharMsg(int key) {
bool handled = false;
warning("TODO: CPetGlyphs::virtualKeyCharMsg");
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 24d0a0840b..80c2153a1a 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -128,9 +128,9 @@ public:
virtual int proc19() { return 0; }
/**
- * Handles mouse button messages
+ * Handles mouse button up messages
*/
- virtual bool MouseButtonMsg(const Point &pt) { return false; }
+ virtual bool MouseButtonUpMsg(const Point &pt) { return false; }
virtual int proc21() { return 0; }
virtual int proc22() { return 0; }
@@ -312,37 +312,37 @@ public:
/**
* Mouse button down message
*/
- bool mouseButtonDown(const Point &pt);
+ bool MouseButtonDownMsg(const Point &pt);
/**
* Mouse button up message
*/
- bool mouseButtonUp(const Point &pt);
+ bool MouseButtonUpMsg(const Point &pt);
/**
* Mouse drag start messagge
*/
- bool mouseDragStart(CMouseDragStartMsg *msg);
+ bool MouseDragStartMsg(CMouseDragStartMsg *msg);
/**
* Mouse drag move message
*/
- bool mouseDragMove(CMouseDragMoveMsg *msg);
+ bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
/**
* Mouse drag end message
*/
- bool mouseDragEnd(CMouseDragEndMsg *msg);
+ bool MouseDragEndMsg(CMouseDragEndMsg *msg);
/**
* Key character message
*/
- bool keyCharMsg(int key);
+ bool KeyCharMsg(int key);
/**
* Virtual key message
*/
- bool virtualKeyCharMsg(int key);
+ bool VirtualKeyCharMsg(int key);
/**
* When the PET section is entered, passes onto the highlighted
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 4ebe9d03b0..f777f122fe 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -80,7 +80,7 @@ bool CPetLoadSave::checkHighlight(const Point &pt) {
}
bool CPetLoadSave::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (_btnLoadSave.MouseButtonDownMsg(msg)) {
+ if (_btnLoadSave.MouseButtonDownMsg(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 2f515a3235..e6c354a129 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -70,9 +70,9 @@ bool CPetQuit::checkHighlight(const Point &pt) {
return !_btnYes.highlightBounds(pt);
}
-bool CPetQuit::mouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+bool CPetQuit::MouseButtonUpMsg(const Point &pt) {
CPetControl *pet = getPetControl();
- if (_btnYes.MouseButtonDownMsg(msg) && pet) {
+ if (_btnYes.MouseButtonDownMsg(pt) && pet) {
CGameManager *gameManager = pet->getGameManager();
if (gameManager)
gameManager->_gameState._quitGame = true;
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index cfe3e6fb76..72b93c152f 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -55,8 +55,11 @@ public:
*/
virtual bool checkHighlight(const Point &pt);
- virtual bool mouseButtonDownMsg(CMouseButtonDownMsg *msg);
-
+ /**
+ * Handles mouse button up messages
+ */
+ virtual bool MouseButtonUpMsg(const Point &pt);
+
/**
* Returns the tooltip text for when the glyph is selected
*/
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index ec1ea2c727..59702046ba 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -51,32 +51,32 @@ void CPetRealLife::draw(CScreenManager *screenManager) {
}
bool CPetRealLife::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- return _glyphs.mouseButtonDown(msg->_mousePos);
+ return _glyphs.MouseButtonDownMsg(msg->_mousePos);
}
bool CPetRealLife::MouseDragStartMsg(CMouseDragStartMsg *msg) {
- return _glyphs.mouseDragStart(msg);
+ return _glyphs.MouseDragStartMsg(msg);
}
bool CPetRealLife::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
- return _glyphs.mouseDragMove(msg);
+ return _glyphs.MouseDragMoveMsg(msg);
}
bool CPetRealLife::MouseDragEndMsg(CMouseDragEndMsg *msg) {
- return _glyphs.mouseDragEnd(msg);
+ return _glyphs.MouseDragEndMsg(msg);
}
bool CPetRealLife::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
- return _glyphs.mouseButtonUp(msg->_mousePos);
+ return _glyphs.MouseButtonUpMsg(msg->_mousePos);
}
bool CPetRealLife::KeyCharMsg(CKeyCharMsg *msg) {
- _glyphs.keyCharMsg(msg->_key);
+ _glyphs.KeyCharMsg(msg->_key);
return true;
}
bool CPetRealLife::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
- return _glyphs.virtualKeyCharMsg(msg->_keyState.keycode);
+ return _glyphs.VirtualKeyCharMsg(msg->_keyState.keycode);
}
void CPetRealLife::postLoad() {