diff options
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/tree_item.h | 2 | ||||
-rw-r--r-- | engines/titanic/core/view_item.cpp | 28 | ||||
-rw-r--r-- | engines/titanic/core/view_item.h | 8 |
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: |