aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-06 23:28:42 -0400
committerPaul Gilbert2016-04-06 23:28:42 -0400
commit51dc36a9a52f95815b4b1109b080d070247bf247 (patch)
treed53d8c288a593fd897536f943debbd2d7b46275e /engines/titanic/core
parent51df4d98d3a066e092f34cf7968c436a3e430df2 (diff)
downloadscummvm-rg350-51dc36a9a52f95815b4b1109b080d070247bf247.tar.gz
scummvm-rg350-51dc36a9a52f95815b4b1109b080d070247bf247.tar.bz2
scummvm-rg350-51dc36a9a52f95815b4b1109b080d070247bf247.zip
TITANIC: Furhter in-progress message handling conversion
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/tree_item.h2
-rw-r--r--engines/titanic/core/view_item.cpp28
-rw-r--r--engines/titanic/core/view_item.h8
3 files changed, 20 insertions, 18 deletions
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index f5b1407fcd..d34f963584 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -29,6 +29,7 @@ namespace Titanic {
class CGameManager;
class CDontSaveFileItem;
+class CMessage;
class CNamedItem;
class CPetControl;
class CProjectItem;
@@ -36,6 +37,7 @@ class CScreenManager;
class CRoomItem;
class CTreeItem: public CMessageTarget {
+ friend class CMessage;
DECLARE_MESSAGE_MAP
private:
CTreeItem *_parent;
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 26e0d86d27..8120b3c671 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -168,9 +168,9 @@ void CViewItem::enterView(CViewItem *newView) {
}
}
-bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
- if (msg._buttons & MB_LEFT) {
- if (!handleMouseMsg(&msg, true)) {
+bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ if (msg->_buttons & MB_LEFT) {
+ if (!handleMouseMsg(msg, true)) {
CGameManager *gm = getGameManager();
if (gm->test54()) {
findNode()->findRoom();
@@ -178,7 +178,7 @@ bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
CLinkItem *linkItem = dynamic_cast<CLinkItem *>(
findChildInstanceOf(CLinkItem::_type));
while (linkItem) {
- if (linkItem->_bounds.contains(msg._mousePos)) {
+ if (linkItem->_bounds.contains(msg->_mousePos)) {
gm->_gameState.triggerLink(linkItem);
return true;
}
@@ -193,24 +193,24 @@ bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
return true;
}
-bool CViewItem::MouseButtonUpMsg(CMouseButtonUpMsg &msg) {
- if (msg._buttons & MB_LEFT)
- handleMouseMsg(&msg, false);
+bool CViewItem::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+ if (msg->_buttons & MB_LEFT)
+ handleMouseMsg(msg, false);
return true;
}
-bool CViewItem::MouseDoubleClickMsg(CMouseDoubleClickMsg &msg) {
- if (msg._buttons & MB_LEFT)
- handleMouseMsg(&msg, false);
+bool CViewItem::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+ if (msg->_buttons & MB_LEFT)
+ handleMouseMsg(msg, false);
return true;
}
-bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
+bool CViewItem::MouseMoveMsg(CMouseMoveMsg *msg) {
CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
- if (handleMouseMsg(&msg, true)) {
+ if (handleMouseMsg(msg, true)) {
screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
} else {
// Iterate through each link item, and if any is highlighted,
@@ -218,7 +218,7 @@ bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
CTreeItem *treeItem = getFirstChild();
while (treeItem) {
CLinkItem *linkItem = dynamic_cast<CLinkItem *>(treeItem);
- if (linkItem && linkItem->_bounds.contains(msg._mousePos)) {
+ if (linkItem && linkItem->_bounds.contains(msg->_mousePos)) {
screenManager->_mouseCursor->setCursor(linkItem->_cursorId);
return true;
}
@@ -226,7 +226,7 @@ bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
treeItem = treeItem->getNextSibling();
}
- if (!handleMouseMsg(&msg, false))
+ if (!handleMouseMsg(msg, false))
screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
}
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index f439929f5e..95edc7a49a 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -52,10 +52,10 @@ protected:
int _field50;
int _field54;
protected:
- virtual bool MouseButtonDownMsg(CMouseButtonDownMsg &msg);
- virtual bool MouseButtonUpMsg(CMouseButtonUpMsg &msg);
- virtual bool MouseMoveMsg(CMouseMoveMsg &msg);
- virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg &msg);
+ virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+ virtual bool MouseMoveMsg(CMouseMoveMsg *msg);
+ virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
public:
int _viewNumber;
public: