diff options
author | Paul Gilbert | 2016-08-29 20:31:09 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-29 20:31:09 -0400 |
commit | f01d1c649b44eac84a630109d0e5708f23313706 (patch) | |
tree | 0e9f428948a113106e9ec2e55410078fe719c21a | |
parent | c13564369983e8b04b899646394c01fe65e361cb (diff) | |
download | scummvm-rg350-f01d1c649b44eac84a630109d0e5708f23313706.tar.gz scummvm-rg350-f01d1c649b44eac84a630109d0e5708f23313706.tar.bz2 scummvm-rg350-f01d1c649b44eac84a630109d0e5708f23313706.zip |
TITANIC: Clarify CMouseCursor saveState as setPosition
-rw-r--r-- | engines/titanic/core/game_object.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 5 | ||||
-rw-r--r-- | engines/titanic/npcs/doorbot.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/support/mouse_cursor.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/support/mouse_cursor.h | 7 |
5 files changed, 19 insertions, 10 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index f450e028d2..2c7b7db998 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -1160,8 +1160,8 @@ void CGameObject::mouseUnlockE4() { CScreenManager::_screenManagerPtr->_mouseCursor->unlockE4(); } -void CGameObject::mouseSaveState(int v1, int v2, int v3) { - CScreenManager::_screenManagerPtr->_mouseCursor->saveState(v1, v2, v3); +void CGameObject::mouseSetPosition(const Point &pt, double rate) { + CScreenManager::_screenManagerPtr->_mouseCursor->setPosition(pt, rate); } void CGameObject::lockInputHandler() { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 39cdb609c2..182d165e89 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -166,7 +166,10 @@ protected: void mouseLockE4(); void mouseUnlockE4(); - void mouseSaveState(int v1, int v2, int v3); + /** + * Sets the mouse to a new position + */ + void mouseSetPosition(const Point &pt, double rate); /** * Lock the input handler diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp index 4a5f3690c0..41ef2b2366 100644 --- a/engines/titanic/npcs/doorbot.cpp +++ b/engines/titanic/npcs/doorbot.cpp @@ -288,7 +288,7 @@ bool CDoorbot::TimerMsg(CTimerMsg *msg) { case 6: CMouseButtonDownMsg::generate(); - mouseSaveState(200, 430, 2500); + mouseSetPosition(Point(200, 430), 2500); _timerId = addTimer(7, 2500, 0); break; @@ -476,7 +476,7 @@ bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) case 10568: mouseLockE4(); - mouseSaveState(600, 250, 2500); + mouseSetPosition(Point(600, 250), 2500); _timerId = addTimer(6, 2500, 0); break; @@ -488,7 +488,7 @@ bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) break; case 10570: - mouseSaveState(200, 430, 2500); + mouseSetPosition(Point(200, 430), 2500); _timerId = addTimer(7, 3000, 0); break; diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp index 068267cb18..4f949a1c0e 100644 --- a/engines/titanic/support/mouse_cursor.cpp +++ b/engines/titanic/support/mouse_cursor.cpp @@ -128,8 +128,11 @@ void CMouseCursor::unlockE4() { CScreenManager::_screenManagerPtr->_inputHandler->decLockCount(); } -void CMouseCursor::saveState(int v1, int v2, int v3) { - // TODO +void CMouseCursor::setPosition(const Point &pt, double rate) { + assert(rate >= 0.0 && rate <= 1.0); + + // TODO: Figure out use of the rate parameter + g_system->warpMouse(pt.x, pt.y); } } // End of namespace Titanic diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h index 7a81ad43fa..74fb1f6113 100644 --- a/engines/titanic/support/mouse_cursor.h +++ b/engines/titanic/support/mouse_cursor.h @@ -24,8 +24,8 @@ #define TITANIC_MOUSE_CURSOR_H #include "common/scummsys.h" -#include "common/rect.h" #include "graphics/managed_surface.h" +#include "titanic/support/rect.h" namespace Titanic { @@ -105,7 +105,10 @@ public: void lockE4(); void unlockE4(); - void saveState(int v1, int v2, int v3); + /** + * Sets the mouse to a new position + */ + void setPosition(const Point &pt, double rate); }; |