Skip to content

Commit

Permalink
DIRECTOR: LINGO: Implement setting of timeOutLapsed property
Browse files Browse the repository at this point in the history
  • Loading branch information
r41k0u committed Jun 20, 2022
1 parent 271f2ae commit 649ae31
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions engines/director/director.cpp
Expand Up @@ -121,6 +121,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
_centerStage = true;

_surface = nullptr;
_tickBaseline = 0;
}

DirectorEngine::~DirectorEngine() {
Expand Down
3 changes: 3 additions & 0 deletions engines/director/director.h
Expand Up @@ -245,6 +245,9 @@ class DirectorEngine : public ::Engine {
Graphics::ManagedSurface *_surface;

StartOptions _options;

public:
int _tickBaseline;
};

// An extension of MacPlotData for interfacing with inks and patterns without
Expand Down
2 changes: 1 addition & 1 deletion engines/director/events.cpp
Expand Up @@ -40,7 +40,7 @@

namespace Director {

uint32 DirectorEngine::getMacTicks() { return g_system->getMillis() * 60 / 1000.; }
uint32 DirectorEngine::getMacTicks() { return (g_system->getMillis() * 60 / 1000.) - _tickBaseline; }

bool DirectorEngine::processEvents(bool captureClick) {
debugC(3, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
Expand Down
4 changes: 3 additions & 1 deletion engines/director/lingo/lingo-the.cpp
Expand Up @@ -1105,7 +1105,9 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
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);
if (g_director->getVersion() >= 400 && d.type == INT) {
g_director->_tickBaseline = g_director->getMacTicks() - d.asInt();
}
break;
case kTheTimeoutLength:
g_director->getCurrentMovie()->_timeOutLength = d.asInt();
Expand Down

0 comments on commit 649ae31

Please sign in to comment.