[Scummvm-git-logs] scummvm master -> bc017c564ac7400a589489169e7c28724e05be94
moralrecordings
code at moral.net.au
Fri Sep 24 17:17:13 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bc017c564a DIRECTOR: LINGO: Implement kTheDoubleClick
Commit: bc017c564ac7400a589489169e7c28724e05be94
https://github.com/scummvm/scummvm/commit/bc017c564ac7400a589489169e7c28724e05be94
Author: Scott Percival (code at moral.net.au)
Date: 2021-09-25T01:13:50+08:00
Commit Message:
DIRECTOR: LINGO: Implement kTheDoubleClick
Changed paths:
engines/director/events.cpp
engines/director/lingo/lingo-the.cpp
engines/director/movie.cpp
engines/director/movie.h
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 64d40dc532..9136f028b6 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -150,6 +150,7 @@ bool Movie::processEvent(Common::Event &event) {
return true;
case Common::EVENT_LBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
if (sc->_waitForClick) {
sc->_waitForClick = false;
sc->renderCursor(_window->getMousePos(), true);
@@ -180,6 +181,7 @@ bool Movie::processEvent(Common::Event &event) {
_mouseDownWasInButton = true;
_lastEventTime = g_director->getMacTicks();
+ _lastClickTime2 = _lastClickTime;
_lastClickTime = _lastEventTime;
_lastClickPos = pos;
if (_timeOutMouse)
@@ -197,6 +199,7 @@ bool Movie::processEvent(Common::Event &event) {
return true;
case Common::EVENT_LBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
pos = _window->getMousePos();
if (g_director->getVersion() < 400)
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 16a605f578..582acd2c21 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -436,7 +436,10 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d = getTheDate(field);
break;
case kTheDoubleClick:
- getTheEntitySTUB(kTheDoubleClick);
+ d.type = INT;
+ // Always measured against the last two clicks.
+ // 25 ticks seems to be the threshold for a double click.
+ d.u.i = (movie->_lastClickTime - movie->_lastClickTime2) <= 25 ? 1 : 0;
break;
case kTheExitLock:
getTheEntitySTUB(kTheExitLock);
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index ff0acf93f9..9f9fe44c32 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -51,6 +51,7 @@ Movie::Movie(Window *window) {
_lastEventTime = _vm->getMacTicks();
_lastKeyTime = _lastEventTime;
_lastClickTime = _lastEventTime;
+ _lastClickTime2 = 0;
_lastRollTime = _lastEventTime;
_lastTimerReset = _lastEventTime;
_nextEventId = 0;
diff --git a/engines/director/movie.h b/engines/director/movie.h
index d705fac1e0..56f958c2df 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -138,6 +138,7 @@ public:
uint32 _lastEventTime;
uint32 _lastRollTime;
uint32 _lastClickTime;
+ uint32 _lastClickTime2;
Common::Point _lastClickPos;
uint32 _lastKeyTime;
uint32 _lastTimerReset;
More information about the Scummvm-git-logs
mailing list