aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2011-01-14 20:08:27 +0000
committerBastien Bouclet2011-01-14 20:08:27 +0000
commitca249f5c65b39f440fe6cea3916022c7b4c47e48 (patch)
treec5e29b9c7d3a4987740cfed1fea2204d9da36212 /engines
parente49b35d7068aa872bb1c172f46343b7507b3adc6 (diff)
downloadscummvm-rg350-ca249f5c65b39f440fe6cea3916022c7b4c47e48.tar.gz
scummvm-rg350-ca249f5c65b39f440fe6cea3916022c7b4c47e48.tar.bz2
scummvm-rg350-ca249f5c65b39f440fe6cea3916022c7b4c47e48.zip
MOHAWK: Implement video looping for Myst's green book
svn-id: r55244
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp32
-rw-r--r--engines/mohawk/myst_stacks/myst.h3
2 files changed, 28 insertions, 7 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 5760bee22d..4aa91e2433 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -220,6 +220,7 @@ void MystScriptParser_Myst::disablePersistentScripts() {
_observatoryDayChanging = false;
_observatoryYearChanging = false;
_observatoryTimeChanging = false;
+ _greenBookRunning = false;
}
void MystScriptParser_Myst::runPersistentScripts() {
@@ -276,6 +277,9 @@ void MystScriptParser_Myst::runPersistentScripts() {
if (_observatoryTimeChanging)
observatoryTimeChange_run();
+
+ if (_greenBookRunning)
+ greenBook_run();
}
uint16 MystScriptParser_Myst::getVar(uint16 var) {
@@ -3251,6 +3255,11 @@ void MystScriptParser_Myst::o_greenBook_init(uint16 op, uint16 var, uint16 argc,
// Used for Card 4168 (Green Book Movies)
debugC(kDebugScript, "Opcode %d: Green book init", op);
+ _greenBookRunning = true;
+ _tempVar = 1;
+}
+
+void MystScriptParser_Myst::greenBook_run() {
uint loopStart = 0;
uint loopEnd = 0;
Common::String file;
@@ -3265,15 +3274,24 @@ void MystScriptParser_Myst::o_greenBook_init(uint16 op, uint16 var, uint16 argc,
file = _vm->wrapMovieFilename("atrusbk2", kMystStack);
}
- _vm->_sound->stopSound();
- _vm->_sound->pauseBackground();
+ if (_tempVar == 1) {
+ _vm->_sound->stopSound();
+ _vm->_sound->pauseBackground();
- if (_globals.ending != 4) {
- _vm->_video->playBackgroundMovie(file, 314, 76);
+ if (_globals.ending != 4) {
+ _tempVar = 2;
+ _vm->_video->playBackgroundMovie(file, 314, 76);
+ } else {
+ VideoHandle book = _vm->_video->playBackgroundMovie(file, 314, 76, true);
+ _vm->_video->setVideoBounds(book, Graphics::VideoTimestamp(loopStart, 600), Graphics::VideoTimestamp(loopEnd, 600));
+ _tempVar = 0;
+ }
+ } else if (_tempVar == 2 && !_vm->_video->isVideoPlaying()) {
+ VideoHandle book = _vm->_video->playBackgroundMovie(file, 314, 76);
+ _vm->_video->setVideoBounds(book, Graphics::VideoTimestamp(loopStart, 600), Graphics::VideoTimestamp(loopEnd, 600));
+ _vm->_video->setVideoLooping(book, true);
+ _tempVar = 0;
}
-
- // TODO: Movie play control
- // loop between loopStart and loopEnd
}
void MystScriptParser_Myst::opcode_222(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index b115711d4f..cbb81b2e07 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -70,6 +70,7 @@ private:
void observatoryDayChange_run();
void observatoryYearChange_run();
void observatoryTimeChange_run();
+ void greenBook_run();
DECLARE_OPCODE(o_libraryBookPageTurnLeft);
DECLARE_OPCODE(o_libraryBookPageTurnRight);
@@ -261,6 +262,8 @@ private:
int16 _observatoryIncrement; // 346
MystResourceType10 *_observatoryCurrentSlider; // 348
+ bool _greenBookRunning;
+
void generatorRedrawRocket();
void generatorButtonValue(MystResource *button, uint16 &offset, uint16 &value);