[Scummvm-git-logs] scummvm master -> e24d00a81b3d0a5dece94d9de3ff30cfabe80be2
ysj1173886760
42030331+ysj1173886760 at users.noreply.github.com
Fri Aug 6 08:48:35 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a1b9d60dde DIRECTOR: introduce lastTimeOut and implement get the timeOutLapsed
63f72c5963 DIRECTOR: implement set the timeOutLength
5466511dce DIRECTOR: implement handling timeOut event
e24d00a81b DIRECTOR: implement handling timeOut related values.
Commit: a1b9d60dde7fb295895e0be5b57a5bf31be9c60a
https://github.com/scummvm/scummvm/commit/a1b9d60dde7fb295895e0be5b57a5bf31be9c60a
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-06T16:44:07+08:00
Commit Message:
DIRECTOR: introduce lastTimeOut and implement get the timeOutLapsed
Changed paths:
engines/director/lingo/lingo-the.cpp
engines/director/movie.cpp
engines/director/movie.h
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 70568a28fb..adcb633ac9 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -844,7 +844,8 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
getTheEntitySTUB(kTheTimeoutKeyDown);
break;
case kTheTimeoutLapsed:
- getTheEntitySTUB(kTheTimeoutLapsed);
+ d.type = INT;
+ d.u.i = _vm->getMacTicks() - g_director->getCurrentMovie()->_lastTimeOut;
break;
case kTheTimeoutLength:
getTheEntitySTUB(kTheTimeoutLength);
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 0e737416bf..e359d3decd 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -80,6 +80,8 @@ Movie::Movie(Window *window) {
_checkBoxType = 0;
_checkBoxAccess = 0;
+
+ _lastTimeOut = _lastEventTime;
}
Movie::~Movie() {
diff --git a/engines/director/movie.h b/engines/director/movie.h
index c89d5b25b3..757e62c882 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -162,6 +162,8 @@ public:
uint16 _currentHiliteChannelId;
+ uint _lastTimeOut;
+
private:
Window *_window;
DirectorEngine *_vm;
Commit: 63f72c5963b12b478afed3d855b4fa656f499772
https://github.com/scummvm/scummvm/commit/63f72c5963b12b478afed3d855b4fa656f499772
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-06T16:44:07+08:00
Commit Message:
DIRECTOR: implement set the timeOutLength
Changed paths:
engines/director/lingo/lingo-the.cpp
engines/director/movie.cpp
engines/director/movie.h
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index adcb633ac9..13d47f4042 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -848,7 +848,8 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d.u.i = _vm->getMacTicks() - g_director->getCurrentMovie()->_lastTimeOut;
break;
case kTheTimeoutLength:
- getTheEntitySTUB(kTheTimeoutLength);
+ d.type = INT;
+ d.u.i = g_director->getCurrentMovie()->_timeOutLength;
break;
case kTheTimeoutMouse:
getTheEntitySTUB(kTheTimeoutMouse);
@@ -1080,10 +1081,11 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
setTheEntitySTUB(kTheTimeoutKeyDown);
break;
case kTheTimeoutLapsed:
+ // timeOutLapsed can be set in D4, but can't in D3. see D3.1 interactivity manual p312 and D4 dictionary p296.
setTheEntitySTUB(kTheTimeoutLapsed);
break;
case kTheTimeoutLength:
- setTheEntitySTUB(kTheTimeoutLength);
+ g_director->getCurrentMovie()->_timeOutLength = d.asInt();
break;
case kTheTimeoutMouse:
setTheEntitySTUB(kTheTimeoutMouse);
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index e359d3decd..38f464adf5 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -82,6 +82,7 @@ Movie::Movie(Window *window) {
_checkBoxAccess = 0;
_lastTimeOut = _lastEventTime;
+ _timeOutLength = 10800; // D4 dictionary p297, default value is 3minutes
}
Movie::~Movie() {
diff --git a/engines/director/movie.h b/engines/director/movie.h
index 757e62c882..c00140f5a1 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -163,6 +163,7 @@ public:
uint16 _currentHiliteChannelId;
uint _lastTimeOut;
+ uint _timeOutLength;
private:
Window *_window;
Commit: 5466511dce82a50503870d89b024428c05fbaf6e
https://github.com/scummvm/scummvm/commit/5466511dce82a50503870d89b024428c05fbaf6e
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-06T16:44:07+08:00
Commit Message:
DIRECTOR: implement handling timeOut event
Changed paths:
engines/director/events.cpp
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 5e861d79c0..b2a85c9a36 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -43,6 +43,12 @@ bool DirectorEngine::processEvents(bool captureClick) {
debugC(3, kDebugEvents, "@@@@ Processing events");
debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+ // update and register timeOut event
+ if (g_director->getMacTicks() - g_director->getCurrentMovie()->_lastTimeOut >= g_director->getCurrentMovie()->_timeOutLength) {
+ g_director->getCurrentMovie()->registerEvent(kEventTimeout);
+ g_director->getCurrentMovie()->_lastTimeOut = g_director->getMacTicks();
+ }
+
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
if (!_wm->processEvent(event)) {
Commit: e24d00a81b3d0a5dece94d9de3ff30cfabe80be2
https://github.com/scummvm/scummvm/commit/e24d00a81b3d0a5dece94d9de3ff30cfabe80be2
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-06T16:44:07+08:00
Commit Message:
DIRECTOR: implement handling timeOut related values.
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 b2a85c9a36..c243a20d2b 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -44,13 +44,22 @@ bool DirectorEngine::processEvents(bool captureClick) {
debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
// update and register timeOut event
- if (g_director->getMacTicks() - g_director->getCurrentMovie()->_lastTimeOut >= g_director->getCurrentMovie()->_timeOutLength) {
+ if (getMacTicks() - g_director->getCurrentMovie()->_lastTimeOut >= g_director->getCurrentMovie()->_timeOutLength) {
g_director->getCurrentMovie()->registerEvent(kEventTimeout);
- g_director->getCurrentMovie()->_lastTimeOut = g_director->getMacTicks();
+ g_director->getCurrentMovie()->_lastTimeOut = getMacTicks();
}
+ if (g_director->getCurrentMovie()->_timeOutPlay && g_director->_playbackPaused)
+ g_director->getCurrentMovie()->_lastTimeOut = getMacTicks();
+
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
+ // update timeOut related values
+ if (event.type == Common::EVENT_LBUTTONDOWN && g_director->getCurrentMovie()->_timeOutMouse)
+ g_director->getCurrentMovie()->_lastTimeOut = getMacTicks();
+ if (event.type == Common::EVENT_KEYDOWN && g_director->getCurrentMovie()->_timeOutKeyDown)
+ g_director->getCurrentMovie()->_lastTimeOut = getMacTicks();
+
if (!_wm->processEvent(event)) {
// We only want to handle these events if the event
// wasn't handled by the window manager.
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 13d47f4042..b84e9fbcf6 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -841,7 +841,8 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d = getTheTime(field);
break;
case kTheTimeoutKeyDown:
- getTheEntitySTUB(kTheTimeoutKeyDown);
+ d.type = INT;
+ d.u.i = g_director->getCurrentMovie()->_timeOutKeyDown;
break;
case kTheTimeoutLapsed:
d.type = INT;
@@ -852,10 +853,12 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d.u.i = g_director->getCurrentMovie()->_timeOutLength;
break;
case kTheTimeoutMouse:
- getTheEntitySTUB(kTheTimeoutMouse);
+ d.type = INT;
+ d.u.i = g_director->getCurrentMovie()->_timeOutMouse;
break;
case kTheTimeoutPlay:
- getTheEntitySTUB(kTheTimeoutPlay);
+ d.type = INT;
+ d.u.i = g_director->getCurrentMovie()->_timeOutPlay;
break;
case kTheTimeoutScript:
d.type = STRING;
@@ -1078,7 +1081,7 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
setTheEntitySTUB(kTheSwitchColorDepth);
break;
case kTheTimeoutKeyDown:
- setTheEntitySTUB(kTheTimeoutKeyDown);
+ g_director->getCurrentMovie()->_timeOutKeyDown = d.asInt();
break;
case kTheTimeoutLapsed:
// timeOutLapsed can be set in D4, but can't in D3. see D3.1 interactivity manual p312 and D4 dictionary p296.
@@ -1088,10 +1091,10 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
g_director->getCurrentMovie()->_timeOutLength = d.asInt();
break;
case kTheTimeoutMouse:
- setTheEntitySTUB(kTheTimeoutMouse);
+ g_director->getCurrentMovie()->_timeOutMouse = d.asInt();
break;
case kTheTimeoutPlay:
- setTheEntitySTUB(kTheTimeoutPlay);
+ g_director->getCurrentMovie()->_timeOutPlay = d.asInt();
break;
case kTheTimeoutScript:
movie->setPrimaryEventHandler(kEventTimeout, d.asString());
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 38f464adf5..e77ccd58a3 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -83,6 +83,10 @@ Movie::Movie(Window *window) {
_lastTimeOut = _lastEventTime;
_timeOutLength = 10800; // D4 dictionary p297, default value is 3minutes
+ // default value of keydown and mouse is true, for timeOutPlay is false. check D4 dictionary p297
+ _timeOutKeyDown = true;
+ _timeOutMouse = true;
+ _timeOutPlay = false;
}
Movie::~Movie() {
diff --git a/engines/director/movie.h b/engines/director/movie.h
index c00140f5a1..4ff96f515b 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -164,6 +164,9 @@ public:
uint _lastTimeOut;
uint _timeOutLength;
+ bool _timeOutKeyDown;
+ bool _timeOutMouse;
+ bool _timeOutPlay;
private:
Window *_window;
More information about the Scummvm-git-logs
mailing list