diff options
author | Eugene Sandulenko | 2017-02-24 19:02:57 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-24 19:02:57 +0100 |
commit | e65df86ef1f22089eb9803502087daba3a29c2e2 (patch) | |
tree | 8047f18883733f54b4c70795187e52fe023a33b4 /engines | |
parent | 0bade39c41f9a351d1e703f1682f88c8e0b2e88d (diff) | |
download | scummvm-rg350-e65df86ef1f22089eb9803502087daba3a29c2e2.tar.gz scummvm-rg350-e65df86ef1f22089eb9803502087daba3a29c2e2.tar.bz2 scummvm-rg350-e65df86ef1f22089eb9803502087daba3a29c2e2.zip |
DIRECTOR: Encapsulated _nextMovie parameters into a string
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/director.cpp | 20 | ||||
-rw-r--r-- | engines/director/director.h | 12 | ||||
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 10 |
3 files changed, 26 insertions, 16 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index bfe9a724be..a1ee253087 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -78,7 +78,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam _movies = nullptr; - _nextMovieFrameI = -1; + _nextMovie.frameI = -1; _wm = nullptr; @@ -165,21 +165,25 @@ Common::Error DirectorEngine::run() { _currentScore->loadArchive(); // If we came in a loop, then skip as requested - if (!_nextMovieFrameS.empty()) - _currentScore->setStartToLabel(_nextMovieFrameS); + if (!_nextMovie.frameS.empty()) { + _currentScore->setStartToLabel(_nextMovie.frameS); + _nextMovie.frameS.clear(); + } - if (_nextMovieFrameI != -1) - _currentScore->setCurrentFrame(_nextMovieFrameI); + if (_nextMovie.frameI != -1) { + _currentScore->setCurrentFrame(_nextMovie.frameI); + _nextMovie.frameI = -1; + } _currentScore->startLoop(); // If a loop was requested, do it - if (!_nextMovie.empty()) { + if (!_nextMovie.movie.empty()) { _lingo->restartLingo(); delete _currentScore; - Archive *mov = openMainArchive(_nextMovie); + Archive *mov = openMainArchive(_nextMovie.movie); if (!mov) { warning("nextMovie: No score is loaded"); @@ -190,7 +194,7 @@ Common::Error DirectorEngine::run() { _currentScore = new Score(this, mov); debug(0, "Score name %s", _currentScore->getMacName().c_str()); - _nextMovie.clear(); + _nextMovie.movie.clear(); loop = true; } } diff --git a/engines/director/director.h b/engines/director/director.h index fdbe8ded48..e6835bca3a 100644 --- a/engines/director/director.h +++ b/engines/director/director.h @@ -62,6 +62,14 @@ enum { kDebugLingoParse = 1 << 6 }; +struct MovieReference { + Common::String movie; + Common::String frameS; + int frameI; + + MovieReference() { frameI = -1; } +}; + extern byte defaultPalette[768]; class DirectorEngine : public ::Engine { @@ -112,9 +120,7 @@ public: bool _playbackPaused; bool _skipFrameAdvance; - Common::String _nextMovie; - Common::String _nextMovieFrameS; - int _nextMovieFrameI; + MovieReference _nextMovie; protected: virtual Common::Error run(); diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 339ad9af85..d4e24bcd32 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -211,23 +211,23 @@ void Lingo::func_goto(Datum &frame, Datum &movie) { return; } - _vm->_nextMovie = cleanedFilename; + _vm->_nextMovie.movie = cleanedFilename; _vm->getCurrentScore()->_stopPlay = true; - _vm->_nextMovieFrameS.clear(); - _vm->_nextMovieFrameI = -1; + _vm->_nextMovie.frameS.clear(); + _vm->_nextMovie.frameI = -1; if (frame.type == VOID) return; if (frame.type == STRING) { - _vm->_nextMovieFrameS = *frame.u.s; + _vm->_nextMovie.frameS = *frame.u.s; return; } frame.toInt(); - _vm->_nextMovieFrameI = frame.u.i; + _vm->_nextMovie.frameI = frame.u.i; return; } |