diff options
author | Dmitry Iskrich | 2016-06-27 21:52:29 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | e1e7051bf20effe8a9b35ab15829fd99dc945583 (patch) | |
tree | f11e006ecebebe118948718f80d4f90d60a72995 /engines/director | |
parent | 825a9fb29f39226a6be0f66ed0253ebafa8b143f (diff) | |
download | scummvm-rg350-e1e7051bf20effe8a9b35ab15829fd99dc945583.tar.gz scummvm-rg350-e1e7051bf20effe8a9b35ab15829fd99dc945583.tar.bz2 scummvm-rg350-e1e7051bf20effe8a9b35ab15829fd99dc945583.zip |
DIRECTOR: Support goto frame jump
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 14 | ||||
-rw-r--r-- | engines/director/score.h | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 39e50f5565..eca6641a31 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -46,7 +46,7 @@ #include "engines/director/lingo/lingo.h" #include "common/file.h" #include "audio/decoders/wave.h" - +#include "common/util.h" #include "director/lingo/lingo-gr.h" namespace Director { @@ -196,8 +196,16 @@ void Lingo::func_goto(Common::String &frame, Common::String &movie) { _vm->_currentScore = _vm->_movies->getVal(movie); _vm->_currentScore->loadArchive(); - if (!frame.empty()) - _vm->_currentScore->setStartToLabel(frame); + if (frame.empty()) + return; + + for (uint16 i = 0; i < frame.size(); i++) { + if (!Common::isDigit(frame[i])) { + _vm->_currentScore->setStartToLabel(frame); + return; + } + } + _vm->_currentScore->setCurrentFrame(strtol(frame.c_str(), 0, 10)); } } diff --git a/engines/director/score.h b/engines/director/score.h index 592201ed97..06536d97b6 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -342,6 +342,7 @@ public: void processEvents(); Archive *getArchive() const { return _movieArchive; }; void loadCastData(Common::SeekableSubReadStreamEndian &stream); + void setCurrentFrame(uint16 frameId) { _currentFrame = frameId; } Common::String getMacName() const { return _macName; } private: void update(); |