aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-11 22:59:58 -0400
committerPaul Gilbert2016-07-10 16:10:57 -0400
commit36d60d7476b62aef07914325adb6f9fd7b30132f (patch)
tree84134f3d1573046776784334b0d324083f6b7789 /engines/titanic/core
parent7ac4f7c3aa26831f771418472472735cf73bade9 (diff)
downloadscummvm-rg350-36d60d7476b62aef07914325adb6f9fd7b30132f.tar.gz
scummvm-rg350-36d60d7476b62aef07914325adb6f9fd7b30132f.tar.bz2
scummvm-rg350-36d60d7476b62aef07914325adb6f9fd7b30132f.zip
TITANIC: Added remainder of CCarry msg handlers
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/game_object.cpp20
-rw-r--r--engines/titanic/core/game_object.h17
2 files changed, 35 insertions, 2 deletions
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