diff options
author | Eugene Sandulenko | 2017-02-04 15:16:25 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-04 15:17:13 +0100 |
commit | 6d8d398cf751eb9fe2242ce259a08418c041a6d6 (patch) | |
tree | 3c36dd17b828f49121e48761de8128c455b0ef10 | |
parent | e15f2e7d2dfa37a0a8b13cde2b464cddc52bad12 (diff) | |
download | scummvm-rg350-6d8d398cf751eb9fe2242ce259a08418c041a6d6.tar.gz scummvm-rg350-6d8d398cf751eb9fe2242ce259a08418c041a6d6.tar.bz2 scummvm-rg350-6d8d398cf751eb9fe2242ce259a08418c041a6d6.zip |
DIRECTOR: Implemented pausing/continuing of playback
-rw-r--r-- | engines/director/director.cpp | 1 | ||||
-rw-r--r-- | engines/director/director.h | 1 | ||||
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 8 | ||||
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 4 | ||||
-rw-r--r-- | engines/director/score.cpp | 8 |
5 files changed, 16 insertions, 6 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 958ed9cbea..9417538f54 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -86,6 +86,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam _key = 0; _keyCode = 0; _machineType = 9; // Macintosh IIci + _playbackPaused = false; } DirectorEngine::~DirectorEngine() { diff --git a/engines/director/director.h b/engines/director/director.h index 8d5f6b5211..9277abf2e2 100644 --- a/engines/director/director.h +++ b/engines/director/director.h @@ -107,6 +107,7 @@ public: unsigned char _key; int _keyCode; int _machineType; + bool _playbackPaused; protected: virtual Common::Error run(); diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index cf044f2072..3f0f5e4850 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -681,11 +681,11 @@ void Lingo::b_xFactoryList(int nargs) { // Control /////////////////// void Lingo::b_abort(int nargs) { - warning("STUB: b_continue"); + warning("STUB: b_abort"); } void Lingo::b_continue(int nargs) { - warning("STUB: b_continue"); + g_director->_playbackPaused = false; } void Lingo::b_dontPassEvent(int nargs) { @@ -709,7 +709,9 @@ void Lingo::b_do(int nargs) { } void Lingo::b_pause(int nargs) { - warning("STUB: b_pause"); + g_director->_playbackPaused = true; + + g_lingo->pushVoid(); // Fake value } void Lingo::b_playAccel(int nargs) { diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 140549be8b..ef19293d92 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -169,6 +169,8 @@ void Lingo::func_mciwait(Common::String &s) { } void Lingo::func_goto(Datum &frame, Datum &movie) { + g_director->_playbackPaused = false; + if (movie.type != VOID) { movie.toString(); @@ -221,7 +223,7 @@ void Lingo::func_gotonext() { _vm->_currentScore->gotoNext(); } - + void Lingo::func_gotoprevious() { if (!_vm->_currentScore) return; diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 1e9791637f..deff766f72 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -994,8 +994,11 @@ void Score::update() { } } - _currentFrame++; - if (_currentFrame >= _frames.size()) return; + if (!g_director->_playbackPaused) + _currentFrame++; + + if (_currentFrame >= _frames.size()) + return; _frames[_currentFrame]->prepareFrame(this); // Stage is drawn between the prepareFrame and enterFrame events (Lingo in a Nutshell) @@ -1030,6 +1033,7 @@ void Score::update() { } } } + _nextFrameTime = g_system->getMillis() + (float)_currentFrameRate / 60 * 1000; } |