aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/director/director.cpp20
-rw-r--r--engines/director/director.h12
-rw-r--r--engines/director/lingo/lingo-funcs.cpp10
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;
}