From 36d60d7476b62aef07914325adb6f9fd7b30132f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 11 Apr 2016 22:59:58 -0400 Subject: TITANIC: Added remainder of CCarry msg handlers --- engines/titanic/core/game_object.cpp | 20 +++++++++++++++++++- engines/titanic/core/game_object.h | 17 ++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) (limited to 'engines/titanic/core') diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 7e731bdbe7..0bd246d529 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -405,7 +405,7 @@ void CGameObject::resetPosition() { setPosition(_savedPos); } -void CGameObject::setPosition(const Common::Point &newPos) { +void CGameObject::setPosition(const Point &newPos) { makeDirty(); _bounds.moveTo(newPos); makeDirty(); @@ -540,4 +540,22 @@ CViewItem *CGameObject::parseView(const CString &viewString) { return view; } +CString CGameObject::getViewFullName() const { + CGameManager *gameManager = getGameManager(); + CViewItem *view = gameManager->getView(); + CNodeItem *node = view->findNode(); + CRoomItem *room = node->findRoom(); + + return CString::format("%s.%s.%s", room->getName().c_str(), + node->getName().c_str(), view->getName().c_str()); +} + +void CGameObject::sleep(uint milli) { + g_vm->_events->sleep(milli); +} + +Point CGameObject::getMousePos() const { + return getGameManager()->_gameState.getMousePos(); +} + } // End of namespace Titanic diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index bc1020d03f..9e84a453c7 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -145,6 +145,16 @@ protected: * Adds a timer */ int addTimer(int endVal, uint firstDuration, uint duration); + + /** + * Causes the game to sleep for the specified time + */ + void sleep(uint milli); + + /** + * Get the current mouse cursor position + */ + Point getMousePos() const; public: int _field60; CursorId _cursorId; @@ -191,7 +201,7 @@ public: /** * Set the position of the object */ - void setPosition(const Common::Point &newPos); + void setPosition(const Point &newPos); /** * Returns true if the object has a currently active movie @@ -215,6 +225,11 @@ public: * Play the movie specified in _resource */ void playMovie(uint startFrame, uint endFrame, int val3); + + /** + * Return the current view/node/room as a single string + */ + CString getViewFullName() const; }; } // End of namespace Titanic -- cgit v1.2.3