aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/input_handler.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-24 07:45:30 -0400
committerPaul Gilbert2016-07-24 07:45:30 -0400
commitfd316a60589f07ac75cfdf1b56188d9d464336bd (patch)
tree121938b97ee70db270755d721fadc6aa1c6a2db0 /engines/titanic/input_handler.cpp
parentf1344c2c277125e652092b94a0a5347f842c45d0 (diff)
downloadscummvm-rg350-fd316a60589f07ac75cfdf1b56188d9d464336bd.tar.gz
scummvm-rg350-fd316a60589f07ac75cfdf1b56188d9d464336bd.tar.bz2
scummvm-rg350-fd316a60589f07ac75cfdf1b56188d9d464336bd.zip
TITANIC: Fleshed out various methods
Diffstat (limited to 'engines/titanic/input_handler.cpp')
-rw-r--r--engines/titanic/input_handler.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 395f55df6f..7c35a5d855 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -22,15 +22,17 @@
#include "titanic/input_handler.h"
#include "titanic/game_manager.h"
-#include "titanic/support/screen_manager.h"
#include "titanic/titanic.h"
+#include "titanic/messages/mouse_messages.h"
#include "titanic/pet_control/pet_control.h"
+#include "titanic/support/screen_manager.h"
namespace Titanic {
CInputHandler::CInputHandler(CGameManager *owner) :
_gameManager(owner), _inputTranslator(nullptr), _dragging(false),
- _buttonDown(false), _dragItem(nullptr), _lockCount(0), _field24(0) {
+ _buttonDown(false), _dragItem(nullptr), _lockCount(0),
+ _singleton(false) {
CScreenManager::_screenManagerPtr->_inputHandler = this;
}
@@ -44,7 +46,13 @@ void CInputHandler::incLockCount() {
void CInputHandler::decLockCount() {
if (--_lockCount == 0 && _inputTranslator) {
- warning("TODO");
+ if (_dragging && !_inputTranslator->isMousePressed()) {
+ CMouseButtonUpMsg upMsg(_mousePos, MK_LBUTTON);
+ handleMessage(upMsg);
+ }
+
+ _buttonDown = _inputTranslator->isMousePressed();
+ _singleton = true;
}
}
@@ -60,11 +68,11 @@ void CInputHandler::handleMessage(CMessage &msg, bool respectLock) {
void CInputHandler::processMessage(CMessage *msg) {
const CMouseMsg *mouseMsg = dynamic_cast<const CMouseMsg *>(msg);
- _field24 = 0;
+ _singleton = false;
dispatchMessage(msg);
- if (_field24) {
- _field24 = 0;
+ if (_singleton) {
+ _singleton = false;
} else if (mouseMsg) {
// Keep the game state mouse position up to date
if (_mousePos != mouseMsg->_mousePos) {