aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-30 14:55:15 -0400
committerPaul Gilbert2016-07-10 16:37:44 -0400
commitb11033800d1455bd4c35af1126bd4f0cf6b2fb77 (patch)
tree51798f1e90cf65b73e3bae936b9a157360f6c6c5 /engines/titanic/core
parent01989265aa6abd68f2aa5d799d867886c8ed3799 (diff)
downloadscummvm-rg350-b11033800d1455bd4c35af1126bd4f0cf6b2fb77.tar.gz
scummvm-rg350-b11033800d1455bd4c35af1126bd4f0cf6b2fb77.tar.bz2
scummvm-rg350-b11033800d1455bd4c35af1126bd4f0cf6b2fb77.zip
TITANIC: Implementing PET support widgets
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/game_object.cpp9
-rw-r--r--engines/titanic/core/game_object.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d2af519fcd..6d9f60d306 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -721,4 +721,13 @@ bool CGameObject::changeView(const CString &viewName, const CString &clipName) {
return true;
}
+void CGameObject::dragMove(const Point &pt) {
+ if (_surface) {
+ _bounds.setWidth(_surface->getWidth());
+ _bounds.setHeight(_surface->getHeight());
+ }
+
+ setPosition(Point(pt.x - _bounds.width() / 2, pt.y - _bounds.height() / 2));
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 94c3e5418d..847d6cd484 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -215,6 +215,11 @@ protected:
* Change the view
*/
bool changeView(const CString &viewName, const CString &clipName);
+
+ /**
+ * Support function for drag moving
+ */
+ void dragMove(const Point &pt);
public:
int _field60;
CursorId _cursorId;